Remove bogus use of nStatCounter and hOleAut32 in CoSetState

Dmitry Timoshkov dmitry at baikal.ru
Sun Oct 24 09:30:13 CDT 2004


Hello,

FreeLibrary(hOleAut32) with hOleAut32 not actually being initialized
looks very wrong, hOleAut32 is not used at all anyway. Per thread data
do not need a protection by critical section.

Changelog:
    Dmitry Timoshkov <dmitry at codeweavers.com>
    - Remove bogus use of nStatCounter and hOleAut32 in CoSetState.
    - Remove a comment about protecting per thread data by a critical section.

--- cvs/hq/wine/dlls/ole32/compobj.c	Sun Oct 24 01:56:54 2004
+++ wine/dlls/ole32/compobj.c	Sun Oct 24 14:22:04 2004
@@ -1962,9 +1962,6 @@ HRESULT WINAPI CoInitializeWOW(DWORD x,D
     return 0;
 }
 
-static int nStatCounter = 0;	 /* global */
-static HMODULE hOleAut32 = 0;	 /* global */
-
 /***********************************************************************
  *           CoGetState [OLE32.@]
  *
@@ -1990,7 +1987,6 @@ HRESULT WINAPI CoGetState(IUnknown ** pp
 /***********************************************************************
  *           CoSetState [OLE32.@]
  *
- * NOTES: FIXME: protect this with a crst
  */
 HRESULT WINAPI CoSetState(IUnknown * pv)
 {
@@ -2002,15 +1998,11 @@ HRESULT WINAPI CoSetState(IUnknown * pv)
 
 	if (pv) {
 	    IUnknown_AddRef(pv);
-	    nStatCounter++;
-	    if (nStatCounter == 1) LoadLibraryA("OLEAUT32.DLL");
 	}
 
 	if (apt->state) {
 	    TRACE("-- release %p now\n", apt->state);
 	    IUnknown_Release(apt->state);
-	    nStatCounter--;
-	    if (!nStatCounter) FreeLibrary(hOleAut32);
 	}
 	apt->state = pv;
 	return S_OK;






More information about the wine-patches mailing list