ReactOS  0.4.14-dev-1115-gebeeb9d
main.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "initguid.h"
#include "objbase.h"
#include "wbemcli.h"
#include "wmiutils.h"
#include "rpcproxy.h"
#include "wine/debug.h"
#include "wmiutils_private.h"
Include dependency graph for main.c:

Go to the source code of this file.

Classes

struct  wmiutils_cf
 

Macros

#define COBJMACROS
 

Typedefs

typedef HRESULT(* fnCreateInstance) (LPVOID *ppObj)
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (wmiutils)
 
static wmiutils_cfimpl_from_IClassFactory (IClassFactory *iface)
 
static HRESULT WINAPI wmiutils_cf_QueryInterface (IClassFactory *iface, REFIID riid, LPVOID *ppobj)
 
static ULONG WINAPI wmiutils_cf_AddRef (IClassFactory *iface)
 
static ULONG WINAPI wmiutils_cf_Release (IClassFactory *iface)
 
static HRESULT WINAPI wmiutils_cf_CreateInstance (IClassFactory *iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
 
static HRESULT WINAPI wmiutils_cf_LockServer (IClassFactory *iface, BOOL dolock)
 
BOOL WINAPI DllMain (HINSTANCE hinst, DWORD reason, LPVOID lpv)
 
HRESULT WINAPI DllGetClassObject (REFCLSID rclsid, REFIID iid, LPVOID *ppv)
 
HRESULT WINAPI DllCanUnloadNow (void)
 
HRESULT WINAPI DllRegisterServer (void)
 
HRESULT WINAPI DllUnregisterServer (void)
 

Variables

static HINSTANCE instance
 
static const struct IClassFactoryVtbl wmiutils_cf_vtbl
 
static wmiutils_cf status_code_cf = { { &wmiutils_cf_vtbl }, WbemStatusCodeText_create }
 
static wmiutils_cf path_cf = { { &wmiutils_cf_vtbl }, WbemPath_create }
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 21 of file main.c.

Typedef Documentation

◆ fnCreateInstance

typedef HRESULT(* fnCreateInstance) (LPVOID *ppObj)

Definition at line 39 of file main.c.

Function Documentation

◆ DllCanUnloadNow()

HRESULT WINAPI DllCanUnloadNow ( void  )

Definition at line 151 of file main.c.

152 {
153  return S_FALSE;
154 }
#define S_FALSE
Definition: winerror.h:2357

◆ DllGetClassObject()

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

Definition at line 130 of file main.c.

131 {
132  IClassFactory *cf = NULL;
133 
134  TRACE("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv);
135 
136  if (IsEqualGUID( rclsid, &CLSID_WbemStatusCode ))
137  {
139  }
140  else if (IsEqualGUID( rclsid, &CLSID_WbemDefPath ))
141  {
143  }
144  if (!cf) return CLASS_E_CLASSNOTAVAILABLE;
145  return IClassFactory_QueryInterface( cf, iid, ppv );
146 }
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663
IClassFactory IClassFactory_iface
Definition: main.c:43
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
static wmiutils_cf status_code_cf
Definition: main.c:113
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
static wmiutils_cf path_cf
Definition: main.c:114

◆ DllMain()

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

Definition at line 116 of file main.c.

117 {
118  switch(reason)
119  {
120  case DLL_WINE_PREATTACH:
121  return FALSE; /* prefer native version */
122  case DLL_PROCESS_ATTACH:
123  instance = hinst;
125  break;
126  }
127  return TRUE;
128 }
#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:37
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 159 of file main.c.

160 {
162 }
HRESULT __wine_register_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:98
static HINSTANCE instance
Definition: main.c:37

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 167 of file main.c.

168 {
170 }
static HINSTANCE instance
Definition: main.c:37
HRESULT __wine_unregister_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:110

◆ impl_from_IClassFactory()

static wmiutils_cf* impl_from_IClassFactory ( IClassFactory iface)
inlinestatic

Definition at line 47 of file main.c.

48 {
50 }
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:62

Referenced by wmiutils_cf_CreateInstance().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( wmiutils  )

◆ wmiutils_cf_AddRef()

static ULONG WINAPI wmiutils_cf_AddRef ( IClassFactory iface)
static

Definition at line 65 of file main.c.

66 {
67  return 2;
68 }

◆ wmiutils_cf_CreateInstance()

static HRESULT WINAPI wmiutils_cf_CreateInstance ( IClassFactory iface,
LPUNKNOWN  pOuter,
REFIID  riid,
LPVOID ppobj 
)
static

Definition at line 75 of file main.c.

77 {
79  HRESULT r;
80  IUnknown *punk;
81 
82  TRACE("%p %s %p\n", pOuter, debugstr_guid(riid), ppobj);
83 
84  *ppobj = NULL;
85 
86  if (pOuter)
87  return CLASS_E_NOAGGREGATION;
88 
89  r = This->pfnCreateInstance( (LPVOID *)&punk );
90  if (FAILED(r))
91  return r;
92 
93  r = IUnknown_QueryInterface( punk, riid, ppobj );
94  IUnknown_Release( punk );
95  return r;
96 }
REFIID riid
Definition: precomp.h:44
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
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:78
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
static wmiutils_cf * impl_from_IClassFactory(IClassFactory *iface)
Definition: main.c:47

◆ wmiutils_cf_LockServer()

static HRESULT WINAPI wmiutils_cf_LockServer ( IClassFactory iface,
BOOL  dolock 
)
static

Definition at line 98 of file main.c.

99 {
100  FIXME("(%p)->(%d)\n", iface, dolock);
101  return S_OK;
102 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define S_OK
Definition: intsafe.h:59

◆ wmiutils_cf_QueryInterface()

static HRESULT WINAPI wmiutils_cf_QueryInterface ( IClassFactory iface,
REFIID  riid,
LPVOID ppobj 
)
static

Definition at line 52 of file main.c.

53 {
54  if (IsEqualGUID(riid, &IID_IUnknown) ||
56  {
57  IClassFactory_AddRef( iface );
58  *ppobj = iface;
59  return S_OK;
60  }
61  FIXME("interface %s not implemented\n", debugstr_guid(riid));
62  return E_NOINTERFACE;
63 }
#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

◆ wmiutils_cf_Release()

static ULONG WINAPI wmiutils_cf_Release ( IClassFactory iface)
static

Definition at line 70 of file main.c.

71 {
72  return 1;
73 }

Variable Documentation

◆ instance

HINSTANCE instance
static

Definition at line 37 of file main.c.

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

◆ path_cf

wmiutils_cf path_cf = { { &wmiutils_cf_vtbl }, WbemPath_create }
static

Definition at line 114 of file main.c.

Referenced by DllGetClassObject().

◆ status_code_cf

wmiutils_cf status_code_cf = { { &wmiutils_cf_vtbl }, WbemStatusCodeText_create }
static

Definition at line 113 of file main.c.

Referenced by DllGetClassObject().

◆ wmiutils_cf_vtbl

const struct IClassFactoryVtbl wmiutils_cf_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI wmiutils_cf_QueryInterface(IClassFactory *iface, REFIID riid, LPVOID *ppobj)
Definition: main.c:52
static HRESULT WINAPI wmiutils_cf_CreateInstance(IClassFactory *iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
Definition: main.c:75
static HRESULT WINAPI wmiutils_cf_LockServer(IClassFactory *iface, BOOL dolock)
Definition: main.c:98
static ULONG WINAPI wmiutils_cf_AddRef(IClassFactory *iface)
Definition: main.c:65
static ULONG WINAPI wmiutils_cf_Release(IClassFactory *iface)
Definition: main.c:70

Definition at line 104 of file main.c.