ReactOS 0.4.16-dev-297-gc569aee
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
 
struct listtable_list
 
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 40 of file main.c.

Function Documentation

◆ DllCanUnloadNow()

HRESULT WINAPI DllCanUnloadNow ( void  )

Definition at line 149 of file main.c.

150{
151 return S_FALSE;
152}
#define S_FALSE
Definition: winerror.h:2357

◆ DllGetClassObject()

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

Definition at line 131 of file main.c.

132{
134
135 TRACE("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv);
136
137 if (IsEqualGUID( rclsid, &CLSID_WbemLocator ) ||
138 IsEqualGUID( rclsid, &CLSID_WbemAdministrativeLocator ))
139 {
141 }
142 if (!cf) return CLASS_E_CLASSNOTAVAILABLE;
143 return IClassFactory_QueryInterface( cf, iid, ppv );
144}
#define NULL
Definition: types.h:112
static wbemprox_cf wbem_locator_cf
Definition: main.c:114
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define TRACE(s)
Definition: solgame.cpp:4
IClassFactory IClassFactory_iface
Definition: main.c:44
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663

◆ DllMain()

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

Definition at line 116 of file main.c.

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

◆ DllRegisterServer()

HRESULT WINAPI DllRegisterServer ( void  )

Definition at line 157 of file main.c.

158{
160}
HRESULT __wine_register_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:98

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 165 of file main.c.

166{
168}
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 48 of file main.c.

49{
50 return CONTAINING_RECORD(iface, wbemprox_cf, IClassFactory_iface);
51}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

◆ wbemprox_cf_AddRef()

static ULONG WINAPI wbemprox_cf_AddRef ( IClassFactory iface)
static

Definition at line 66 of file main.c.

67{
68 return 2;
69}

◆ wbemprox_cf_CreateInstance()

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

Definition at line 76 of file main.c.

78{
80 HRESULT r;
81 IUnknown *punk;
82
83 TRACE("%p %s %p\n", pOuter, debugstr_guid(riid), ppobj);
84
85 *ppobj = NULL;
86
87 if (pOuter)
89
90 r = This->pfnCreateInstance( (LPVOID *)&punk );
91 if (FAILED(r))
92 return r;
93
94 r = IUnknown_QueryInterface( punk, riid, ppobj );
95 IUnknown_Release( punk );
96 return r;
97}
static IClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: main.c:63
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
REFIID riid
Definition: atlbase.h:39
#define FAILED(hr)
Definition: intsafe.h:51
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662

◆ wbemprox_cf_LockServer()

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

Definition at line 99 of file main.c.

100{
101 FIXME("(%p)->(%d)\n", iface, dolock);
102 return S_OK;
103}
#define FIXME(fmt,...)
Definition: precomp.h:53
#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 53 of file main.c.

54{
57 {
58 IClassFactory_AddRef( iface );
59 *ppobj = iface;
60 return S_OK;
61 }
62 FIXME("interface %s not implemented\n", debugstr_guid(riid));
63 return E_NOINTERFACE;
64}
const GUID IID_IUnknown
const GUID IID_IClassFactory
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ wbemprox_cf_Release()

static ULONG WINAPI wbemprox_cf_Release ( IClassFactory iface)
static

Definition at line 71 of file main.c.

72{
73 return 1;
74}

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( wbemprox  )

Variable Documentation

◆ instance

HINSTANCE instance
static

Definition at line 36 of file main.c.

◆ table_list

struct list* table_list

Definition at line 38 of file main.c.

Referenced by add_table(), grab_table(), and init_table_list().

◆ wbem_locator_cf

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

Definition at line 114 of file main.c.

Referenced by DllGetClassObject().

◆ wbemprox_cf_vtbl

const struct IClassFactoryVtbl wbemprox_cf_vtbl
static
Initial value:
=
{
}
static ULONG WINAPI wbemprox_cf_AddRef(IClassFactory *iface)
Definition: main.c:66
static HRESULT WINAPI wbemprox_cf_LockServer(IClassFactory *iface, BOOL dolock)
Definition: main.c:99
static HRESULT WINAPI wbemprox_cf_QueryInterface(IClassFactory *iface, REFIID riid, LPVOID *ppobj)
Definition: main.c:53
static HRESULT WINAPI wbemprox_cf_CreateInstance(IClassFactory *iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
Definition: main.c:76
static ULONG WINAPI wbemprox_cf_Release(IClassFactory *iface)
Definition: main.c:71

Definition at line 105 of file main.c.