[QCAP] ObjRefCount fixes

Maarten Lankhorst m.b.lankhorst at gmail.com
Wed May 18 09:19:51 CDT 2005


 From what I can tell Dll can be unloaded when nothing exists any more, 
this should fix false dllcanunloadnow errors

DllCanUnloadNow fix
Fixed ObjRefCount for EnumPins
-------------- next part --------------
Index: qcap_main.c
===================================================================
RCS file: /home/wine/wine/dlls/qcap/qcap_main.c,v
retrieving revision 1.5
diff -u -p -r1.5 qcap_main.c
--- qcap_main.c	7 May 2005 18:18:39 -0000	1.5
+++ qcap_main.c	18 May 2005 14:12:11 -0000
@@ -195,7 +195,7 @@ HRESULT WINAPI QCAP_DllCanUnloadNow(void
 {
     TRACE("\n");
 
-    if (objects_ref == 0 || server_locks == 0)
+    if (objects_ref == 0 && server_locks == 0)
         return S_OK;
     return S_FALSE;	
 }
Index: enumpins.c
===================================================================
RCS file: /home/wine/wine/dlls/qcap/enumpins.c,v
retrieving revision 1.1
diff -u -p -r1.1 enumpins.c
--- enumpins.c	17 May 2005 14:31:35 -0000	1.1
+++ enumpins.c	18 May 2005 14:12:11 -0000
@@ -58,6 +58,7 @@ HRESULT IEnumPinsImpl_Construct(const EN
     pEnumPins->uIndex = 0;
     CopyMemory(&pEnumPins->enumPinDetails, pDetails, sizeof(ENUMPINDETAILS));
     *ppEnum = (IEnumPins *)(&pEnumPins->lpVtbl);
+    ObjectRefCount(TRUE);
     return S_OK;
 }
 
@@ -103,10 +104,9 @@ static ULONG WINAPI IEnumPinsImpl_Releas
     if (!refCount)
     {
         CoTaskMemFree(This);
-        return 0;
+        ObjectRefCount(FALSE);
     }
-    else
-        return refCount;
+    return refCount;
 }
 
 static HRESULT WINAPI IEnumPinsImpl_Next(IEnumPins * iface, ULONG cPins, IPin ** ppPins, ULONG * pcFetched)


More information about the wine-patches mailing list