From fbc617697ce64eb842f37bfe3caee562f4a0873b Mon Sep 17 00:00:00 2001 From: Silent Date: Sat, 2 May 2015 00:46:46 +0200 Subject: [PATCH] Simpler init check for DirectDrawCreateEx --- DDraw/dllmain.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/DDraw/dllmain.cpp b/DDraw/dllmain.cpp index e636a6a..b644584 100644 --- a/DDraw/dllmain.cpp +++ b/DDraw/dllmain.cpp @@ -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); }