ReactOS 0.4.15-dev-7834-g00c4b3d
main.c
Go to the documentation of this file.
1/*
2 *
3 * Copyright 2009 Austin English
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18 */
19
20#include <stdarg.h>
21
22#define COBJMACROS
23
24#include "windef.h"
25#include "winbase.h"
26#include "objbase.h"
27#include "wbemcli.h"
28#include "wbemprov.h"
29#include "rpcproxy.h"
30
31#include "wbemprox_private.h"
32#include "wine/debug.h"
33
35
37
39
40typedef HRESULT (*fnCreateInstance)( LPVOID *ppObj );
41
42typedef struct
43{
47
49{
50 return CONTAINING_RECORD(iface, wbemprox_cf, IClassFactory_iface);
51}
52
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}
65
67{
68 return 2;
69}
70
72{
73 return 1;
74}
75
77 REFIID riid, LPVOID *ppobj )
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}
98
100{
101 FIXME("(%p)->(%d)\n", iface, dolock);
102 return S_OK;
103}
104
105static const struct IClassFactoryVtbl wbemprox_cf_vtbl =
106{
112};
113
115
117{
118
119 switch (fdwReason)
120 {
122 instance = hinstDLL;
125 break;
126 }
127
128 return TRUE;
129}
130
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}
145
146/***********************************************************************
147 * DllCanUnloadNow (WBEMPROX.@)
148 */
150{
151 return S_FALSE;
152}
153
154/***********************************************************************
155 * DllRegisterServer (WBEMPROX.@)
156 */
158{
160}
161
162/***********************************************************************
163 * DllUnregisterServer (WBEMPROX.@)
164 */
166{
168}
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
const GUID IID_IUnknown
const GUID IID_IClassFactory
#define FIXME(fmt,...)
Definition: debug.h:111
void init_table_list(void)
Definition: builtin.c:4605
Definition: list.h:37
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
Definition: main.c:26
HRESULT WINAPI DllRegisterServer(void)
Definition: main.c:212
static HINSTANCE instance
Definition: main.c:40
HRESULT WINAPI DllUnregisterServer(void)
Definition: main.c:220
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
Definition: main.c:166
HRESULT WINAPI DllCanUnloadNow(void)
Definition: main.c:204
static IClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: main.c:63
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
static const struct IClassFactoryVtbl wbemprox_cf_vtbl
Definition: main.c:105
static ULONG WINAPI wbemprox_cf_AddRef(IClassFactory *iface)
Definition: main.c:66
static wbemprox_cf wbem_locator_cf
Definition: main.c:114
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
struct list * table_list
Definition: main.c:38
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
HRESULT(* fnCreateInstance)(IUnknown *pUnkOuter, LPVOID *ppObj)
Definition: hnetcfg.c:37
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_guid
Definition: kernel32.h:35
static IN DWORD IN LPVOID lpvReserved
static LPUNKNOWN
Definition: ndr_ole.c:49
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
#define REFCLSID
Definition: guiddef.h:117
HRESULT __wine_unregister_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:110
HRESULT __wine_register_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:98
#define TRACE(s)
Definition: solgame.cpp:4
IClassFactory IClassFactory_iface
Definition: main.c:44
fnCreateInstance pfnCreateInstance
Definition: main.c:45
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
HRESULT WbemLocator_create(LPVOID *ppObj)
Definition: wbemlocator.c:212
#define HRESULT
Definition: msvc.h:7
#define WINAPI
Definition: msvc.h:6
#define S_FALSE
Definition: winerror.h:2357
#define E_NOINTERFACE
Definition: winerror.h:2364
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663