[PATCH] bits: Added implementation of BITS_IClassFactory_QueryInterface (7/12)
Roy Shea
roy at cs.hmc.edu
Thu Nov 15 10:23:26 CST 2007
---
dlls/qmgr/Makefile.in | 2 +-
dlls/qmgr/factory.c | 28 ++++++++++++++++++++++++----
2 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/dlls/qmgr/Makefile.in b/dlls/qmgr/Makefile.in
index 1886a0d..0eb37d7 100644
--- a/dlls/qmgr/Makefile.in
+++ b/dlls/qmgr/Makefile.in
@@ -4,7 +4,7 @@ SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = qmgr.dll
IMPORTS = kernel32 advapi32 ole32 user32
-EXTRALIBS =
+EXTRALIBS = -luuid
C_SRCS = \
factory.c \
diff --git a/dlls/qmgr/factory.c b/dlls/qmgr/factory.c
index af2a64e..510f566 100644
--- a/dlls/qmgr/factory.c
+++ b/dlls/qmgr/factory.c
@@ -36,10 +36,14 @@ static ULONG WINAPI BITS_IClassFactory_AddRef(LPCLASSFACTORY iface)
TRACE("\n");
- if (This == NULL) return E_POINTER;
+ if (This == NULL)
+ {
+ return E_POINTER;
+ }
ref = InterlockedIncrement(&This->ref);
- if (ref == 1) {
+ if (ref == 1)
+ {
InterlockedIncrement(&dll_ref);
}
return ref;
@@ -50,8 +54,24 @@ static HRESULT WINAPI BITS_IClassFactory_QueryInterface(
REFIID riid,
LPVOID *ppvObj)
{
- FIXME("Not implemented\n");
- return E_NOTIMPL;
+ ICOM_THIS_MULTI(ClassFactoryImpl, classFactoryVtbl, iface);
+
+ TRACE("IID: %s\n",debugstr_guid(riid));
+
+ if (This == NULL || ppvObj == NULL)
+ {
+ return E_POINTER;
+ }
+
+ if (IsEqualGUID(riid, &IID_IUnknown) ||
+ IsEqualGUID(riid, &IID_IClassFactory))
+ {
+ *ppvObj = (LPVOID)iface;
+ BITS_IClassFactory_AddRef(iface);
+ return S_OK;
+ }
+
+ return E_NOINTERFACE;
}
static ULONG WINAPI BITS_IClassFactory_Release(LPCLASSFACTORY iface)
--
1.5.3.1
More information about the wine-patches
mailing list