ReactOS 0.4.15-dev-8222-g9164419
main.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "objbase.h"
#include "wmiutils.h"
#include "wbemdisp.h"
#include "rpcproxy.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include "wbemdisp_private.h"
#include "wbemdisp_classes.h"
Include dependency graph for main.c:

Go to the source code of this file.

Classes

struct  moniker
 
struct  factory
 

Macros

#define COBJMACROS
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (wbemdisp)
 
static struct monikerimpl_from_IMoniker (IMoniker *iface)
 
static ULONG WINAPI moniker_AddRef (IMoniker *iface)
 
static ULONG WINAPI moniker_Release (IMoniker *iface)
 
static HRESULT WINAPI moniker_QueryInterface (IMoniker *iface, REFIID riid, void **ppvObject)
 
static HRESULT WINAPI moniker_GetClassID (IMoniker *iface, CLSID *pClassID)
 
static HRESULT WINAPI moniker_IsDirty (IMoniker *iface)
 
static HRESULT WINAPI moniker_Load (IMoniker *iface, IStream *pStm)
 
static HRESULT WINAPI moniker_Save (IMoniker *iface, IStream *pStm, BOOL fClearDirty)
 
static HRESULT WINAPI moniker_GetSizeMax (IMoniker *iface, ULARGE_INTEGER *pcbSize)
 
static HRESULT WINAPI moniker_BindToObject (IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, REFIID riidResult, void **ppvResult)
 
static HRESULT WINAPI moniker_BindToStorage (IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, REFIID riid, void **ppvObj)
 
static HRESULT WINAPI moniker_Reduce (IMoniker *iface, IBindCtx *pbc, DWORD dwReduceHowFar, IMoniker **ppmkToLeft, IMoniker **ppmkReduced)
 
static HRESULT WINAPI moniker_ComposeWith (IMoniker *iface, IMoniker *pmkRight, BOOL fOnlyIfNotGeneric, IMoniker **ppmkComposite)
 
static HRESULT WINAPI moniker_Enum (IMoniker *iface, BOOL fForward, IEnumMoniker **ppenumMoniker)
 
static HRESULT WINAPI moniker_IsEqual (IMoniker *iface, IMoniker *pmkOtherMoniker)
 
static HRESULT WINAPI moniker_Hash (IMoniker *iface, DWORD *pdwHash)
 
static HRESULT WINAPI moniker_IsRunning (IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, IMoniker *pmkNewlyRunning)
 
static HRESULT WINAPI moniker_GetTimeOfLastChange (IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, FILETIME *pFileTime)
 
static HRESULT WINAPI moniker_Inverse (IMoniker *iface, IMoniker **ppmk)
 
static HRESULT WINAPI moniker_CommonPrefixWith (IMoniker *iface, IMoniker *pmkOther, IMoniker **ppmkPrefix)
 
static HRESULT WINAPI moniker_RelativePathTo (IMoniker *iface, IMoniker *pmkOther, IMoniker **ppmkRelPath)
 
static HRESULT WINAPI moniker_GetDisplayName (IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, LPOLESTR *ppszDisplayName)
 
static HRESULT WINAPI moniker_ParseDisplayName (IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, LPOLESTR pszDisplayName, ULONG *pchEaten, IMoniker **ppmkOut)
 
static HRESULT WINAPI moniker_IsSystemMoniker (IMoniker *iface, DWORD *pdwMksys)
 
static HRESULT Moniker_create (IUnknown *unk, IMoniker **obj)
 
