ReactOS 0.4.17-dev-966-gf06eace
main.c
Go to the documentation of this file.
1/*
2 * Copyright 2009 Hans Leidekker for CodeWeavers
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19#include <stdarg.h>
20
21#define COBJMACROS
22
23#include "windef.h"
24#include "winbase.h"
25#include "winuser.h"
26#include "initguid.h"
27#include "objbase.h"
28#include "wbemcli.h"
29#include "wmiutils.h"
30#include "rpcproxy.h"
31
32#include "wine/debug.h"
33#include "wmiutils_private.h"
34
36
37typedef HRESULT (*fnCreateInstance)( LPVOID *ppObj );
38
39typedef struct
40{
44
46{
47 return CONTAINING_RECORD(iface, wmiutils_cf, IClassFactory_iface);
48}
49
51{
54 {
55 IClassFactory_AddRef( iface );
56 *ppobj = iface;
57 return S_OK;
58 }
59 FIXME("interface %s not implemented\n", debugstr_guid(riid));
60 return E_NOINTERFACE;
61}
62
64{
65 return 2;
66}
67
69{
70 return 1;
71}
72
74 REFIID riid, LPVOID *ppobj )
75{
77 HRESULT r;
79
80 TRACE("%p %s %p\n", pOuter, debugstr_guid(riid), ppobj);
81
82 *ppobj = NULL;
83
84 if (pOuter)
86
87 r = This->pfnCreateInstance( (LPVOID *)&punk );
88 if (FAILED(r))
89 return r;
90
91 r = IUnknown_QueryInterface( punk, riid, ppobj );
92 IUnknown_Release( punk );
93 return r;
94}
95
97{
98 FIXME("(%p)->(%d)\n", iface, dolock);
99 return S_OK;
100}
101
102static const struct IClassFactoryVtbl wmiutils_cf_vtbl =
103{
109};
110
113
115{
117
118 TRACE("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv);
119
120 if (IsEqualGUID( rclsid, &CLSID_WbemStatusCode ))
121 {
123 }
124 else if (IsEqualGUID( rclsid, &CLSID_WbemDefPath ))
125 {
127 }
128 if (!cf) return CLASS_E_CLASSNOTAVAILABLE;
129 return IClassFactory_QueryInterface( cf, iid, ppv );
130}
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define FIXME(fmt,...)
Definition: precomp.h:53
const GUID IID_IUnknown
const GUID IID_IClassFactory
static LPVOID LPUNKNOWN
Definition: dinput.c:53
#define NULL
Definition: types.h:112
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
Definition: main.c:153
static IClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: main.c:49
static const struct IClassFactoryVtbl wmiutils_cf_vtbl
Definition: main.c:102
static HRESULT WINAPI wmiutils_cf_CreateInstance(IClassFactory *iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
Definition: main.c:73
static ULONG WINAPI wmiutils_cf_Release(IClassFactory *iface)
Definition: main.c:68
static ULONG WINAPI wmiutils_cf_AddRef(IClassFactory *iface)
Definition: main.c:63
static HRESULT WINAPI wmiutils_cf_LockServer(IClassFactory *iface, BOOL dolock)
Definition: main.c:96
static wmiutils_cf path_cf
Definition: main.c:112
static HRESULT WINAPI wmiutils_cf_QueryInterface(IClassFactory *iface, REFIID riid, LPVOID *ppobj)
Definition: main.c:50
static wmiutils_cf status_code_cf
Definition: main.c:111
HRESULT WbemPath_create(LPVOID *ppObj)
Definition: path.c:1293
unsigned int BOOL
Definition: ntddk_ex.h:94
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
HRESULT(* fnCreateInstance)(IUnknown *pUnkOuter, LPVOID *ppObj)
Definition: hnetcfg.c:35
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
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
#define REFCLSID
Definition: guiddef.h:117
_In_opt_ IUnknown * punk
Definition: shlwapi.h:158
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT WbemStatusCodeText_create(LPVOID *ppObj)
Definition: statuscode.c:129
IClassFactory IClassFactory_iface
Definition: main.c:41
fnCreateInstance pfnCreateInstance
Definition: main.c:42
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
#define HRESULT
Definition: msvc.h:7
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:3479
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:3771
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:3772