ReactOS 0.4.17-dev-966-gf06eace
hnetcfg.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "objbase.h"
#include "rpcproxy.h"
#include "netfw.h"
#include "natupnp.h"
#include "wine/debug.h"
#include "hnetcfg_private.h"
Include dependency graph for hnetcfg.c:

Go to the source code of this file.

Classes

struct  hnetcfg_cf
 

Macros

#define COBJMACROS
 

Typedefs

typedef HRESULT(* fnCreateInstance) (IUnknown *pUnkOuter, LPVOID *ppObj)
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (hnetcfg)
 
static hnetcfg_cf * impl_from_IClassFactory (IClassFactory *iface)
 
static HRESULT WINAPI hnetcfg_cf_QueryInterface (IClassFactory *iface, REFIID riid, LPVOID *ppobj)
 
static ULONG WINAPI hnetcfg_cf_AddRef (IClassFactory *iface)
 
static ULONG WINAPI hnetcfg_cf_Release (IClassFactory *iface)
 
static HRESULT WINAPI hnetcfg_cf_CreateInstance (IClassFactory *iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
 
static HRESULT WINAPI hnetcfg_cf_LockServer (IClassFactory *iface, BOOL dolock)
 
BOOL WINAPI DllMain (HINSTANCE hInstDLL, DWORD fdwReason, LPVOID reserved)
 
HRESULT WINAPI DllGetClassObject (REFCLSID rclsid, REFIID iid, LPVOID *ppv)
 

Variables

static const struct IClassFactoryVtbl hnetcfg_cf_vtbl
 
static hnetcfg_cf fw_manager_cf = { { &hnetcfg_cf_vtbl }, NetFwMgr_create }
 
static hnetcfg_cf fw_app_cf = { { &hnetcfg_cf_vtbl }, NetFwAuthorizedApplication_create }
 
static hnetcfg_cf fw_openport_cf = { { &hnetcfg_cf_vtbl }, NetFwOpenPort_create }
 
static hnetcfg_cf fw_policy2_cf = { { &hnetcfg_cf_vtbl }, NetFwPolicy2_create }
 
static hnetcfg_cf fw_rule_cf = { { &hnetcfg_cf_vtbl }, NetFwRule_create }
 
static hnetcfg_cf upnpnat_cf = { { &hnetcfg_cf_vtbl }, IUPnPNAT_create }
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 21 of file hnetcfg.c.

Typedef Documentation

◆ fnCreateInstance

typedef HRESULT(* fnCreateInstance) (IUnknown *pUnkOuter, LPVOID *ppObj)

Definition at line 35 of file hnetcfg.c.

Function Documentation

◆ DllGetClassObject()

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

Definition at line 135 of file hnetcfg.c.

136{
138
139 TRACE("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv);
140
141 if (IsEqualGUID( rclsid, &CLSID_NetFwMgr ))
142 {
144 }
145 else if (IsEqualGUID( rclsid, &CLSID_NetFwAuthorizedApplication ))
146 {
148 }
149 else if (IsEqualGUID( rclsid, &CLSID_NetFwOpenPort ))
150 {
152 }
153 else if (IsEqualGUID( rclsid, &CLSID_NetFwPolicy2 ))
154 {
156 }
157 else if (IsEqualGUID( rclsid, &CLSID_NetFwRule ))
158 {
160 }
161 else if (IsEqualGUID( rclsid, &CLSID_UPnPNAT ))
162 {
164 }
165
166 if (!cf) return CLASS_E_CLASSNOTAVAILABLE;
167 return IClassFactory_QueryInterface( cf, iid, ppv );
168}
#define NULL
Definition: types.h:112
static hnetcfg_cf fw_policy2_cf
Definition: hnetcfg.c:115
static hnetcfg_cf fw_app_cf
Definition: hnetcfg.c:113
static hnetcfg_cf fw_rule_cf
Definition: hnetcfg.c:116
static hnetcfg_cf fw_openport_cf
Definition: hnetcfg.c:114
static hnetcfg_cf fw_manager_cf
Definition: hnetcfg.c:112
static hnetcfg_cf upnpnat_cf
Definition: hnetcfg.c:117
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: hnetcfg.c:39
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:3772

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hInstDLL,
DWORD  fdwReason,
LPVOID  reserved 
)

Definition at line 119 of file hnetcfg.c.

120{
121 TRACE("(0x%p, %ld, %p)\n", hInstDLL, fdwReason, reserved);
122
123 switch(fdwReason) {
126 break;
128 if (reserved) break;
130 break;
131 }
132 return TRUE;
133}
static DWORD const fdwReason
void release_typelib(void)
Definition: apps.c:160
#define TRUE
Definition: types.h:120
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define DLL_PROCESS_DETACH
Definition: compat.h:130
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
r reserved
Definition: btrfs.c:3006

◆ hnetcfg_cf_AddRef()

static ULONG WINAPI hnetcfg_cf_AddRef ( IClassFactory *  iface)
static

Definition at line 61 of file hnetcfg.c.

62{
63 return 2;
64}

◆ hnetcfg_cf_CreateInstance()

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

Definition at line 71 of file hnetcfg.c.

73{
75 HRESULT r;
77
78 TRACE("%p %s %p\n", pOuter, debugstr_guid(riid), ppobj);
79
80 *ppobj = NULL;
81
82 if (pOuter)
84
85 r = This->pfnCreateInstance( pOuter, (LPVOID *)&punk );
86 if (FAILED(r))
87 return r;
88
89 r = IUnknown_QueryInterface( punk, riid, ppobj );
90 if (FAILED(r))
91 return r;
92
93 IUnknown_Release( punk );
94 return r;
95}
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static hnetcfg_cf * impl_from_IClassFactory(IClassFactory *iface)
Definition: hnetcfg.c:43
REFIID riid
Definition: atlbase.h:39
#define FAILED(hr)
Definition: intsafe.h:51
_In_opt_ IUnknown * punk
Definition: shlwapi.h:158
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:3771

◆ hnetcfg_cf_LockServer()

static HRESULT WINAPI hnetcfg_cf_LockServer ( IClassFactory *  iface,
BOOL  dolock 
)
static

Definition at line 97 of file hnetcfg.c.

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

◆ hnetcfg_cf_QueryInterface()

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

Definition at line 48 of file hnetcfg.c.

49{
52 {
53 IClassFactory_AddRef( iface );
54 *ppobj = iface;
55 return S_OK;
56 }
57 FIXME("interface %s not implemented\n", debugstr_guid(riid));
58 return E_NOINTERFACE;
59}
const GUID IID_IUnknown
const GUID IID_IClassFactory
#define E_NOINTERFACE
Definition: winerror.h:3479

◆ hnetcfg_cf_Release()

static ULONG WINAPI hnetcfg_cf_Release ( IClassFactory *  iface)
static

Definition at line 66 of file hnetcfg.c.

67{
68 return 1;
69}

◆ impl_from_IClassFactory()

static hnetcfg_cf * impl_from_IClassFactory ( IClassFactory *  iface)
inlinestatic

Definition at line 43 of file hnetcfg.c.

44{
45 return CONTAINING_RECORD(iface, hnetcfg_cf, IClassFactory_iface);
46}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by hnetcfg_cf_CreateInstance().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( hnetcfg  )

Variable Documentation

◆ fw_app_cf

Definition at line 113 of file hnetcfg.c.

Referenced by DllGetClassObject().

◆ fw_manager_cf

hnetcfg_cf fw_manager_cf = { { &hnetcfg_cf_vtbl }, NetFwMgr_create }
static

Definition at line 112 of file hnetcfg.c.

Referenced by DllGetClassObject().

◆ fw_openport_cf

hnetcfg_cf fw_openport_cf = { { &hnetcfg_cf_vtbl }, NetFwOpenPort_create }
static

Definition at line 114 of file hnetcfg.c.

Referenced by DllGetClassObject().

◆ fw_policy2_cf

hnetcfg_cf fw_policy2_cf = { { &hnetcfg_cf_vtbl }, NetFwPolicy2_create }
static

Definition at line 115 of file hnetcfg.c.

Referenced by DllGetClassObject().

◆ fw_rule_cf

hnetcfg_cf fw_rule_cf = { { &hnetcfg_cf_vtbl }, NetFwRule_create }
static

Definition at line 116 of file hnetcfg.c.

Referenced by DllGetClassObject().

◆ hnetcfg_cf_vtbl

const struct IClassFactoryVtbl hnetcfg_cf_vtbl
static
Initial value:
=
{
}
static ULONG WINAPI hnetcfg_cf_AddRef(IClassFactory *iface)
Definition: hnetcfg.c:61
static HRESULT WINAPI hnetcfg_cf_LockServer(IClassFactory *iface, BOOL dolock)
Definition: hnetcfg.c:97
static ULONG WINAPI hnetcfg_cf_Release(IClassFactory *iface)
Definition: hnetcfg.c:66
static HRESULT WINAPI hnetcfg_cf_CreateInstance(IClassFactory *iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
Definition: hnetcfg.c:71
static HRESULT WINAPI hnetcfg_cf_QueryInterface(IClassFactory *iface, REFIID riid, LPVOID *ppobj)
Definition: hnetcfg.c:48

Definition at line 103 of file hnetcfg.c.

◆ upnpnat_cf

hnetcfg_cf upnpnat_cf = { { &hnetcfg_cf_vtbl }, IUPnPNAT_create }
static

Definition at line 117 of file hnetcfg.c.

Referenced by DllGetClassObject().