Removes outdated user32.dll preload hack added in 7a889deca3 and became useless in bbcd9b34cc.

Refs 4b33f49da1, b242eafd02, 56bd5b59b4.

Tested By: Angen
Differential Revision: https://code.wildfiregames.com/D4007
This was SVN commit r25566.
This commit is contained in:
Vladislav Belov 2021-05-25 18:29:50 +00:00
parent 3f371f40b1
commit 007d30f4b4

View File

@ -342,37 +342,6 @@ static void FreeDirectories()
wutil_Free(personalPath);
}
//-----------------------------------------------------------------------------
// user32 fix
// HACK: make sure a reference to user32 is held, even if someone
// decides to delay-load it. this fixes bug #66, which was the
// Win32 mouse cursor (set via user32!SetCursor) appearing as a
// black 32x32(?) rectangle. the underlying cause was as follows:
// powrprof.dll was the first client of user32, causing it to be
// loaded. after we were finished with powrprof, we freed it, in turn
// causing user32 to unload. later code would then reload user32,
// which apparently terminally confused the cursor implementation.
//
// since we hold a reference here, user32 will never unload.
// of course, the benefits of delay-loading are lost for this DLL,
// but that is unavoidable. it is safer to force loading it, rather
// than documenting the problem and asking it not be delay-loaded.
static HMODULE hUser32Dll;
static void ForciblyLoadUser32Dll()
{
hUser32Dll = LoadLibraryW(L"user32.dll");
}
// avoids Boundschecker warning
static void FreeUser32Dll()
{
FreeLibrary(hUser32Dll);
}
//-----------------------------------------------------------------------------
// memory
@ -559,8 +528,6 @@ static Status wutil_Init()
{
InitLocks();
ForciblyLoadUser32Dll();
EnableLowFragmentationHeap();
ReadCommandLine();
@ -578,8 +545,6 @@ static Status wutil_Shutdown()
{
FreeCommandLine();
FreeUser32Dll();
ShutdownLocks();
FreeDirectories();