Janitorial Projects > COM objects

Joris Huizer jorishuizer at planet.nl
Wed Sep 22 15:35:35 CDT 2004


Hello,

Just to get started, I thought I could do some work of the Interlocking
cleanup;

I tried to do as the suggested patch and came up with this, (just did
dlls/ole32/antimoniker.c as I'd like to know for sure that this is
actually what is wanted)
Also, which files have been done, which aren't covered yet?

regards,

Joris

-------------- next part --------------

Index: dlls/ole32/antimoniker.c
===================================================================
RCS file: /home/wine/wine/dlls/ole32/antimoniker.c,v
retrieving revision 1.21
diff -u -r1.21 antimoniker.c
--- dlls/ole32/antimoniker.c	9 Sep 2004 21:03:58 -0000	1.21
+++ dlls/ole32/antimoniker.c	22 Sep 2004 20:19:21 -0000
@@ -186,7 +186,7 @@
 
     TRACE("(%p)\n",This);
 
-    return ++(This->ref);
+    return InterlockedIncrement(&This->ref);
 }
 
 /******************************************************************************
@@ -195,19 +195,21 @@
 ULONG WINAPI AntiMonikerImpl_Release(IMoniker* iface)
 {
     AntiMonikerImpl *This = (AntiMonikerImpl *)iface;
+    ULONG ref;
 
     TRACE("(%p)\n",This);
 
-    This->ref--;
+    ref = InterlockedDecrement(&This->ref);
+    
 
     /* destroy the object if there's no more reference on it */
-    if (This->ref==0){
+    if (ref == 0){
 
         AntiMonikerImpl_Destroy(This);
 
         return 0;
     }
-    return This->ref;
+    return ref;
 }
 
 /******************************************************************************



More information about the wine-patches mailing list