ReactOS  0.4.15-dev-2956-g61e7ea5
main.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "objbase.h"
#include "wbemcli.h"
#include "wbemprov.h"
#include "rpcproxy.h"
#include "wbemprox_private.h"
#include "wine/debug.h"
Include dependency graph for main.c:

Go to the source code of this file.

Classes

struct  wbemprox_cf
 

Macros

#define COBJMACROS
 

Typedefs

typedef HRESULT(* fnCreateInstance) (LPVOID *ppObj)
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (wbemprox)
 
static wbemprox_cfimpl_from_IClassFactory (IClassFactory *iface)
 
static HRESULT WINAPI wbemprox_cf_QueryInterface (IClassFactory *iface, REFIID riid, LPVOID *ppobj)
 
static ULONG WINAPI wbemprox_cf_AddRef (IClassFactory *iface)
 
static ULONG WINAPI wbemprox_cf_Release (IClassFactory *iface)
 
static HRESULT WINAPI wbemprox_cf_CreateInstance (IClassFactory *iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
 
static HRESULT WINAPI wbemprox_cf_LockServer (IClassFactory *iface, BOOL dolock)
 
BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
 
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 wbemprox_cf_vtbl
 
static wbemprox_cf wbem_locator_cf = { { &wbemprox_cf_vtbl }, WbemLocator_create }
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 22 of file main.c.

Typedef Documentation

◆ fnCreateInstance

typedef HRESULT(* fnCreateInstance) (LPVOID *ppObj)

Definition at line 38 of file main.c.

Function Documentation

◆ DllCanUnloadNow()

HRESULT WINAPI DllCanUnloadNow ( void  )

Definition at line 147 of file main.c.

148 {
149  return S_FALSE;
150 }
#define S_FALSE
Definition: winerror.h:2357

◆ DllGetClassObject()

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

Definition at line 129 of file main.c.

130 {
131  IClassFactory *cf = NULL;
132 
133  TRACE("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv);
134 
135  if (IsEqualGUID( rclsid, &CLSID_WbemLocator ) ||
136  IsEqualGUID( rclsid, &CLSID_WbemAdministrativeLocator ))
137  {
139  }
140  if (!cf) return CLASS_E_CLASSNOTAVAILABLE;
141  return IClassFactory_QueryInterface( cf, iid, ppv );
142 }
REFIID LPVOID * ppv
Definition: atlbase.h:39
static wbemprox_cf wbem_locator_cf
Definition: main.c:112
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663
#define debugstr_guid
Definition: kernel32.h:35
IClassFactory IClassFactory_iface
Definition: main.c:42
#define TRACE(s)
Definition: solgame.cpp:4
#define NULL
Definition: types.h:112
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hinstDLL,
DWORD  fdwReason,
LPVOID  lpvReserved 
)

Definition at line 114 of file main.c.

115 {
116 
117  switch (fdwReason)
118  {
119  case DLL_PROCESS_ATTACH:
120  instance = hinstDLL;
121  DisableThreadLibraryCalls(hinstDLL);
122  init_table_list();
123  break;
124  }
125 
126  return TRUE;
127 }
#define TRUE
Definition: types.h:120
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
void init_table_list(void)
Definition: builtin.c:4605
static HINSTANCE instance
Definition: main.c:36

◆ DllRegisterServer()

HRESULT WINAPI DllRegisterServer ( void  )

Definition at line 155 of file main.c.

156 {
158 }
HRESULT __wine_register_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:98
static HINSTANCE instance
Definition: main.c:36

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 163 of file main.c.

164 {
166 }
static HINSTANCE instance
Definition: main.c:36
HRESULT __wine_unregister_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:110

◆ impl_from_IClassFactory()

static wbemprox_cf* impl_from_IClassFactory ( IClassFactory iface)
inlinestatic

Definition at line 46 of file main.c.

47 {
48  return CONTAINING_RECORD(iface, wbemprox_cf, IClassFactory_iface);
49 }
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

Referenced by wbemprox_cf_CreateInstance().

◆ wbemprox_cf_AddRef()

static ULONG WINAPI wbemprox_cf_AddRef ( IClassFactory iface)
static

Definition at line 64 of file main.c.

65 {
66  return 2;
67 }

◆ wbemprox_cf_CreateInstance()

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

Definition at line 74 of file main.c.

76 {
78  HRESULT r;
79  IUnknown *punk;
80 
81  TRACE("%p %s %p\n", pOuter, debugstr_guid(riid), ppobj);
82 
83  *ppobj = NULL;
84 
85  if (pOuter)
86  return CLASS_E_NOAGGREGATION;
87 
88  r = This->pfnCreateInstance( (LPVOID *)&punk );
89  if (FAILED(r))
90  return r;
91 
92  r = IUnknown_QueryInterface( punk, riid, ppobj );
93  IUnknown_Release( punk );
94  return r;
95 }
static wbemprox_cf * impl_from_IClassFactory(IClassFactory *iface)
Definition: main.c:46
REFIID riid
Definition: precomp.h:44
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
#define NULL
Definition: types.h:112

◆ wbemprox_cf_LockServer()

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

Definition at line 97 of file main.c.

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

◆ wbemprox_cf_QueryInterface()

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

Definition at line 51 of file main.c.

52 {
53  if (IsEqualGUID(riid, &IID_IUnknown) ||
55  {
56  IClassFactory_AddRef( iface );
57  *ppobj = iface;
58  return S_OK;
59  }
60  FIXME("interface %s not implemented\n", debugstr_guid(riid));
61  return E_NOINTERFACE;
62 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define FIXME(fmt,...)
Definition: debug.h:111
#define debugstr_guid
Definition: kernel32.h:35
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:52
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
const GUID IID_IClassFactory

◆ wbemprox_cf_Release()

static ULONG WINAPI wbemprox_cf_Release ( IClassFactory iface)
static

Definition at line 69 of file main.c.

70 {
71  return 1;
72 }

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( wbemprox  )

Variable Documentation

◆ instance

HINSTANCE instance
static

Definition at line 36 of file main.c.

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

◆ wbem_locator_cf

wbemprox_cf wbem_locator_cf = { { &wbemprox_cf_vtbl }, WbemLocator_create }
static

Definition at line 112 of file main.c.

Referenced by DllGetClassObject().

◆ wbemprox_cf_vtbl

const struct IClassFactoryVtbl wbemprox_cf_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI wbemprox_cf_LockServer(IClassFactory *iface, BOOL dolock)
Definition: main.c:97
static ULONG WINAPI wbemprox_cf_AddRef(IClassFactory *iface)
Definition: main.c:64
static ULONG WINAPI wbemprox_cf_Release(IClassFactory *iface)
Definition: main.c:69
static HRESULT WINAPI wbemprox_cf_CreateInstance(IClassFactory *iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
Definition: main.c:74
static HRESULT WINAPI wbemprox_cf_QueryInterface(IClassFactory *iface, REFIID riid, LPVOID *ppobj)
Definition: main.c:51

Definition at line 103 of file main.c.