Huw Davies : msdaps: Add a stub marshaller object.

Alexandre Julliard julliard at winehq.org
Wed Feb 3 09:33:05 CST 2010


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

Author: Huw Davies <huw at codeweavers.com>
Date:   Tue Feb  2 11:52:51 2010 +0000

msdaps: Add a stub marshaller object.

---

 dlls/msdaps/row_server.c |  160 ++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 155 insertions(+), 5 deletions(-)

diff --git a/dlls/msdaps/row_server.c b/dlls/msdaps/row_server.c
index 982a631..14f11d2 100644
--- a/dlls/msdaps/row_server.c
+++ b/dlls/msdaps/row_server.c
@@ -53,16 +53,166 @@ HRESULT create_rowset_server(IUnknown *outer, void **obj)
     return E_NOTIMPL;
 }
 
-HRESULT create_row_marshal(IUnknown *outer, void **obj)
+/* Marshal impl */
+
+typedef struct
 {
-    FIXME("(%p, %p): stub\n", outer, obj);
-    *obj = NULL;
+    const IMarshalVtbl *marshal_vtbl;
+
+    LONG ref;
+    CLSID unmarshal_class;
+    IUnknown *outer;
+} marshal;
+
+static inline marshal *impl_from_IMarshal(IMarshal *iface)
+{
+    return (marshal *)((char*)iface - FIELD_OFFSET(marshal, marshal_vtbl));
+}
+
+static HRESULT WINAPI marshal_QueryInterface(IMarshal *iface, REFIID iid, void **obj)
+{
+    marshal *This = impl_from_IMarshal(iface);
+    TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(iid), obj);
+
+    if(IsEqualIID(iid, &IID_IUnknown) ||
+       IsEqualIID(iid, &IID_IMarshal))
+    {
+        *obj = iface;
+    }
+    else
+    {
+        FIXME("interface %s not implemented\n", debugstr_guid(iid));
+        *obj = NULL;
+        return E_NOINTERFACE;
+    }
+
+    IMarshal_AddRef(iface);
+    return S_OK;
+}
+
+static ULONG WINAPI marshal_AddRef(IMarshal *iface)
+{
+    marshal *This = impl_from_IMarshal(iface);
+    TRACE("(%p)\n", This);
+    return InterlockedIncrement(&This->ref);
+}
+
+static ULONG WINAPI marshal_Release(IMarshal *iface)
+{
+    marshal *This = impl_from_IMarshal(iface);
+    LONG ref;
+
+    TRACE("(%p)\n", This);
+
+    ref = InterlockedDecrement(&This->ref);
+    if(ref == 0)
+    {
+        HeapFree(GetProcessHeap(), 0, This);
+    }
+
+    return ref;
+}
+
+static HRESULT WINAPI marshal_GetUnmarshalClass(IMarshal *iface, REFIID iid, void *obj,
+                                                DWORD dwDestContext, void *pvDestContext,
+                                                DWORD mshlflags, CLSID *clsid)
+{
+    marshal *This = impl_from_IMarshal(iface);
+    FIXME("(%p)->(%s, %p, %08x, %p, %08x, %p): stub\n", This, debugstr_guid(iid), obj, dwDestContext,
+          pvDestContext, mshlflags, clsid);
+
     return E_NOTIMPL;
 }
 
-HRESULT create_rowset_marshal(IUnknown *outer, void **obj)
+static HRESULT WINAPI marshal_GetMarshalSizeMax(IMarshal *iface, REFIID iid, void *obj,
+                                                DWORD dwDestContext, void *pvDestContext,
+                                                DWORD mshlflags, DWORD *size)
 {
-    FIXME("(%p, %p): stub\n", outer, obj);
+    marshal *This = impl_from_IMarshal(iface);
+    FIXME("(%p)->(%s, %p, %08x, %p, %08x, %p): stub\n", This, debugstr_guid(iid), obj, dwDestContext,
+          pvDestContext, mshlflags, size);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI marshal_MarshalInterface(IMarshal *iface, IStream *stream, REFIID iid,
+                                               void *obj, DWORD dwDestContext, void *pvDestContext,
+                                               DWORD mshlflags)
+{
+    marshal *This = impl_from_IMarshal(iface);
+    FIXME("(%p)->(%p, %s, %p, %08x, %p, %08x): stub\n", This, stream, debugstr_guid(iid), obj, dwDestContext,
+          pvDestContext, mshlflags);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI marshal_UnmarshalInterface(IMarshal *iface, IStream *stream,
+                                                 REFIID iid, void **obj)
+{
+    marshal *This = impl_from_IMarshal(iface);
+    FIXME("(%p)->(%p, %s, %p): stub\n", This, stream, debugstr_guid(iid), obj);
     *obj = NULL;
+
     return E_NOTIMPL;
 }
+
+static HRESULT WINAPI marshal_ReleaseMarshalData(IMarshal *iface, IStream *stream)
+{
+    marshal *This = impl_from_IMarshal(iface);
+    FIXME("(%p)->(%p): stub\n", This, stream);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI marshal_DisconnectObject(IMarshal *iface, DWORD dwReserved)
+{
+    marshal *This = impl_from_IMarshal(iface);
+    FIXME("(%p)->(%08x)\n", This, dwReserved);
+
+    return E_NOTIMPL;
+}
+
+static const IMarshalVtbl marshal_vtbl =
+{
+    marshal_QueryInterface,
+    marshal_AddRef,
+    marshal_Release,
+    marshal_GetUnmarshalClass,
+    marshal_GetMarshalSizeMax,
+    marshal_MarshalInterface,
+    marshal_UnmarshalInterface,
+    marshal_ReleaseMarshalData,
+    marshal_DisconnectObject
+};
+
+static HRESULT create_marshal(IUnknown *outer, const CLSID *class, void **obj)
+{
+    marshal *marshal;
+
+    TRACE("(%p, %p)\n", outer, obj);
+    *obj = NULL;
+
+    marshal = HeapAlloc(GetProcessHeap(), 0, sizeof(*marshal));
+    if(!marshal) return E_OUTOFMEMORY;
+
+    marshal->unmarshal_class = *class;
+    marshal->outer = outer; /* don't ref outer unk */
+    marshal->marshal_vtbl = &marshal_vtbl;
+    marshal->ref = 1;
+
+    *obj = &marshal->marshal_vtbl;
+    TRACE("returing %p\n", *obj);
+    return S_OK;
+}
+
+HRESULT create_row_marshal(IUnknown *outer, void **obj)
+{
+    TRACE("(%p, %p)\n", outer, obj);
+    return create_marshal(outer, &CLSID_wine_row_proxy, obj);
+}
+
+HRESULT create_rowset_marshal(IUnknown *outer, void **obj)
+{
+    TRACE("(%p, %p)\n", outer, obj);
+    return create_marshal(outer, &CLSID_wine_rowset_proxy, obj);
+}




More information about the wine-cvs mailing list