Mike McCormack : msi: Implement IDispatch->CreateInstance() for the msi server dll.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Jan 25 06:12:19 CST 2007


Module: wine
Branch: master
Commit: 9c76a0b37afd3650b01784dbba61fdf3fad90808
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9c76a0b37afd3650b01784dbba61fdf3fad90808

Author: Mike McCormack <mike at codeweavers.com>
Date:   Thu Jan 25 19:18:18 2007 +0900

msi: Implement IDispatch->CreateInstance() for the msi server dll.

---

 dlls/msi/msi_main.c |   37 +++++++++++++++++++++++++++++--------
 1 files changed, 29 insertions(+), 8 deletions(-)

diff --git a/dlls/msi/msi_main.c b/dlls/msi/msi_main.c
index 48cfd15..dc9d7f4 100644
--- a/dlls/msi/msi_main.c
+++ b/dlls/msi/msi_main.c
@@ -80,8 +80,15 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL,
 
 typedef struct tagIClassFactoryImpl {
     const IClassFactoryVtbl *lpVtbl;
+    HRESULT (*create_object)( IUnknown*, LPVOID* );
 } IClassFactoryImpl;
 
+static HRESULT create_msiserver( IUnknown *pOuter, LPVOID *ppObj )
+{
+    FIXME("\n");
+    return E_FAIL;
+}
+
 static HRESULT WINAPI MsiCF_QueryInterface(LPCLASSFACTORY iface,
                 REFIID riid,LPVOID *ppobj)
 {
@@ -115,9 +122,18 @@ static HRESULT WINAPI MsiCF_CreateInstan
     LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
 {
     IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
+    IUnknown *unk = NULL;
+    HRESULT r;
 
-    FIXME("%p %p %s %p\n", This, pOuter, debugstr_guid(riid), ppobj);
-    return E_FAIL;
+    TRACE("%p %p %s %p\n", This, pOuter, debugstr_guid(riid), ppobj);
+
+    r = This->create_object( pOuter, ppobj );
+    if (SUCCEEDED(r))
+    {
+        r = IUnknown_QueryInterface( unk, riid, ppobj );
+        IUnknown_Release( unk );
+    }
+    return r;
 }
 
 static HRESULT WINAPI MsiCF_LockServer(LPCLASSFACTORY iface, BOOL dolock)
@@ -141,7 +157,7 @@ static const IClassFactoryVtbl MsiCF_Vtb
     MsiCF_LockServer
 };
 
-static IClassFactoryImpl Msi_CF = { &MsiCF_Vtbl };
+static IClassFactoryImpl MsiServer_CF = { &MsiCF_Vtbl, create_msiserver };
 
 /******************************************************************
  * DllGetClassObject          [MSI.@]
@@ -150,15 +166,20 @@ HRESULT WINAPI DllGetClassObject(REFCLSI
 {
     TRACE("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
 
-    if( IsEqualCLSID (rclsid, &CLSID_IMsiServer) ||
-        IsEqualCLSID (rclsid, &CLSID_IMsiServerMessage) ||
+    if ( IsEqualCLSID (rclsid, &CLSID_IMsiServerX2) )
+    {
+        *ppv = (LPVOID) &MsiServer_CF;
+        return S_OK;
+    }
+
+    if( IsEqualCLSID (rclsid, &CLSID_IMsiServerMessage) ||
+        IsEqualCLSID (rclsid, &CLSID_IMsiServer) ||
         IsEqualCLSID (rclsid, &CLSID_IMsiServerX1) ||
-        IsEqualCLSID (rclsid, &CLSID_IMsiServerX2) ||
         IsEqualCLSID (rclsid, &CLSID_IMsiServerX3) )
     {
-        *ppv = (LPVOID) &Msi_CF;
-        return S_OK;
+        FIXME("create %s object\n", debugstr_guid( rclsid ));
     }
+
     return CLASS_E_CLASSNOTAVAILABLE;
 }
 




More information about the wine-cvs mailing list