[PATCH] bits: Implemented BITS_IClassFactory_AddRef (6/12)

Roy Shea roy at cs.hmc.edu
Thu Nov 15 10:23:09 CST 2007


---
 dlls/qmgr/factory.c      |   16 +++++++++++++---
 dlls/qmgr/qmgr_private.h |    2 +-
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/dlls/qmgr/factory.c b/dlls/qmgr/factory.c
index daaedce..af2a64e 100644
--- a/dlls/qmgr/factory.c
+++ b/dlls/qmgr/factory.c
@@ -27,12 +27,22 @@
 #include "qmgr_private.h"
 #include "wine/debug.h"
 
-WINE_DEFAULT_DEBUG_CHANNEL(qmgr_svchost);
+WINE_DEFAULT_DEBUG_CHANNEL(qmgr);
 
 static ULONG WINAPI BITS_IClassFactory_AddRef(LPCLASSFACTORY iface)
 {
-    FIXME("Not implemented\n");
-    return E_NOTIMPL;
+    ICOM_THIS_MULTI(ClassFactoryImpl, classFactoryVtbl, iface);
+    ULONG ref;
+
+    TRACE("\n");
+
+    if (This == NULL) return E_POINTER;
+
+    ref = InterlockedIncrement(&This->ref);
+    if (ref == 1) {
+        InterlockedIncrement(&dll_ref);
+    }
+    return ref;
 }
 
 static HRESULT WINAPI BITS_IClassFactory_QueryInterface(
diff --git a/dlls/qmgr/qmgr_private.h b/dlls/qmgr/qmgr_private.h
index b57a041..8dead77 100644
--- a/dlls/qmgr/qmgr_private.h
+++ b/dlls/qmgr/qmgr_private.h
@@ -38,7 +38,7 @@ extern LONG dll_ref;
 /* Factory vtbl and related data */
 typedef struct
 {
-    const IClassFactoryVtbl *lpVtbl;
+    const IClassFactoryVtbl *classFactoryVtbl;
     LONG ref;
 } ClassFactoryImpl;
 
-- 
1.5.3.1




More information about the wine-patches mailing list