DXGL r450 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r449‎ | r450 | r451 >
Date:01:12, 8 June 2014
Author:admin
Status:new
Tags:
Comment:
Fix XP compatibility, which was broken in r435.
Modified paths:
  • /ddraw/ddraw.cpp (modified) (history)
  • /ddraw/dllmain.cpp (modified) (history)

Diff [purge]

Index: ddraw/ddraw.cpp
@@ -156,6 +156,7 @@
157157 {
158158 TRACE_ENTER(3,24,lpGUID,14,lplpDD,14,pUnkOuter);
159159 if(!lplpDD) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
 160+ if(!dll_cs.LockCount && !dll_cs.OwningThread) InitializeCriticalSection(&dll_cs);
160161 EnterCriticalSection(&dll_cs);
161162 HRESULT ret;
162163 if(gllock || IsCallerOpenGL(_ReturnAddress()))
Index: ddraw/dllmain.cpp
@@ -18,7 +18,7 @@
1919 #include "common.h"
2020 #include "ddraw.h"
2121 ATOM WindowClass = NULL;
22 -CRITICAL_SECTION dll_cs;
 22+CRITICAL_SECTION dll_cs = {NULL,0,0,NULL,NULL,0};
2323 BOOL APIENTRY DllMain( HMODULE hModule,
2424 DWORD ul_reason_for_call,
2525 LPVOID lpReserved
@@ -27,7 +27,7 @@
2828 switch (ul_reason_for_call)
2929 {
3030 case DLL_PROCESS_ATTACH:
31 - InitializeCriticalSection(&dll_cs);
 31+ if(!dll_cs.LockCount && !dll_cs.OwningThread) InitializeCriticalSection(&dll_cs);
3232 GetCurrentConfig(&dxglcfg, true);
3333 break;
3434 case DLL_THREAD_ATTACH:

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r435Allow multiple DirectDraw objects....admin01:05, 22 April 2014