From de6f38108aed5e0625efa256852d8d4c26f5d66c Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Thu, 21 Jan 2010 11:53:25 +0000 Subject: [PATCH] msdaps: Add stub class factories for the row and rowset servers and proxies. --- .gitignore | 2 + dlls/msdaps/Makefile.in | 6 ++- dlls/msdaps/main.c | 101 +++++++++++++++++++++++++++++++++++ dlls/msdaps/{main.c => row_server.c} | 40 +++++++------- dlls/msdaps/row_server.idl | 56 +++++++++++++++++++ 5 files changed, 184 insertions(+), 21 deletions(-) copy dlls/msdaps/{main.c => row_server.c} (55%) create mode 100644 dlls/msdaps/row_server.idl diff --git a/.gitignore b/.gitignore index f2a0bd85ed8..6c268839124 100644 --- a/.gitignore +++ b/.gitignore @@ -65,6 +65,8 @@ dlls/libxinput.def dlls/msdaps/msdaps.h dlls/msdaps/msdaps_i.c dlls/msdaps/msdaps_p.c +dlls/msdaps/row_server.h +dlls/msdaps/row_server_i.c dlls/mshtml.tlb/mshtml_tlb.tlb dlls/mshtml/nsiface.h dlls/msi/cond.tab.c diff --git a/dlls/msdaps/Makefile.in b/dlls/msdaps/Makefile.in index c81c6effaa9..d602f134013 100644 --- a/dlls/msdaps/Makefile.in +++ b/dlls/msdaps/Makefile.in @@ -3,7 +3,7 @@ TOPOBJDIR = ../.. SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = msdaps.dll -IMPORTS = oleaut32 ole32 rpcrt4 kernel32 ntdll +IMPORTS = uuid oleaut32 ole32 rpcrt4 kernel32 ntdll EXTRADEFS = -DREGISTER_PROXY_DLL -DPROXY_CLSID_IS="{ 0x06210e88, 0x01f5, 0x11d1, { 0xb5, 0x12, 0x00, 0x80, 0xc7, 0x81, 0xc3, 0x84 } }" -DENTRY_PREFIX=msdaps_ EXTRAIDLFLAGS = --win32-align=2 @@ -12,10 +12,12 @@ EXTRA_OBJS = dlldata.o C_SRCS = \ main.c \ regsvr.c \ + row_server.c \ usrmarshal.c IDL_I_SRCS = \ - msdaps.idl + msdaps.idl \ + row_server.idl IDL_P_SRCS = \ msdaps.idl diff --git a/dlls/msdaps/main.c b/dlls/msdaps/main.c index f8035077bff..92ed78b0582 100644 --- a/dlls/msdaps/main.c +++ b/dlls/msdaps/main.c @@ -33,6 +33,8 @@ #include "oleauto.h" #include "oledb.h" +#include "row_server.h" + #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(oledb); @@ -49,11 +51,110 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved) return msdaps_DllMain(instance, reason, reserved); } + +/****************************************************************************** + * ClassFactory + */ +typedef struct +{ + const IClassFactoryVtbl *lpVtbl; + HRESULT (*create_object)( IUnknown*, LPVOID* ); +} cf; + +static HRESULT WINAPI CF_QueryInterface(IClassFactory *iface, REFIID riid, void **obj) +{ + cf *This = (cf *)iface; + + TRACE("(%p, %s, %p)\n", This, debugstr_guid(riid), obj); + + if( IsEqualCLSID( riid, &IID_IUnknown ) || + IsEqualCLSID( riid, &IID_IClassFactory ) ) + { + IClassFactory_AddRef( iface ); + *obj = iface; + return S_OK; + } + return E_NOINTERFACE; +} + +static ULONG WINAPI CF_AddRef(IClassFactory *iface) +{ + return 2; +} + +static ULONG WINAPI CF_Release(IClassFactory *iface) +{ + return 1; +} + +static HRESULT WINAPI CF_CreateInstance(IClassFactory *iface, IUnknown *pOuter, REFIID riid, void **obj) +{ + cf *This = (cf *)iface; + IUnknown *unk = NULL; + HRESULT r; + + TRACE("(%p, %p, %s, %p)\n", This, pOuter, debugstr_guid(riid), obj); + + r = This->create_object( pOuter, (void **) &unk ); + if (SUCCEEDED(r)) + { + r = IUnknown_QueryInterface( unk, riid, obj ); + IUnknown_Release( unk ); + } + return r; +} + +static HRESULT WINAPI CF_LockServer(IClassFactory *iface, BOOL dolock) +{ + FIXME("(%p, %d): stub\n", iface, dolock); + return S_OK; +} + +static const IClassFactoryVtbl CF_Vtbl = +{ + CF_QueryInterface, + CF_AddRef, + CF_Release, + CF_CreateInstance, + CF_LockServer +}; + +static cf row_server_cf = { &CF_Vtbl, create_row_server }; +static cf row_proxy_cf = { &CF_Vtbl, create_row_marshal }; +static cf rowset_server_cf = { &CF_Vtbl, create_rowset_server }; +static cf rowset_proxy_cf = { &CF_Vtbl, create_rowset_marshal }; + /*********************************************************************** * DllGetClassObject */ HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, LPVOID *obj) { + TRACE("(%s, %s, %p)\n", debugstr_guid(clsid), debugstr_guid(iid), obj); + + if (IsEqualCLSID(clsid, &CLSID_wine_row_server)) + { + *obj = &row_server_cf; + return S_OK; + } + + if (IsEqualCLSID(clsid, &CLSID_wine_row_proxy)) + { + *obj = &row_proxy_cf; + return S_OK; + } + + if (IsEqualCLSID(clsid, &CLSID_wine_rowset_server)) + { + *obj = &rowset_server_cf; + return S_OK; + } + + if (IsEqualCLSID(clsid, &CLSID_wine_rowset_proxy)) + { + *obj = &rowset_proxy_cf; + return S_OK; + } + return msdaps_DllGetClassObject(clsid, iid, obj); } diff --git a/dlls/msdaps/main.c b/dlls/msdaps/row_server.c similarity index 55% copy from dlls/msdaps/main.c copy to dlls/msdaps/row_server.c index f8035077bff..982a6315f48 100644 --- a/dlls/msdaps/main.c +++ b/dlls/msdaps/row_server.c @@ -1,5 +1,5 @@ /* - * msdaps initialisation. + * Row and rowset servers / proxies. * * Copyright 2010 Huw Davies * @@ -33,34 +33,36 @@ #include "oleauto.h" #include "oledb.h" +#include "row_server.h" + #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(oledb); -extern BOOL WINAPI msdaps_DllMain(HINSTANCE, DWORD, LPVOID) DECLSPEC_HIDDEN; -extern HRESULT WINAPI msdaps_DllGetClassObject(REFCLSID, REFIID, LPVOID *) DECLSPEC_HIDDEN; -extern HRESULT WINAPI msdaps_DllCanUnloadNow(void) DECLSPEC_HIDDEN; +HRESULT create_row_server(IUnknown *outer, void **obj) +{ + FIXME("(%p, %p): stub\n", outer, obj); + *obj = NULL; + return E_NOTIMPL; +} -/***************************************************************************** - * DllMain - */ -BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved) +HRESULT create_rowset_server(IUnknown *outer, void **obj) { - return msdaps_DllMain(instance, reason, reserved); + FIXME("(%p, %p): stub\n", outer, obj); + *obj = NULL; + return E_NOTIMPL; } -/*********************************************************************** - * DllGetClassObject - */ -HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, LPVOID *obj) +HRESULT create_row_marshal(IUnknown *outer, void **obj) { - return msdaps_DllGetClassObject(clsid, iid, obj); + FIXME("(%p, %p): stub\n", outer, obj); + *obj = NULL; + return E_NOTIMPL; } -/*********************************************************************** - * DllCanUnloadNow - */ -HRESULT WINAPI DllCanUnloadNow(void) +HRESULT create_rowset_marshal(IUnknown *outer, void **obj) { - return msdaps_DllCanUnloadNow(); + FIXME("(%p, %p): stub\n", outer, obj); + *obj = NULL; + return E_NOTIMPL; } diff --git a/dlls/msdaps/row_server.idl b/dlls/msdaps/row_server.idl new file mode 100644 index 00000000000..4da585f9272 --- /dev/null +++ b/dlls/msdaps/row_server.idl @@ -0,0 +1,56 @@ +/* + * Wine row server interface. + * + * Copyright (C) 2010 Huw Davies + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +[ + uuid(38248178-cf6d-11de-abe5-000c2916d865) +] +coclass wine_row_server +{ + +} + +[ + uuid(38248179-cf6d-11de-abe5-000c2916d865) +] +coclass wine_row_proxy +{ + +} + +[ + uuid(3824817a-cf6d-11de-abe5-000c2916d865) +] +coclass wine_rowset_server +{ + +} + +[ + uuid(3824817b-cf6d-11de-abe5-000c2916d865) +] +coclass wine_rowset_proxy +{ + +} + +cpp_quote("extern HRESULT create_row_server( IUnknown*, LPVOID* );") +cpp_quote("extern HRESULT create_row_marshal( IUnknown*, LPVOID* );") +cpp_quote("extern HRESULT create_rowset_server( IUnknown*, LPVOID* );") +cpp_quote("extern HRESULT create_rowset_marshal( IUnknown*, LPVOID* );") -- 2.11.4.GIT