static HRESULT WINAPI WinMGMTS_QueryInterface (IParseDisplayName *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI WinMGMTS_AddRef (IParseDisplayName *iface)
 
static ULONG WINAPI WinMGMTS_Release (IParseDisplayName *iface)
 
static HRESULT parse_path (const WCHAR *str, BSTR *server, BSTR *namespace, BSTR *relative)
 
static HRESULT WINAPI WinMGMTS_ParseDisplayName (IParseDisplayName *iface, IBindCtx *pbc, LPOLESTR pszDisplayName, ULONG *pchEaten, IMoniker **ppmkOut)
 
static HRESULT WinMGMTS_create (void **ppv)
 
static struct factoryimpl_from_IClassFactory (IClassFactory *iface)
 
static HRESULT WINAPI factory_QueryInterface (IClassFactory *iface, REFIID riid, LPVOID *obj)
 
static ULONG WINAPI factory_AddRef (IClassFactory *iface)
 
static ULONG WINAPI factory_Release (IClassFactory *iface)
 
static HRESULT WINAPI factory_CreateInstance (IClassFactory *iface, LPUNKNOWN outer, REFIID riid, LPVOID *obj)
 
static HRESULT WINAPI factory_LockServer (IClassFactory *iface, BOOL lock)
 
BOOL WINAPI DllMain (HINSTANCE hinst, DWORD reason, LPVOID reserved)
 
HRESULT WINAPI DllGetClassObject (REFCLSID rclsid, REFIID iid, LPVOID *obj)
 
HRESULT WINAPI DllCanUnloadNow (void)
 
HRESULT WINAPI DllRegisterServer (void)
 
HRESULT WINAPI DllUnregisterServer (void)
 

Variables

static HINSTANCE instance
 
static const IMonikerVtbl moniker_vtbl
 
static const IParseDisplayNameVtbl WinMGMTSVtbl
 
static IParseDisplayName winmgmts = { &WinMGMTSVtbl }
 
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 }
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 21 of file main.c.

Function Documentation

◆ DllCanUnloadNow()

HRESULT WINAPI DllCanUnloadNow ( void  )

Definition at line 544 of file main.c.

545{
546 return S_FALSE;
547}
#define S_FALSE
Definition: winerror.h:2357

◆ DllGetClassObject()

HRESULT WINAPI DllGetClassObject ( REFCLSID  rclsid,
REFIID  iid,
LPVOID obj 
)

Definition at line 525 of file main.c.

526{
528
529 TRACE( "%s, %s, %p\n", debugstr_guid(rclsid), debugstr_guid(iid), obj );
530
531 if (IsEqualGUID( rclsid, &CLSID_SWbemLocator ))
532 cf = &swbem_locator_cf.IClassFactory_iface;
533 else if (IsEqualGUID( rclsid, &CLSID_WinMGMTS ))
534 cf = &winmgmts_cf.IClassFactory_iface;
535 else
537
538 return IClassFactory_QueryInterface( cf, iid, obj );
539}
#define NULL
Definition: types.h:112
static struct factory winmgmts_cf
Definition: main.c:508
static struct factory swbem_locator_cf
Definition: main.c:507
#define debugstr_guid
Definition: kernel32.h:35
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define TRACE(s)
Definition: solgame.cpp:4
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hinst,
DWORD  reason,
LPVOID  reserved 
)

Definition at line 510 of file main.c.

