Huw Davies : msdaps: Make use of the row server in IBindResource_Bind.

Alexandre Julliard julliard at winehq.org
Fri Feb 5 08:42:33 CST 2010


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

Author: Huw Davies <huw at codeweavers.com>
Date:   Thu Feb  4 15:22:29 2010 +0000

msdaps: Make use of the row server in IBindResource_Bind.

---

 dlls/msdaps/main.c       |    1 +
 dlls/msdaps/usrmarshal.c |   40 ++++++++++++++++++++++++++++++++++++++--
 2 files changed, 39 insertions(+), 2 deletions(-)

diff --git a/dlls/msdaps/main.c b/dlls/msdaps/main.c
index 92ed78b..1312fc4 100644
--- a/dlls/msdaps/main.c
+++ b/dlls/msdaps/main.c
@@ -31,6 +31,7 @@
 #include "winerror.h"
 #include "objbase.h"
 #include "oleauto.h"
+#define DBINITCONSTANTS
 #include "oledb.h"
 
 #include "row_server.h"
diff --git a/dlls/msdaps/usrmarshal.c b/dlls/msdaps/usrmarshal.c
index a2cea91..f889097 100644
--- a/dlls/msdaps/usrmarshal.c
+++ b/dlls/msdaps/usrmarshal.c
@@ -448,6 +448,12 @@ HRESULT CALLBACK IBindResource_Bind_Proxy(IBindResource* This, IUnknown *pUnkOut
     TRACE("(%p, %p, %s, %08x, %s, %s, %p, %p, %p, %p)\n", This, pUnkOuter, debugstr_w(pwszURL), dwBindURLFlags,
           debugstr_guid(rguid), debugstr_guid(riid), pAuthenticate, pImplSession, pdwBindStatus, ppUnk);
 
+    if(pUnkOuter)
+    {
+        FIXME("Aggregation not supported\n");
+        return CLASS_E_NOAGGREGATION;
+    }
+
     hr = IBindResource_RemoteBind_Proxy(This, pUnkOuter, pwszURL, dwBindURLFlags, rguid, riid, pAuthenticate,
                                         pImplSession ? pImplSession->pUnkOuter : NULL, pImplSession ? pImplSession->piid : NULL,
                                         pImplSession ? &pImplSession->pSession : NULL, pdwBindStatus, ppUnk);
@@ -460,16 +466,46 @@ HRESULT __RPC_STUB IBindResource_Bind_Stub(IBindResource* This, IUnknown *pUnkOu
 {
     HRESULT hr;
     DBIMPLICITSESSION impl_session;
+    IWineRowServer *server;
+    IMarshal *marshal;
+    IUnknown *obj;
 
     TRACE("(%p, %p, %s, %08x, %s, %s, %p, %p, %p, %p, %p, %p)\n", This, pUnkOuter, debugstr_w(pwszURL), dwBindURLFlags,
           debugstr_guid(rguid), debugstr_guid(riid), pAuthenticate, pSessionUnkOuter, piid, ppSession, pdwBindStatus, ppUnk);
 
+    *ppUnk = NULL;
+
+    if(IsEqualGUID(rguid, &DBGUID_ROWSET))
+        hr = CoCreateInstance(&CLSID_wine_rowset_server, NULL, CLSCTX_INPROC_SERVER, &IID_IWineRowServer, (void**)&server);
+    else if(IsEqualGUID(rguid, &DBGUID_ROW))
+        hr = CoCreateInstance(&CLSID_wine_row_server, NULL, CLSCTX_INPROC_SERVER, &IID_IWineRowServer, (void**)&server);
+    else
+    {
+        hr = E_NOTIMPL;
+        FIXME("Unhandled object %s\n", debugstr_guid(rguid));
+    }
+
+    if(FAILED(hr)) return hr;
+
     impl_session.pUnkOuter = pSessionUnkOuter;
     impl_session.piid = piid;
     impl_session.pSession = NULL;
 
-    hr = IBindResource_Bind(This, pUnkOuter, pwszURL, dwBindURLFlags, rguid, riid, pAuthenticate,
-                            ppSession ? &impl_session : NULL, pdwBindStatus, ppUnk);
+    IWineRowServer_GetMarshal(server, &marshal);
+
+    hr = IBindResource_Bind(This, (IUnknown*)marshal, pwszURL, dwBindURLFlags, rguid, &IID_IUnknown, pAuthenticate,
+                            ppSession ? &impl_session : NULL, pdwBindStatus, &obj);
+
+    IMarshal_Release(marshal);
+    if(FAILED(hr))
+    {
+        IWineRowServer_Release(server);
+        return hr;
+    }
+
+    IWineRowServer_SetInnerUnk(server, obj);
+    hr = IUnknown_QueryInterface(obj, riid, (void**)ppUnk);
+    IUnknown_Release(obj);
 
     if(ppSession) *ppSession = impl_session.pSession;
     return hr;




More information about the wine-cvs mailing list