ReactOS 0.4.15-dev-8241-g63935f8
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{
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}
#define NULL
Definition: types.h:112
static wmiutils_cf path_cf
Definition: main.c:114
static wmiutils_cf status_code_cf
Definition: main.c:113
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:43
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663

◆ 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 */
123 instance = hinst;
125 break;
126 }
127 return TRUE;
128}
#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 159 of file main.c.

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

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 167 of file main.c.

168{
170}
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{
49 return CONTAINING_RECORD(iface, wmiutils_cf, IClassFactory_iface);
50}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

◆ 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)
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}
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

◆ 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:114
#define S_OK
Definition: intsafe.h:52

◆ 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{
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}
const GUID IID_IUnknown
const GUID IID_IClassFactory
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ 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.

◆ 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_CreateInstance(IClassFactory *iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
Definition: main.c:75
static ULONG WINAPI wmiutils_cf_Release(IClassFactory *iface)
Definition: main.c:70
static ULONG WINAPI wmiutils_cf_AddRef(IClassFactory *iface)
Definition: main.c:65
static HRESULT WINAPI wmiutils_cf_LockServer(IClassFactory *iface, BOOL dolock)
Definition: main.c:98
static HRESULT WINAPI wmiutils_cf_QueryInterface(IClassFactory *iface, REFIID riid, LPVOID *ppobj)
Definition: main.c:52

Definition at line 104 of file main.c.