Simpler init check for DirectDrawCreateEx

This commit is contained in:
Silent 2015-05-02 00:46:46 +02:00
parent a9058040a3
commit fbc617697c

View File

@ -13,8 +13,7 @@
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 bool bLoaded = false;
if ( !bLoaded )
if ( pDirectDrawCreateEx == nullptr )
{
wchar_t wcSystemPath[MAX_PATH];
GetSystemDirectoryW(wcSystemPath, MAX_PATH);
@ -115,8 +114,6 @@ extern "C" HRESULT WINAPI DirectDrawCreateEx(GUID FAR *lpGUID, LPVOID *lplpDD, R
}
pSection++;
}
bLoaded = true;
}
return pDirectDrawCreateEx(lpGUID, lplpDD, iid, pUnkOuter);
}