511{
512
513 switch (reason)
514 {
515 case DLL_WINE_PREATTACH:
516 return FALSE; /* prefer native version */
518 instance = hinst;
520 break;
521 }
522 return TRUE;
523}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static HINSTANCE instance
Definition: main.c:40
static WCHAR reason[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1904
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
static HINSTANCE hinst
Definition: edit.c:551

◆ DllRegisterServer()

HRESULT WINAPI DllRegisterServer ( void  )

Definition at line 552 of file main.c.

553{
555}
HRESULT __wine_register_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:98

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 560 of file main.c.

561{
563}
HRESULT __wine_unregister_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:110

◆ factory_AddRef()

static ULONG WINAPI factory_AddRef ( IClassFactory iface)
static

Definition at line 461 of file main.c.

462{
463 return 2;
464}

◆ factory_CreateInstance()

static HRESULT WINAPI factory_CreateInstance ( IClassFactory iface,
LPUNKNOWN  outer,
REFIID  riid,
LPVOID obj 
)
static

Definition at line 471 of file main.c.

473{
474 struct factory *factory = impl_from_IClassFactory( iface );
475 IUnknown *unk;
476 HRESULT hr;
477
478 TRACE( "%p, %s, %p\n", outer, debugstr_guid(riid), obj );
479
480 *obj = NULL;
481 if (outer) return CLASS_E_NOAGGREGATION;
482
483 hr = factory->fnCreateInstance( (LPVOID *)&unk );
484 if (FAILED( hr ))
485 return hr;
486
487 hr = IUnknown_QueryInterface( unk, riid, obj );
488 IUnknown_Release( unk );
489 return hr;
490}
static IClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: main.c:63
REFIID riid
Definition: atlbase.h:39
#define FAILED(hr)
Definition: intsafe.h:51
HRESULT hr
Definition: shlfolder.c:183
Definition: main.c:439
HRESULT(* fnCreateInstance)(LPVOID *)
Definition: main.c:441
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662

◆ factory_LockServer()

static HRESULT WINAPI factory_LockServer ( IClassFactory iface,
BOOL  lock 
)
static

Definition at line 492 of file main.c.

493{
494 FIXME( "%p, %d\n", iface, lock );
495 return S_OK;
496}
#define FIXME(fmt,...)
Definition: debug.h:114
#define S_OK
Definition: intsafe.h:52
rwlock_t lock
Definition: tcpcore.h:0

◆ factory_QueryInterface()

static HRESULT WINAPI factory_QueryInterface ( IClassFactory iface,
REFIID  riid,
LPVOID obj 
)
static

Definition at line 449 of file main.c.

450{
452 {
453 IClassFactory_AddRef( iface );
454 *obj = iface;
455 return S_OK;
456 }
457 FIXME( "interface %s not implemented\n", debugstr_guid(riid) );
458 return E_NOINTERFACE;
459}
const GUID IID_IUnknown
const GUID IID_IClassFactory
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ factory_Release()

static ULONG WINAPI factory_Release ( IClassFactory iface)
static

Definition at line 466 of file main.c.

467{
468 return 1;
469}

◆ impl_from_IClassFactory()

static struct factory * impl_from_IClassFactory ( IClassFactory iface)
inlinestatic

Definition at line 444 of file main.c.

445{
446 return CONTAINING_RECORD( iface, struct factory, IClassFactory_iface );
447}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

◆ impl_from_IMoniker()

static struct moniker * impl_from_IMoniker ( IMoniker iface)
inlinestatic

Definition at line 46 of file main.c.

48{
49 return CONTAINING_RECORD( iface, struct moniker, IMoniker_iface );
50}
Definition: main.c:40

Referenced by moniker_AddRef(), moniker_BindToObject(), moniker_QueryInterface(), and moniker_Release().

◆ moniker_AddRef()

static ULONG WINAPI moniker_AddRef ( IMoniker iface)
static

Definition at line 52 of file main.c.

54{
55 struct moniker *moniker = impl_from_IMoniker( iface );
57}
#define InterlockedIncrement
Definition: armddk.h:53
static struct moniker * impl_from_IMoniker(IMoniker *iface)
Definition: main.c:46
LONG refs
Definition: main.c:42

◆ moniker_BindToObject()

static HRESULT WINAPI moniker_BindToObject ( IMoniker iface,
IBindCtx pbc,
IMoniker pmkToLeft,
REFIID  riidResult,
void **  ppvResult 
)
static

Definition at line 129 of file main.c.

131{
132 struct moniker *moniker = impl_from_IMoniker( iface );
133
134 TRACE( "%p, %p, %p, %s, %p\n", iface, pbc, pmkToLeft, debugstr_guid(riidResult), ppvResult );
135 return IUnknown_QueryInterface( moniker->obj, riidResult, ppvResult );
136}
IUnknown * obj
Definition: main.c:43

◆ moniker_BindToStorage()

static HRESULT WINAPI moniker_BindToStorage ( IMoniker iface,
IBindCtx pbc,
IMoniker pmkToLeft,
REFIID  riid,
void **  ppvObj 
)
static

Definition at line 138 of file main.c.

140{
141 FIXME( "\n" );
142 return E_NOTIMPL;
143}
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ moniker_CommonPrefixWith()

static HRESULT WINAPI moniker_CommonPrefixWith ( IMoniker iface,
IMoniker pmkOther,
IMoniker **  ppmkPrefix 
)
static

Definition at line 201 of file main.c.

203{
204 FIXME( "\n" );
205 return E_NOTIMPL;
206}

◆ moniker_ComposeWith()

static HRESULT WINAPI moniker_ComposeWith ( IMoniker iface,
IMoniker pmkRight,
BOOL  fOnlyIfNotGeneric,
IMoniker **  ppmkComposite 
)
static

Definition at line 152 of file main.c.

154{
155 FIXME( "\n" );
156 return E_NOTIMPL;
157}

◆ Moniker_create()

static HRESULT Moniker_create ( IUnknown unk,
IMoniker **  obj 
)
static

Definition at line 264 of file main.c.

265{
266 struct moniker *moniker;
267
268 TRACE( "%p, %p\n", unk, obj );
269
270 if (!(moniker = heap_alloc( sizeof(*moniker) ))) return E_OUTOFMEMORY;
272 moniker->refs = 1;
273 moniker->obj = unk;
274 IUnknown_AddRef( moniker->obj );
275
277 TRACE( "returning iface %p\n", *obj );
278 return S_OK;
279}
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static const IMonikerVtbl moniker_vtbl
Definition: main.c:237
IMoniker IMoniker_iface
Definition: main.c:41

Referenced by WinMGMTS_ParseDisplayName().

◆ moniker_Enum()

static HRESULT WINAPI moniker_Enum ( IMoniker iface,
BOOL  fForward,
IEnumMoniker **  ppenumMoniker 
)
static

Definition at line 159 of file main.c.

161{
162 FIXME( "\n" );
163 return E_NOTIMPL;
164}

◆ moniker_GetClassID()

static HRESULT WINAPI moniker_GetClassID ( IMoniker iface,
CLSID pClassID 
)
static

Definition at line 94 of file main.c.

96{
97 FIXME( "\n" );
98 return E_NOTIMPL;
99}

◆ moniker_GetDisplayName()

static HRESULT WINAPI moniker_GetDisplayName ( IMoniker iface,
IBindCtx pbc,
IMoniker pmkToLeft,
LPOLESTR ppszDisplayName 
)
static

Definition at line 215 of file main.c.

217{
218 FIXME( "\n" );
219 return E_NOTIMPL;
220}

◆ moniker_GetSizeMax()

static HRESULT WINAPI moniker_GetSizeMax ( IMoniker iface,
ULARGE_INTEGER pcbSize 
)
static

Definition at line 122 of file main.c.

124{
125 FIXME( "\n" );
126 return E_NOTIMPL;
127}

◆ moniker_GetTimeOfLastChange()

static HRESULT WINAPI moniker_GetTimeOfLastChange ( IMoniker iface,
IBindCtx pbc,
IMoniker pmkToLeft,
FILETIME pFileTime 
)
static

Definition at line 187 of file main.c.

189{
190 FIXME( "\n" );
191 return E_NOTIMPL;
192}

◆ moniker_Hash()

static HRESULT WINAPI moniker_Hash ( IMoniker iface,
DWORD pdwHash 
)
static

Definition at line 173 of file main.c.

175{
176 FIXME( "\n" );
177 return E_NOTIMPL;
178}

◆ moniker_Inverse()

static HRESULT WINAPI moniker_Inverse ( IMoniker iface,
IMoniker **  ppmk 
)
static

Definition at line 194 of file main.c.

196{
197 FIXME( "\n" );
198 return E_NOTIMPL;
199}

◆ moniker_IsDirty()

static HRESULT WINAPI moniker_IsDirty ( IMoniker iface)
static

Definition at line 101 of file main.c.

103{
104 FIXME( "\n" );
105 return E_NOTIMPL;
106}

◆ moniker_IsEqual()

static HRESULT WINAPI moniker_IsEqual ( IMoniker iface,
IMoniker pmkOtherMoniker 
)
static

Definition at line 166 of file main.c.

168{
169 FIXME( "\n" );
170 return E_NOTIMPL;
171}

◆ moniker_IsRunning()

static HRESULT WINAPI moniker_IsRunning ( IMoniker iface,
IBindCtx pbc,
IMoniker pmkToLeft,
IMoniker pmkNewlyRunning 
)
static

Definition at line 180 of file main.c.

182{
183 FIXME( "\n" );
184 return E_NOTIMPL;
185}

◆ moniker_IsSystemMoniker()

static HRESULT WINAPI moniker_IsSystemMoniker ( IMoniker iface,
DWORD pdwMksys 
)
static

Definition at line 230 of file main.c.

232{
233 FIXME( "\n" );
234 return E_NOTIMPL;
235}

◆ moniker_Load()

static HRESULT WINAPI moniker_Load ( IMoniker iface,
IStream pStm 
)
static

Definition at line 108 of file main.c.

110{
111 FIXME( "\n" );
112 return E_NOTIMPL;
113}

◆ moniker_ParseDisplayName()

static HRESULT WINAPI moniker_ParseDisplayName ( IMoniker iface,
IBindCtx pbc,
IMoniker pmkToLeft,
LPOLESTR  pszDisplayName,
ULONG pchEaten,
IMoniker **  ppmkOut 
)
static

Definition at line 222 of file main.c.

225{
226 FIXME( "\n" );
227 return E_NOTIMPL;
228}

◆ moniker_QueryInterface()

static HRESULT WINAPI moniker_QueryInterface ( IMoniker iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 73 of file main.c.

75{
76 struct moniker *moniker = impl_from_IMoniker( iface );
77
78 TRACE( "%p, %s, %p\n", moniker, debugstr_guid( riid ), ppvObject );
79
80 if (IsEqualGUID( riid, &IID_IMoniker ) ||
82 {
83 *ppvObject = iface;
84 }
85 else
86 {
87 FIXME( "interface %s not implemented\n", debugstr_guid(riid) );
88 return E_NOINTERFACE;
89 }
90 IMoniker_AddRef( iface );
91 return S_OK;
92}
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082

◆ moniker_Reduce()

static HRESULT WINAPI moniker_Reduce ( IMoniker iface,
IBindCtx pbc,
DWORD  dwReduceHowFar,
IMoniker **  ppmkToLeft,
IMoniker **  ppmkReduced 
)
static

Definition at line 145 of file main.c.

147{
148 FIXME( "\n" );
149 return E_NOTIMPL;
150}

◆ moniker_RelativePathTo()

static HRESULT WINAPI moniker_RelativePathTo ( IMoniker iface,
IMoniker pmkOther,
IMoniker **  ppmkRelPath 
)
static

Definition at line 208 of file main.c.

210{
211 FIXME( "\n" );
212 return E_NOTIMPL;
213}

◆ moniker_Release()

static ULONG WINAPI moniker_Release ( IMoniker iface)
static

Definition at line 59 of file main.c.

61{
62 struct moniker *moniker = impl_from_IMoniker( iface );
64 if (!refs)
65 {
66 TRACE( "destroying %p\n", moniker );
67 IUnknown_Release( moniker->obj );
69 }
70 return refs;
71}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
#define InterlockedDecrement
Definition: armddk.h:52
long LONG
Definition: pedump.c:60

◆ moniker_Save()

static HRESULT WINAPI moniker_Save ( IMoniker iface,
IStream pStm,
BOOL  fClearDirty 
)
static

Definition at line 115 of file main.c.

117{
118 FIXME( "\n" );
119 return E_NOTIMPL;
120}

◆ parse_path()

static HRESULT parse_path ( const WCHAR str,
BSTR server,
BSTR namespace,
BSTR relative 
)
static

Definition at line 309 of file main.c.

310{
312 ULONG len;
313 HRESULT hr;
314
315 *server = *namespace = *relative = NULL;
316
317 hr = CoCreateInstance( &CLSID_WbemDefPath, NULL, CLSCTX_INPROC_SERVER, &IID_IWbemPath, (void **)&path );
318 if (hr != S_OK) return hr;
319
320 hr = IWbemPath_SetText( path, WBEMPATH_CREATE_ACCEPT_ALL, str );
321 if (hr != S_OK) goto done;
322
323 len = 0;
324 hr = IWbemPath_GetServer( path, &len, NULL );
325 if (hr == S_OK)
326 {
327 if (!(*server = SysAllocStringLen( NULL, len )))
328 {
330 goto done;
331 }
332 hr = IWbemPath_GetServer( path, &len, *server );
333 if (hr != S_OK) goto done;
334 }
335
336 len = 0;
337 hr = IWbemPath_GetText( path, WBEMPATH_GET_NAMESPACE_ONLY, &len, NULL );
338 if (hr == S_OK)
339 {
340 if (!(*namespace = SysAllocStringLen( NULL, len )))
341 {
343 goto done;
344 }
345 hr = IWbemPath_GetText( path, WBEMPATH_GET_NAMESPACE_ONLY, &len, *namespace );
346 if (hr != S_OK) goto done;
347 }
348 len = 0;
349 hr = IWbemPath_GetText( path, WBEMPATH_GET_RELATIVE_ONLY, &len, NULL );
350 if (hr == S_OK)
351 {
352 if (!(*relative = SysAllocStringLen( NULL, len )))
353 {
355 goto done;
356 }
357 hr = IWbemPath_GetText( path, WBEMPATH_GET_RELATIVE_ONLY, &len, *relative );
358 }
359
360done:
361 IWbemPath_Release( path );
362 if (hr != S_OK)
363 {
365 SysFreeString( *namespace );
366 SysFreeString( *relative );
367 }
368 return hr;
369}
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
GLenum GLsizei len
Definition: glext.h:6722
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
const WCHAR * str
uint32_t ULONG
Definition: typedefs.h:59
static rfbScreenInfoPtr server
Definition: vnc.c:74
@ WBEMPATH_GET_RELATIVE_ONLY
Definition: wmiutils.idl:57
@ WBEMPATH_GET_NAMESPACE_ONLY
Definition: wmiutils.idl:60
@ WBEMPATH_CREATE_ACCEPT_ALL
Definition: wmiutils.idl:50

Referenced by exec_assoc_view(), get_antecedent_table(), and WinMGMTS_ParseDisplayName().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( wbemdisp  )

◆ WinMGMTS_AddRef()

static ULONG WINAPI WinMGMTS_AddRef ( IParseDisplayName iface)
static

Definition at line 299 of file main.c.

300{
301 return 2;
302}

◆ WinMGMTS_create()

static HRESULT WinMGMTS_create ( void **  ppv)
static

Definition at line 432 of file main.c.

433{
434 *ppv = &winmgmts;
435 return S_OK;
436}
static IParseDisplayName winmgmts
Definition: main.c:430
REFIID LPVOID * ppv
Definition: atlbase.h:39

◆ WinMGMTS_ParseDisplayName()

static HRESULT WINAPI WinMGMTS_ParseDisplayName ( IParseDisplayName iface,
IBindCtx pbc,
LPOLESTR  pszDisplayName,
ULONG pchEaten,
IMoniker **  ppmkOut 
)
static

Definition at line 371 of file main.c.

373{
374 static const WCHAR prefixW[] = {'w','i','n','m','g','m','t','s',':',0};
375 const DWORD prefix_len = ARRAY_SIZE(prefixW) - 1;
376 ISWbemLocator *locator = NULL;
377 ISWbemServices *services = NULL;
378 ISWbemObject *obj = NULL;
379 BSTR server, namespace, relative;
380 WCHAR *p;
381 HRESULT hr;
382
383 TRACE( "%p, %p, %s, %p, %p\n", iface, pbc, debugstr_w(pszDisplayName), pchEaten, ppmkOut );
384
385 if (_wcsnicmp( pszDisplayName, prefixW, prefix_len )) return MK_E_SYNTAX;
386
387 p = pszDisplayName + prefix_len;
388 if (*p == '{')
389 {
390 FIXME( "ignoring security settings\n" );
391 while (*p && *p != '}') p++;
392 if (*p == '}') p++;
393 if (*p == '!') p++;
394 }
395 hr = parse_path( p, &server, &namespace, &relative );
396 if (hr != S_OK) return hr;
397
398 hr = SWbemLocator_create( (void **)&locator );
399 if (hr != S_OK) goto done;
400
401 hr = ISWbemLocator_ConnectServer( locator, server, namespace, NULL, NULL, NULL, NULL, 0, NULL, &services );
402 if (hr != S_OK) goto done;
403
404 if (!relative || !*relative) Moniker_create( (IUnknown *)services, ppmkOut );
405 else
406 {
407 hr = ISWbemServices_Get( services, relative, 0, NULL, &obj );
408 if (hr != S_OK) goto done;
409 hr = Moniker_create( (IUnknown *)obj, ppmkOut );
410 }
411
412done:
413 if (obj) ISWbemObject_Release( obj );
414 if (services) ISWbemServices_Release( services );
415 if (locator) ISWbemLocator_Release( locator );
417 SysFreeString( namespace );
418 SysFreeString( relative );
419 if (hr == S_OK) *pchEaten = lstrlenW( pszDisplayName );
420 return hr;
421}
#define ARRAY_SIZE(A)
Definition: main.h:33
OLECHAR * BSTR
Definition: compat.h:2293
#define lstrlenW
Definition: compat.h:750
static HRESULT parse_path(const WCHAR *str, BSTR *server, BSTR *namespace, BSTR *relative)
Definition: main.c:309
static HRESULT Moniker_create(IUnknown *unk, IMoniker **obj)
Definition: main.c:264
unsigned long DWORD
Definition: ntddk_ex.h:95
GLfloat GLfloat p
Definition: glext.h:8902
#define debugstr_w
Definition: kernel32.h:32
HRESULT SWbemLocator_create(void **obj)
Definition: locator.c:2220
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
#define MK_E_SYNTAX
Definition: winerror.h:2785
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ WinMGMTS_QueryInterface()

static HRESULT WINAPI WinMGMTS_QueryInterface ( IParseDisplayName iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 281 of file main.c.

282{
284 TRACE("(IID_IUnknown %p)\n", ppv);
285 *ppv = iface;
287 TRACE("(IID_IParseDisplayName %p)\n", ppv);
288 *ppv = iface;
289 }else {
290 WARN("Unsupported riid %s\n", debugstr_guid(riid));
291 *ppv = NULL;
292 return E_NOINTERFACE;
293 }
294
295 IUnknown_AddRef((IUnknown*)*ppv);
296 return S_OK;
297}
#define WARN(fmt,...)
Definition: debug.h:115
const GUID IID_IParseDisplayName

◆ WinMGMTS_Release()

static ULONG WINAPI WinMGMTS_Release ( IParseDisplayName iface)
static

Definition at line 304 of file main.c.

305{
306 return 1;
307}

Variable Documentation

◆ factory_vtbl

const struct IClassFactoryVtbl factory_vtbl
static
Initial value:
=
{
}
static ULONG WINAPI factory_Release(IClassFactory *iface)
Definition: main.c:466
static ULONG WINAPI factory_AddRef(IClassFactory *iface)
Definition: main.c:461
static HRESULT WINAPI factory_LockServer(IClassFactory *iface, BOOL lock)
Definition: main.c:492
static HRESULT WINAPI factory_CreateInstance(IClassFactory *iface, LPUNKNOWN outer, REFIID riid, LPVOID *obj)
Definition: main.c:471
static HRESULT WINAPI factory_QueryInterface(IClassFactory *iface, REFIID riid, LPVOID *obj)
Definition: main.c:449

Definition at line 498 of file main.c.

◆ instance

HINSTANCE instance
static

Definition at line 37 of file main.c.

◆ moniker_vtbl

const IMonikerVtbl moniker_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI moniker_Hash(IMoniker *iface, DWORD *pdwHash)
Definition: main.c:173
static HRESULT WINAPI moniker_Enum(IMoniker *iface, BOOL fForward, IEnumMoniker **ppenumMoniker)
Definition: main.c:159
static HRESULT WINAPI moniker_IsRunning(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, IMoniker *pmkNewlyRunning)
Definition: main.c:180
static HRESULT WINAPI moniker_Load(IMoniker *iface, IStream *pStm)
Definition: main.c:108
static HRESULT WINAPI moniker_BindToObject(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, REFIID riidResult, void **ppvResult)
Definition: main.c:129
static HRESULT WINAPI moniker_ComposeWith(IMoniker *iface, IMoniker *pmkRight, BOOL fOnlyIfNotGeneric, IMoniker **ppmkComposite)
Definition: main.c:152
static HRESULT WINAPI moniker_GetTimeOfLastChange(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, FILETIME *pFileTime)
Definition: main.c:187
static HRESULT WINAPI moniker_Reduce(IMoniker *iface, IBindCtx *pbc, DWORD dwReduceHowFar, IMoniker **ppmkToLeft, IMoniker **ppmkReduced)
Definition: main.c:145
static ULONG WINAPI moniker_Release(IMoniker *iface)
Definition: main.c:59
static HRESULT WINAPI moniker_RelativePathTo(IMoniker *iface, IMoniker *pmkOther, IMoniker **ppmkRelPath)
Definition: main.c:208
static HRESULT WINAPI moniker_ParseDisplayName(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, LPOLESTR pszDisplayName, ULONG *pchEaten, IMoniker **ppmkOut)
Definition: main.c:222
static HRESULT WINAPI moniker_CommonPrefixWith(IMoniker *iface, IMoniker *pmkOther, IMoniker **ppmkPrefix)
Definition: main.c:201
static HRESULT WINAPI moniker_GetSizeMax(IMoniker *iface, ULARGE_INTEGER *pcbSize)
Definition: main.c:122
static HRESULT WINAPI moniker_BindToStorage(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, REFIID riid, void **ppvObj)
Definition: main.c:138
static HRESULT WINAPI moniker_IsEqual(IMoniker *iface, IMoniker *pmkOtherMoniker)
Definition: main.c:166
static HRESULT WINAPI moniker_IsSystemMoniker(IMoniker *iface, DWORD *pdwMksys)
Definition: main.c:230
static HRESULT WINAPI moniker_IsDirty(IMoniker *iface)
Definition: main.c:101
static ULONG WINAPI moniker_AddRef(IMoniker *iface)
Definition: main.c:52
static HRESULT WINAPI moniker_QueryInterface(IMoniker *iface, REFIID riid, void **ppvObject)
Definition: main.c:73
static HRESULT WINAPI moniker_GetClassID(IMoniker *iface, CLSID *pClassID)
Definition: main.c:94
static HRESULT WINAPI moniker_Inverse(IMoniker *iface, IMoniker **ppmk)
Definition: main.c:194
static HRESULT WINAPI moniker_GetDisplayName(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, LPOLESTR *ppszDisplayName)
Definition: main.c:215
static HRESULT WINAPI moniker_Save(IMoniker *iface, IStream *pStm, BOOL fClearDirty)
Definition: main.c:115

Definition at line 237 of file main.c.

Referenced by Moniker_create().

◆ swbem_locator_cf

struct factory swbem_locator_cf = { { &factory_vtbl }, SWbemLocator_create }
static

Definition at line 507 of file main.c.

Referenced by DllGetClassObject().

◆ winmgmts

IParseDisplayName winmgmts = { &WinMGMTSVtbl }
static

Definition at line 430 of file main.c.

Referenced by WinMGMTS_create().

◆ winmgmts_cf

struct factory winmgmts_cf = { { &factory_vtbl }, WinMGMTS_create }
static

Definition at line 508 of file main.c.

Referenced by DllGetClassObject().

◆ WinMGMTSVtbl

const IParseDisplayNameVtbl WinMGMTSVtbl
static
Initial value:
= {
}
static HRESULT WINAPI WinMGMTS_QueryInterface(IParseDisplayName *iface, REFIID riid, void **ppv)
Definition: main.c:281
static ULONG WINAPI WinMGMTS_Release(IParseDisplayName *iface)
Definition: main.c:304
static HRESULT WINAPI WinMGMTS_ParseDisplayName(IParseDisplayName *iface, IBindCtx *pbc, LPOLESTR pszDisplayName, ULONG *pchEaten, IMoniker **ppmkOut)
Definition: main.c:371
static ULONG WINAPI WinMGMTS_AddRef(IParseDisplayName *iface)
Definition: main.c:299

Definition at line 423 of file main.c.