[PATCH 3/13] ole32: Add a stubbed out implementation of IClientSecurity to the proxy manager.

Robert Shearman rob at codeweavers.com
Mon Mar 26 12:15:04 CDT 2007


---
  dlls/ole32/compobj_private.h |    1
  dlls/ole32/marshal.c         |   87 
+++++++++++++++++++++++++++++++++++++-----
  dlls/ole32/tests/marshal.c   |    2 -
  3 files changed, 79 insertions(+), 11 deletions(-)
-------------- next part --------------
diff --git a/dlls/ole32/compobj_private.h b/dlls/ole32/compobj_private.h
index a85a72d..0d27922 100644
--- a/dlls/ole32/compobj_private.h
+++ b/dlls/ole32/compobj_private.h
@@ -121,6 +121,7 @@ struct proxy_manager
 {
   const IMultiQIVtbl *lpVtbl;
   const IMarshalVtbl *lpVtblMarshal;
+  const IClientSecurityVtbl *lpVtblCliSec;
   struct apartment *parent; /* owning apartment (RO) */
   struct list entry;        /* entry in apartment (CS parent->cs) */
   OXID oxid;                /* object exported ID (RO) */
diff --git a/dlls/ole32/marshal.c b/dlls/ole32/marshal.c
index 55afade..ded3a6a 100644
--- a/dlls/ole32/marshal.c
+++ b/dlls/ole32/marshal.c
@@ -335,6 +335,13 @@ static const IMultiQIVtbl ClientIdentity
     ClientIdentity_QueryMultipleInterfaces
 };
 
