mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2024-12-29 15:23:02 +05:00
Simpler init check for DirectDrawCreateEx
This commit is contained in:
parent
a9058040a3
commit
fbc617697c
1 changed files with 1 additions and 4 deletions
|
@ -13,8 +13,7 @@
|
||||||
extern "C" HRESULT WINAPI DirectDrawCreateEx(GUID FAR *lpGUID, LPVOID *lplpDD, REFIID iid, IUnknown FAR *pUnkOuter)
|
extern "C" HRESULT WINAPI DirectDrawCreateEx(GUID FAR *lpGUID, LPVOID *lplpDD, REFIID iid, IUnknown FAR *pUnkOuter)
|
||||||
{
|
{
|
||||||
static HRESULT (WINAPI *pDirectDrawCreateEx)(GUID FAR*, LPVOID*, REFIID, IUnknown FAR*);
|
static HRESULT (WINAPI *pDirectDrawCreateEx)(GUID FAR*, LPVOID*, REFIID, IUnknown FAR*);
|
||||||
static bool bLoaded = false;
|
if ( pDirectDrawCreateEx == nullptr )
|
||||||
if ( !bLoaded )
|
|
||||||
{
|
{
|
||||||
wchar_t wcSystemPath[MAX_PATH];
|
wchar_t wcSystemPath[MAX_PATH];
|
||||||
GetSystemDirectoryW(wcSystemPath, MAX_PATH);
|
GetSystemDirectoryW(wcSystemPath, MAX_PATH);
|
||||||
|
@ -115,8 +114,6 @@ extern "C" HRESULT WINAPI DirectDrawCreateEx(GUID FAR *lpGUID, LPVOID *lplpDD, R
|
||||||
}
|
}
|
||||||
pSection++;
|
pSection++;
|
||||||
}
|
}
|
||||||
|
|
||||||
bLoaded = true;
|
|
||||||
}
|
}
|
||||||
return pDirectDrawCreateEx(lpGUID, lplpDD, iid, pUnkOuter);
|
return pDirectDrawCreateEx(lpGUID, lplpDD, iid, pUnkOuter);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue