ReactOS  0.4.14-dev-337-gf981a68
main.c File Reference
#include "config.h"
#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 "wine/unicode.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 22 of file main.c.

Function Documentation

◆ DllCanUnloadNow()

HRESULT WINAPI DllCanUnloadNow ( void  )

Definition at line 546 of file main.c.

547 {
548  return S_FALSE;
549 }
#define S_FALSE
Definition: winerror.h:2357

◆ DllGetClassObject()

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

Definition at line 527 of file main.c.

528 {
529  IClassFactory *cf = NULL;
530 
531  TRACE( "%s, %s, %p\n", debugstr_guid(rclsid), debugstr_guid(iid), obj );
532 
533  if (IsEqualGUID( rclsid, &CLSID_SWbemLocator ))
534  cf = &swbem_locator_cf.IClassFactory_iface;
535  else if (IsEqualGUID( rclsid, &CLSID_WinMGMTS ))
536  cf = &winmgmts_cf.IClassFactory_iface;
537  else
539 
540  return IClassFactory_QueryInterface( cf, iid, obj );
541 }
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
static struct factory winmgmts_cf
Definition: main.c:510
static struct factory swbem_locator_cf
Definition: main.c:509
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ DllMain()

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

Definition at line 512 of file main.c.

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

◆ DllRegisterServer()

HRESULT WINAPI DllRegisterServer ( void  )

Definition at line 554 of file main.c.

555 {
557 }
HRESULT __wine_register_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:98
static HINSTANCE instance
Definition: main.c:39

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 562 of file main.c.

563 {
565 }
static HINSTANCE instance
Definition: main.c:39
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 463 of file main.c.

464 {
465  return 2;
466 }

◆ factory_CreateInstance()

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

Definition at line 473 of file main.c.

475 {
476  struct factory *factory = impl_from_IClassFactory( iface );
477  IUnknown *unk;
478  HRESULT hr;
479 
480  TRACE( "%p, %s, %p\n", outer, debugstr_guid(riid), obj );
481 
482  *obj = NULL;
483  if (outer) return CLASS_E_NOAGGREGATION;
484 
485  hr = factory->fnCreateInstance( (LPVOID *)&unk );
486  if (FAILED( hr ))
487  return hr;
488 
489  hr = IUnknown_QueryInterface( unk, riid, obj );
490  IUnknown_Release( unk );
491  return hr;
492 }
static struct factory * impl_from_IClassFactory(IClassFactory *iface)
Definition: main.c:446
HRESULT hr
Definition: shlfolder.c:183
REFIID riid
Definition: precomp.h:44
HRESULT(* fnCreateInstance)(LPVOID *)
Definition: main.c:443
Definition: main.c:440
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662

◆ factory_LockServer()

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

Definition at line 494 of file main.c.

495 {
496  FIXME( "%p, %d\n", iface, lock );
497  return S_OK;
498 }
rwlock_t lock
Definition: tcpcore.h:1163
#define FIXME(fmt,...)
Definition: debug.h:110
#define S_OK
Definition: intsafe.h:59

◆ factory_QueryInterface()

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

Definition at line 451 of file main.c.

452 {
454  {
455  IClassFactory_AddRef( iface );
456  *obj = iface;
457  return S_OK;
458  }
459  FIXME( "interface %s not implemented\n", debugstr_guid(riid) );
460  return E_NOINTERFACE;
461 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_guid
Definition: kernel32.h:35
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
const GUID IID_IClassFactory

◆ factory_Release()

static ULONG WINAPI factory_Release ( IClassFactory iface)
static

Definition at line 468 of file main.c.

469 {
470  return 1;
471 }

◆ impl_from_IClassFactory()

static struct factory* impl_from_IClassFactory ( IClassFactory iface)
inlinestatic

Definition at line 446 of file main.c.

447 {
448  return CONTAINING_RECORD( iface, struct factory, IClassFactory_iface );
449 }
Definition: main.c:440
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
IClassFactory IClassFactory_iface
Definition: main.c:442

Referenced by factory_CreateInstance().

◆ impl_from_IMoniker()

static struct moniker* impl_from_IMoniker ( IMoniker iface)
inlinestatic

Definition at line 48 of file main.c.

50 {
51  return CONTAINING_RECORD( iface, struct moniker, IMoniker_iface );
52 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
Definition: main.c:41

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

◆ moniker_AddRef()

static ULONG WINAPI moniker_AddRef ( IMoniker iface)
static

Definition at line 54 of file main.c.

56 {
57  struct moniker *moniker = impl_from_IMoniker( iface );
58  return InterlockedIncrement( &moniker->refs );
59 }
LONG refs
Definition: main.c:44
static struct moniker * impl_from_IMoniker(IMoniker *iface)
Definition: main.c:48
#define InterlockedIncrement
Definition: armddk.h:53
Definition: main.c:41

◆ moniker_BindToObject()

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

Definition at line 131 of file main.c.

133 {
134  struct moniker *moniker = impl_from_IMoniker( iface );
135 
136  TRACE( "%p, %p, %p, %s, %p\n", iface, pbc, pmkToLeft, debugstr_guid(riidResult), ppvResult );
137  return IUnknown_QueryInterface( moniker->obj, riidResult, ppvResult );
138 }
IUnknown * obj
Definition: main.c:45
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
static struct moniker * impl_from_IMoniker(IMoniker *iface)
Definition: main.c:48
Definition: main.c:41

◆ moniker_BindToStorage()

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

Definition at line 140 of file main.c.

142 {
143  FIXME( "\n" );
144  return E_NOTIMPL;
145 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ moniker_CommonPrefixWith()

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

Definition at line 203 of file main.c.

205 {
206  FIXME( "\n" );
207  return E_NOTIMPL;
208 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ moniker_ComposeWith()

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

Definition at line 154 of file main.c.

156 {
157  FIXME( "\n" );
158  return E_NOTIMPL;
159 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ Moniker_create()

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

Definition at line 266 of file main.c.

267 {
268  struct moniker *moniker;
269 
270  TRACE( "%p, %p\n", unk, obj );
271 
272  if (!(moniker = heap_alloc( sizeof(*moniker) ))) return E_OUTOFMEMORY;
274  moniker->refs = 1;
275  moniker->obj = unk;
276  IUnknown_AddRef( moniker->obj );
277 
279  TRACE( "returning iface %p\n", *obj );
280  return S_OK;
281 }
IUnknown * obj
Definition: main.c:45
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
IMoniker IMoniker_iface
Definition: main.c:43
#define TRACE(s)
Definition: solgame.cpp:4
LONG refs
Definition: main.c:44
#define S_OK
Definition: intsafe.h:59
Definition: main.c:41
static const IMonikerVtbl moniker_vtbl
Definition: main.c:239

Referenced by WinMGMTS_ParseDisplayName().

◆ moniker_Enum()

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

Definition at line 161 of file main.c.

163 {
164  FIXME( "\n" );
165  return E_NOTIMPL;
166 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ moniker_GetClassID()

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

Definition at line 96 of file main.c.

98 {
99  FIXME( "\n" );
100  return E_NOTIMPL;
101 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ moniker_GetDisplayName()

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

Definition at line 217 of file main.c.

219 {
220  FIXME( "\n" );
221  return E_NOTIMPL;
222 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ moniker_GetSizeMax()

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

Definition at line 124 of file main.c.

126 {
127  FIXME( "\n" );
128  return E_NOTIMPL;
129 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ moniker_GetTimeOfLastChange()

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

Definition at line 189 of file main.c.

191 {
192  FIXME( "\n" );
193  return E_NOTIMPL;
194 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ moniker_Hash()

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

Definition at line 175 of file main.c.

177 {
178  FIXME( "\n" );
179  return E_NOTIMPL;
180 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ moniker_Inverse()

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

Definition at line 196 of file main.c.

198 {
199  FIXME( "\n" );
200  return E_NOTIMPL;
201 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ moniker_IsDirty()

static HRESULT WINAPI moniker_IsDirty ( IMoniker iface)
static

Definition at line 103 of file main.c.

105 {
106  FIXME( "\n" );
107  return E_NOTIMPL;
108 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ moniker_IsEqual()

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

Definition at line 168 of file main.c.

170 {
171  FIXME( "\n" );
172  return E_NOTIMPL;
173 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ moniker_IsRunning()

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

Definition at line 182 of file main.c.

184 {
185  FIXME( "\n" );
186  return E_NOTIMPL;
187 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ moniker_IsSystemMoniker()

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

Definition at line 232 of file main.c.

234 {
235  FIXME( "\n" );
236  return E_NOTIMPL;
237 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ moniker_Load()

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

Definition at line 110 of file main.c.

112 {
113  FIXME( "\n" );
114  return E_NOTIMPL;
115 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ moniker_ParseDisplayName()

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

Definition at line 224 of file main.c.

227 {
228  FIXME( "\n" );
229  return E_NOTIMPL;
230 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ moniker_QueryInterface()

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

Definition at line 75 of file main.c.

77 {
78  struct moniker *moniker = impl_from_IMoniker( iface );
79 
80  TRACE( "%p, %s, %p\n", moniker, debugstr_guid( riid ), ppvObject );
81 
82  if (IsEqualGUID( riid, &IID_IMoniker ) ||
84  {
85  *ppvObject = iface;
86  }
87  else
88  {
89  FIXME( "interface %s not implemented\n", debugstr_guid(riid) );
90  return E_NOINTERFACE;
91  }
92  IMoniker_AddRef( iface );
93  return S_OK;
94 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
REFIID LPVOID * ppvObject
Definition: precomp.h:44
static struct moniker * impl_from_IMoniker(IMoniker *iface)
Definition: main.c:48
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
Definition: main.c:41

◆ moniker_Reduce()

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

Definition at line 147 of file main.c.

149 {
150  FIXME( "\n" );
151  return E_NOTIMPL;
152 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ moniker_RelativePathTo()

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

Definition at line 210 of file main.c.

212 {
213  FIXME( "\n" );
214  return E_NOTIMPL;
215 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ moniker_Release()

static ULONG WINAPI moniker_Release ( IMoniker iface)
static

Definition at line 61 of file main.c.

63 {
64  struct moniker *moniker = impl_from_IMoniker( iface );
66  if (!refs)
67  {
68  TRACE( "destroying %p\n", moniker );
69  IUnknown_Release( moniker->obj );
70  heap_free( moniker );
71  }
72  return refs;
73 }
IUnknown * obj
Definition: main.c:45
long LONG
Definition: pedump.c:60
#define TRACE(s)
Definition: solgame.cpp:4
LONG refs
Definition: main.c:44
#define InterlockedDecrement
Definition: armddk.h:52
static struct moniker * impl_from_IMoniker(IMoniker *iface)
Definition: main.c:48
Definition: main.c:41
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ moniker_Save()

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

Definition at line 117 of file main.c.

119 {
120  FIXME( "\n" );
121  return E_NOTIMPL;
122 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ parse_path()

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

Definition at line 311 of file main.c.

312 {
313  IWbemPath *path;
314  ULONG len;
315  HRESULT hr;
316 
317  *server = *namespace = *relative = NULL;
318 
319  hr = CoCreateInstance( &CLSID_WbemDefPath, NULL, CLSCTX_INPROC_SERVER, &IID_IWbemPath, (void **)&path );
320  if (hr != S_OK) return hr;
321 
322  hr = IWbemPath_SetText( path, WBEMPATH_CREATE_ACCEPT_ALL, str );
323  if (hr != S_OK) goto done;
324 
325  len = 0;
326  hr = IWbemPath_GetServer( path, &len, NULL );
327  if (hr == S_OK)
328  {
329  if (!(*server = SysAllocStringLen( NULL, len )))
330  {
331  hr = E_OUTOFMEMORY;
332  goto done;
333  }
334  hr = IWbemPath_GetServer( path, &len, *server );
335  if (hr != S_OK) goto done;
336  }
337 
338  len = 0;
339  hr = IWbemPath_GetText( path, WBEMPATH_GET_NAMESPACE_ONLY, &len, NULL );
340  if (hr == S_OK)
341  {
342  if (!(*namespace = SysAllocStringLen( NULL, len )))
343  {
344  hr = E_OUTOFMEMORY;
345  goto done;
346  }
347  hr = IWbemPath_GetText( path, WBEMPATH_GET_NAMESPACE_ONLY, &len, *namespace );
348  if (hr != S_OK) goto done;
349  }
350  len = 0;
351  hr = IWbemPath_GetText( path, WBEMPATH_GET_RELATIVE_ONLY, &len, NULL );
352  if (hr == S_OK)
353  {
354  if (!(*relative = SysAllocStringLen( NULL, len )))
355  {
356  hr = E_OUTOFMEMORY;
357  goto done;
358  }
359  hr = IWbemPath_GetText( path, WBEMPATH_GET_RELATIVE_ONLY, &len, *relative );
360  }
361 
362 done:
363  IWbemPath_Release( path );
364  if (hr != S_OK)
365  {
366  SysFreeString( *server );
367  SysFreeString( *namespace );
368  SysFreeString( *relative );
369  }
370  return hr;
371 }
static rfbScreenInfoPtr server
Definition: vnc.c:74
HRESULT hr
Definition: shlfolder.c:183
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:342
GLsizei const GLchar ** path
Definition: glext.h:7234
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
GLenum GLsizei len
Definition: glext.h:6722
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
#define S_OK
Definition: intsafe.h:59
Definition: services.c:325
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
unsigned int ULONG
Definition: retypes.h:1

Referenced by WinMGMTS_ParseDisplayName().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( wbemdisp  )

◆ WinMGMTS_AddRef()

static ULONG WINAPI WinMGMTS_AddRef ( IParseDisplayName iface)
static

Definition at line 301 of file main.c.

302 {
303  return 2;
304 }

◆ WinMGMTS_create()

static HRESULT WinMGMTS_create ( void **  ppv)
static

Definition at line 434 of file main.c.

435 {
436  *ppv = &winmgmts;
437  return S_OK;
438 }
REFIID LPVOID * ppv
Definition: atlbase.h:39
static IParseDisplayName winmgmts
Definition: main.c:432
#define S_OK
Definition: intsafe.h:59

◆ WinMGMTS_ParseDisplayName()

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

Definition at line 373 of file main.c.

375 {
376  static const WCHAR prefixW[] = {'w','i','n','m','g','m','t','s',':',0};
377  const DWORD prefix_len = ARRAY_SIZE(prefixW) - 1;
378  ISWbemLocator *locator = NULL;
379  ISWbemServices *services = NULL;
380  ISWbemObject *obj = NULL;
381  BSTR server, namespace, relative;
382  WCHAR *p;
383  HRESULT hr;
384 
385  TRACE( "%p, %p, %s, %p, %p\n", iface, pbc, debugstr_w(pszDisplayName), pchEaten, ppmkOut );
386 
387  if (strncmpiW( pszDisplayName, prefixW, prefix_len )) return MK_E_SYNTAX;
388 
389  p = pszDisplayName + prefix_len;
390  if (*p == '{')
391  {
392  FIXME( "ignoring security settings\n" );
393  while (*p && *p != '}') p++;
394  if (*p == '}') p++;
395  if (*p == '!') p++;
396  }
397  hr = parse_path( p, &server, &namespace, &relative );
398  if (hr != S_OK) return hr;
399 
400  hr = SWbemLocator_create( (void **)&locator );
401  if (hr != S_OK) goto done;
402 
403  hr = ISWbemLocator_ConnectServer( locator, server, namespace, NULL, NULL, NULL, NULL, 0, NULL, &services );
404  if (hr != S_OK) goto done;
405 
406  if (!relative || !*relative) Moniker_create( (IUnknown *)services, ppmkOut );
407  else
408  {
409  hr = ISWbemServices_Get( services, relative, 0, NULL, &obj );
410  if (hr != S_OK) goto done;
411  hr = Moniker_create( (IUnknown *)obj, ppmkOut );
412  }
413 
414 done:
415  if (obj) ISWbemObject_Release( obj );
416  if (services) ISWbemServices_Release( services );
417  if (locator) ISWbemLocator_Release( locator );
419  SysFreeString( namespace );
420  SysFreeString( relative );
421  if (hr == S_OK) *pchEaten = strlenW( pszDisplayName );
422  return hr;
423 }
static rfbScreenInfoPtr server
Definition: vnc.c:74
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
HRESULT hr
Definition: shlfolder.c:183
static HRESULT parse_path(const WCHAR *str, BSTR *server, BSTR *namespace, BSTR *relative)
Definition: main.c:311
OLECHAR * BSTR
Definition: compat.h:1942
#define strncmpiW(s1, s2, n)
Definition: unicode.h:40
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
static HRESULT Moniker_create(IUnknown *unk, IMoniker **obj)
Definition: main.c:266
#define S_OK
Definition: intsafe.h:59
#define ARRAY_SIZE(a)
Definition: main.h:24
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
HRESULT SWbemLocator_create(void **obj)
Definition: locator.c:2222
#define MK_E_SYNTAX
Definition: winerror.h:2785
GLfloat GLfloat p
Definition: glext.h:8902

◆ WinMGMTS_QueryInterface()

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

Definition at line 283 of file main.c.

284 {
285  if(IsEqualGUID(riid, &IID_IUnknown)) {
286  TRACE("(IID_IUnknown %p)\n", ppv);
287  *ppv = iface;
288  }else if(IsEqualGUID(riid, &IID_IParseDisplayName)) {
289  TRACE("(IID_IParseDisplayName %p)\n", ppv);
290  *ppv = iface;
291  }else {
292  WARN("Unsupported riid %s\n", debugstr_guid(riid));
293  *ppv = NULL;
294  return E_NOINTERFACE;
295  }
296 
297  IUnknown_AddRef((IUnknown*)*ppv);
298  return S_OK;
299 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define WARN(fmt,...)
Definition: debug.h:111
REFIID LPVOID * ppv
Definition: atlbase.h:39
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IParseDisplayName
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ WinMGMTS_Release()

static ULONG WINAPI WinMGMTS_Release ( IParseDisplayName iface)
static

Definition at line 306 of file main.c.

307 {
308  return 1;
309 }

Variable Documentation

◆ factory_vtbl

const struct IClassFactoryVtbl factory_vtbl
static
Initial value:
=
{
}
static ULONG WINAPI factory_AddRef(IClassFactory *iface)
Definition: main.c:463
static HRESULT WINAPI factory_QueryInterface(IClassFactory *iface, REFIID riid, LPVOID *obj)
Definition: main.c:451
static HRESULT WINAPI factory_LockServer(IClassFactory *iface, BOOL lock)
Definition: main.c:494
static HRESULT WINAPI factory_CreateInstance(IClassFactory *iface, LPUNKNOWN outer, REFIID riid, LPVOID *obj)
Definition: main.c:473
static ULONG WINAPI factory_Release(IClassFactory *iface)
Definition: main.c:468

Definition at line 500 of file main.c.

◆ instance

HINSTANCE instance
static

Definition at line 39 of file main.c.

Referenced by DllMain(), DllRegisterServer(), and DllUnregisterServer().

◆ moniker_vtbl

const IMonikerVtbl moniker_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI moniker_ComposeWith(IMoniker *iface, IMoniker *pmkRight, BOOL fOnlyIfNotGeneric, IMoniker **ppmkComposite)
Definition: main.c:154
static HRESULT WINAPI moniker_IsDirty(IMoniker *iface)
Definition: main.c:103
static HRESULT WINAPI moniker_IsEqual(IMoniker *iface, IMoniker *pmkOtherMoniker)
Definition: main.c:168
static HRESULT WINAPI moniker_IsRunning(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, IMoniker *pmkNewlyRunning)
Definition: main.c:182
static HRESULT WINAPI moniker_Save(IMoniker *iface, IStream *pStm, BOOL fClearDirty)
Definition: main.c:117
static HRESULT WINAPI moniker_IsSystemMoniker(IMoniker *iface, DWORD *pdwMksys)
Definition: main.c:232
static HRESULT WINAPI moniker_Reduce(IMoniker *iface, IBindCtx *pbc, DWORD dwReduceHowFar, IMoniker **ppmkToLeft, IMoniker **ppmkReduced)
Definition: main.c:147
static HRESULT WINAPI moniker_GetSizeMax(IMoniker *iface, ULARGE_INTEGER *pcbSize)
Definition: main.c:124
static HRESULT WINAPI moniker_GetDisplayName(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, LPOLESTR *ppszDisplayName)
Definition: main.c:217
static HRESULT WINAPI moniker_BindToObject(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, REFIID riidResult, void **ppvResult)
Definition: main.c:131
static HRESULT WINAPI moniker_RelativePathTo(IMoniker *iface, IMoniker *pmkOther, IMoniker **ppmkRelPath)
Definition: main.c:210
static HRESULT WINAPI moniker_QueryInterface(IMoniker *iface, REFIID riid, void **ppvObject)
Definition: main.c:75
static HRESULT WINAPI moniker_ParseDisplayName(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, LPOLESTR pszDisplayName, ULONG *pchEaten, IMoniker **ppmkOut)
Definition: main.c:224
static HRESULT WINAPI moniker_Inverse(IMoniker *iface, IMoniker **ppmk)
Definition: main.c:196
static HRESULT WINAPI moniker_GetTimeOfLastChange(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, FILETIME *pFileTime)
Definition: main.c:189
static HRESULT WINAPI moniker_Enum(IMoniker *iface, BOOL fForward, IEnumMoniker **ppenumMoniker)
Definition: main.c:161
static HRESULT WINAPI moniker_BindToStorage(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, REFIID riid, void **ppvObj)
Definition: main.c:140
static HRESULT WINAPI moniker_GetClassID(IMoniker *iface, CLSID *pClassID)
Definition: main.c:96
static HRESULT WINAPI moniker_Hash(IMoniker *iface, DWORD *pdwHash)
Definition: main.c:175
static ULONG WINAPI moniker_Release(IMoniker *iface)
Definition: main.c:61
static ULONG WINAPI moniker_AddRef(IMoniker *iface)
Definition: main.c:54
static HRESULT WINAPI moniker_Load(IMoniker *iface, IStream *pStm)
Definition: main.c:110
static HRESULT WINAPI moniker_CommonPrefixWith(IMoniker *iface, IMoniker *pmkOther, IMoniker **ppmkPrefix)
Definition: main.c:203

Definition at line 239 of file main.c.

Referenced by Moniker_create().

◆ swbem_locator_cf

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

Definition at line 509 of file main.c.

Referenced by DllGetClassObject().

◆ winmgmts

IParseDisplayName winmgmts = { &WinMGMTSVtbl }
static

Definition at line 432 of file main.c.

Referenced by WinMGMTS_create().

◆ winmgmts_cf

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

Definition at line 510 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:283
static ULONG WINAPI WinMGMTS_AddRef(IParseDisplayName *iface)
Definition: main.c:301
static ULONG WINAPI WinMGMTS_Release(IParseDisplayName *iface)
Definition: main.c:306
static HRESULT WINAPI WinMGMTS_ParseDisplayName(IParseDisplayName *iface, IBindCtx *pbc, LPOLESTR pszDisplayName, ULONG *pchEaten, IMoniker **ppmkOut)
Definition: main.c:373

Definition at line 425 of file main.c.