+/* FIXME: remove these */
+static HRESULT WINAPI StdMarshalImpl_GetUnmarshalClass(LPMARSHAL iface, REFIID riid, void* pv, DWORD dwDestContext, void* pvDestContext, DWORD mshlflags, CLSID* pCid);
+static HRESULT WINAPI StdMarshalImpl_GetMarshalSizeMax(LPMARSHAL iface, REFIID riid, void* pv, DWORD dwDestContext, void* pvDestContext, DWORD mshlflags, DWORD* pSize);
+static HRESULT WINAPI StdMarshalImpl_UnmarshalInterface(LPMARSHAL iface, IStream *pStm, REFIID riid, void **ppv);
+static HRESULT WINAPI StdMarshalImpl_ReleaseMarshalData(LPMARSHAL iface, IStream *pStm);
+static HRESULT WINAPI StdMarshalImpl_DisconnectObject(LPMARSHAL iface, DWORD dwReserved);
+
 static HRESULT WINAPI Proxy_QueryInterface(IMarshal *iface, REFIID riid, void **ppvObject)
 {
     ICOM_THIS_MULTI(struct proxy_manager, lpVtblMarshal, iface);
@@ -347,13 +354,6 @@ static ULONG WINAPI Proxy_AddRef(IMarsha
     return IMultiQI_AddRef((IMultiQI *)&This->lpVtbl);
 }
 
-/* FIXME: remove these */
-static HRESULT WINAPI StdMarshalImpl_GetUnmarshalClass(LPMARSHAL iface, REFIID riid, void* pv, DWORD dwDestContext, void* pvDestContext, DWORD mshlflags, CLSID* pCid);
-static HRESULT WINAPI StdMarshalImpl_GetMarshalSizeMax(LPMARSHAL iface, REFIID riid, void* pv, DWORD dwDestContext, void* pvDestContext, DWORD mshlflags, DWORD* pSize);
-static HRESULT WINAPI StdMarshalImpl_UnmarshalInterface(LPMARSHAL iface, IStream *pStm, REFIID riid, void **ppv);
-static HRESULT WINAPI StdMarshalImpl_ReleaseMarshalData(LPMARSHAL iface, IStream *pStm);
-static HRESULT WINAPI StdMarshalImpl_DisconnectObject(LPMARSHAL iface, DWORD dwReserved);
-
 static ULONG WINAPI Proxy_Release(IMarshal *iface)
 {
     ICOM_THIS_MULTI(struct proxy_manager, lpVtblMarshal, iface);
@@ -473,6 +473,72 @@ static const IMarshalVtbl ProxyMarshal_V
     StdMarshalImpl_DisconnectObject
 };
 
+static HRESULT WINAPI ProxyCliSec_QueryInterface(IClientSecurity *iface, REFIID riid, void **ppvObject)
+{
+    ICOM_THIS_MULTI(struct proxy_manager, lpVtblCliSec, iface);
+    return IMultiQI_QueryInterface((IMultiQI *)&This->lpVtbl, riid, ppvObject);
+}
+
+static ULONG WINAPI ProxyCliSec_AddRef(IClientSecurity *iface)
+{
+    ICOM_THIS_MULTI(struct proxy_manager, lpVtblCliSec, iface);
+    return IMultiQI_AddRef((IMultiQI *)&This->lpVtbl);
+}
+
+static ULONG WINAPI ProxyCliSec_Release(IClientSecurity *iface)
+{
+    ICOM_THIS_MULTI(struct proxy_manager, lpVtblCliSec, iface);
+    return IMultiQI_Release((IMultiQI *)&This->lpVtbl);
+}
+
+static HRESULT WINAPI ProxyCliSec_QueryBlanket(IClientSecurity *iface,
+                                               IUnknown *pProxy,
+                                               DWORD *pAuthnSvc,
+                                               DWORD *pAuthzSvc,
+                                               OLECHAR **pServerPrincName,
+                                               DWORD *pAuthnLevel,
+                                               DWORD *pImpLevel,
+                                               void **pAuthInfo,
+                                               DWORD *pCapabilities)
+{
+    FIXME("(%p, %p, %p, %p, %p, %p, %p, %p): stub\n", pProxy, pAuthnSvc,
+          pAuthzSvc, pServerPrincName, pAuthnLevel, pImpLevel, pAuthInfo,
+          pCapabilities);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI ProxyCliSec_SetBlanket(IClientSecurity *iface,
+                                             IUnknown *pProxy, DWORD AuthnSvc,
+                                             DWORD AuthzSvc,
+                                             OLECHAR *pServerPrincName,
+                                             DWORD AuthnLevel, DWORD ImpLevel,
+                                             void *pAuthInfo,
+                                             DWORD Capabilities)
+{
+    FIXME("(%p, %d, %d, %s, %d, %d, %p, 0x%x): stub\n", pProxy, AuthnSvc,
+          AuthzSvc, debugstr_w(pServerPrincName), AuthnLevel, ImpLevel,
+          pAuthInfo, Capabilities);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI ProxyCliSec_CopyProxy(IClientSecurity *iface,
+                                            IUnknown *pProxy, IUnknown **ppCopy)
+{
+    FIXME("(%p, %p): stub\n", pProxy, ppCopy);
+    *ppCopy = NULL;
+    return E_NOTIMPL;
+}
+
+static const IClientSecurityVtbl ProxyCliSec_Vtbl =
+{
+    ProxyCliSec_QueryInterface,
+    ProxyCliSec_AddRef,
+    ProxyCliSec_Release,
+    ProxyCliSec_QueryBlanket,
+    ProxyCliSec_SetBlanket,
+    ProxyCliSec_CopyProxy
+};
+
 static HRESULT ifproxy_get_public_ref(struct ifproxy * This)
 {
     HRESULT hr = S_OK;
@@ -599,6 +665,7 @@ static HRESULT proxy_manager_construct(
 
     This->lpVtbl = &ClientIdentity_Vtbl;
     This->lpVtblMarshal = &ProxyMarshal_Vtbl;
+    This->lpVtblCliSec = &ProxyCliSec_Vtbl;
 
     list_init(&This->entry);
     list_init(&This->interfaces);
@@ -723,9 +790,9 @@ static HRESULT proxy_manager_query_local
     }
     if (IsEqualIID(riid, &IID_IClientSecurity))
     {
-        FIXME("requesting IClientSecurity, but it is unimplemented\n");
-        *ppv = NULL;
-        return E_NOINTERFACE;
+        *ppv = (void *)&This->lpVtblCliSec;
+        IUnknown_AddRef((IUnknown *)*ppv);
+        return S_OK;
     }
 
     hr = proxy_manager_find_ifproxy(This, riid, &ifproxy);
diff --git a/dlls/ole32/tests/marshal.c b/dlls/ole32/tests/marshal.c
index 0c0dff7..0e588ba 100644
--- a/dlls/ole32/tests/marshal.c
+++ b/dlls/ole32/tests/marshal.c
@@ -1405,7 +1405,7 @@ static void test_proxy_interfaces(void)
     if (hr == S_OK) IUnknown_Release(pOtherUnknown);
 
     hr = IUnknown_QueryInterface(pProxy, &IID_IClientSecurity, (LPVOID*)&pOtherUnknown);
-    todo_wine { ok_ole_success(hr, IUnknown_QueryInterface IID_IClientSecurity); }
+    ok_ole_success(hr, IUnknown_QueryInterface IID_IClientSecurity);
     if (hr == S_OK) IUnknown_Release(pOtherUnknown);
 
     hr = IUnknown_QueryInterface(pProxy, &IID_IMultiQI, (LPVOID*)&pOtherUnknown);


More information about the wine-patches mailing list