Module: wine Branch: master Commit: 8c4e9ba4cfa4e1976a84dcb8bdfcf26b497a8480 URL: http://source.winehq.org/git/wine.git/?a=commit;h=8c4e9ba4cfa4e1976a84dcb8bd...
Author: Jacek Caban jacek@codeweavers.com Date: Wed Aug 28 12:14:31 2013 +0200
wbemdisp: Added WinMGMTS object stub implementation.
---
.gitignore | 1 + dlls/wbemdisp/Makefile.in | 1 + dlls/wbemdisp/locator.c | 1 - dlls/wbemdisp/main.c | 63 ++++++++++++++++++++++++++++++++++++++++++--- 4 files changed, 61 insertions(+), 5 deletions(-)
diff --git a/.gitignore b/.gitignore index de6c039..16238b3 100644 --- a/.gitignore +++ b/.gitignore @@ -140,6 +140,7 @@ dlls/vbscript/tests/vbsregexp55.h dlls/vbscript/vbscript_classes.h dlls/vbscript/vbsglobal.h dlls/vbscript/vbsregexp55.h +dlls/wbemdisp/wbemdisp_classes.h dlls/wbemprox/wql.tab.c dlls/wbemprox/wql.tab.h dlls/windowscodecs/windowscodecs_wincodec.h diff --git a/dlls/wbemdisp/Makefile.in b/dlls/wbemdisp/Makefile.in index dbd76d9..3f3ff49 100644 --- a/dlls/wbemdisp/Makefile.in +++ b/dlls/wbemdisp/Makefile.in @@ -6,6 +6,7 @@ C_SRCS = \ main.c
IDL_R_SRCS = wbemdisp_classes.idl +IDL_H_SRCS = wbemdisp_classes.idl
IDL_TLB_SRCS = wbemdisp_tlb.idl
diff --git a/dlls/wbemdisp/locator.c b/dlls/wbemdisp/locator.c index 6f3af95..68c24f7 100644 --- a/dlls/wbemdisp/locator.c +++ b/dlls/wbemdisp/locator.c @@ -23,7 +23,6 @@
#include "windef.h" #include "winbase.h" -#include "initguid.h" #include "objbase.h" #include "wbemdisp.h"
diff --git a/dlls/wbemdisp/main.c b/dlls/wbemdisp/main.c index 078e3b5..8582cf1 100644 --- a/dlls/wbemdisp/main.c +++ b/dlls/wbemdisp/main.c @@ -23,17 +23,69 @@
#include "windef.h" #include "winbase.h" +#include "initguid.h" #include "objbase.h" #include "wbemdisp.h" #include "rpcproxy.h"
#include "wine/debug.h" #include "wbemdisp_private.h" +#include "wbemdisp_classes.h"
WINE_DEFAULT_DEBUG_CHANNEL(wbemdisp);
static HINSTANCE instance;
+static HRESULT WINAPI WinMGMTS_QueryInterface(IParseDisplayName *iface, REFIID riid, void **ppv) +{ + if(IsEqualGUID(riid, &IID_IUnknown)) { + TRACE("(IID_IUnknown %p)\n", ppv); + *ppv = iface; + }else if(IsEqualGUID(riid, &IID_IParseDisplayName)) { + TRACE("(IID_IParseDisplayName %p)\n", ppv); + *ppv = iface; + }else { + WARN("Unsupported riid %s\n", debugstr_guid(riid)); + *ppv = NULL; + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; +} + +static ULONG WINAPI WinMGMTS_AddRef(IParseDisplayName *iface) +{ + return 2; +} + +static ULONG WINAPI WinMGMTS_Release(IParseDisplayName *iface) +{ + return 1; +} + +static HRESULT WINAPI WinMGMTS_ParseDisplayName(IParseDisplayName *iface, IBindCtx *pbc, LPOLESTR pszDisplayName, + ULONG *pchEaten, IMoniker **ppmkOut) +{ + FIXME("(%p %s %p %p)\n", pbc, debugstr_w(pszDisplayName), pchEaten, ppmkOut); + return E_NOTIMPL; +} + +static const IParseDisplayNameVtbl WinMGMTSVtbl = { + WinMGMTS_QueryInterface, + WinMGMTS_AddRef, + WinMGMTS_Release, + WinMGMTS_ParseDisplayName +}; + +static IParseDisplayName winmgmts = { &WinMGMTSVtbl }; + +static HRESULT WinMGMTS_create(IUnknown *outer, void **ppv) +{ + *ppv = &winmgmts; + return S_OK; +} + struct factory { IClassFactory IClassFactory_iface; @@ -107,6 +159,7 @@ static const struct IClassFactoryVtbl factory_vtbl = };
static struct factory swbem_locator_cf = { { &factory_vtbl }, SWbemLocator_create }; +static struct factory winmgmts_cf = { { &factory_vtbl }, WinMGMTS_create };
BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved ) { @@ -130,10 +183,12 @@ HRESULT WINAPI DllGetClassObject( REFCLSID rclsid, REFIID iid, LPVOID *obj ) TRACE( "%s, %s, %p\n", debugstr_guid(rclsid), debugstr_guid(iid), obj );
if (IsEqualGUID( rclsid, &CLSID_SWbemLocator )) - { - cf = &swbem_locator_cf.IClassFactory_iface; - } - if (!cf) return CLASS_E_CLASSNOTAVAILABLE; + cf = &swbem_locator_cf.IClassFactory_iface; + else if (IsEqualGUID( rclsid, &CLSID_WinMGMTS )) + cf = &winmgmts_cf.IClassFactory_iface; + else + return CLASS_E_CLASSNOTAVAILABLE; + return IClassFactory_QueryInterface( cf, iid, obj ); }