ReactOS 0.4.15-dev-7953-g1f49173
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_cfimpl_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)
 
HRESULT WINAPI DllCanUnloadNow (void)
 
HRESULT WINAPI DllRegisterServer (void)
 
HRESULT WINAPI DllUnregisterServer (void)
 

Variables

static HINSTANCE instance
 
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 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 37 of file hnetcfg.c.

Function Documentation

◆ DllCanUnloadNow()

HRESULT WINAPI DllCanUnloadNow ( void  )

Definition at line 171 of file hnetcfg.c.

172{
173 return S_FALSE;
174}
#define S_FALSE
Definition: winerror.h:2357

◆ DllGetClassObject()

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

Definition at line 140 of file hnetcfg.c.

141{
143
144 TRACE("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv);
145
146 if (IsEqualGUID( rclsid, &CLSID_NetFwMgr ))
147 {
149 }
150 else if (IsEqualGUID( rclsid, &CLSID_NetFwAuthorizedApplication ))
151 {
153 }
154 else if (IsEqualGUID( rclsid, &CLSID_NetFwOpenPort ))
155 {
157 }
158 else if (IsEqualGUID( rclsid, &CLSID_NetFwPolicy2 ))
159 {
161 }
162 else if (IsEqualGUID( rclsid, &CLSID_UPnPNAT ))
163 {
165 }
166
167 if (!cf) return CLASS_E_CLASSNOTAVAILABLE;
168 return IClassFactory_QueryInterface( cf, iid, ppv );
169}
#define NULL
Definition: types.h:112
static hnetcfg_cf fw_policy2_cf
Definition: hnetcfg.c:117
static hnetcfg_cf fw_app_cf
Definition: hnetcfg.c:115
static hnetcfg_cf fw_openport_cf
Definition: hnetcfg.c:116
static hnetcfg_cf fw_manager_cf
Definition: hnetcfg.c:114
static hnetcfg_cf upnpnat_cf
Definition: hnetcfg.c:118
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:41
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663

◆ DllMain()

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

Definition at line 121 of file hnetcfg.c.

122{
123 TRACE("(0x%p, %d, %p)\n", hInstDLL, fdwReason, reserved);
124
125 switch(fdwReason) {
126 case DLL_WINE_PREATTACH:
127 return FALSE;
129 instance = hInstDLL;
131 break;
133 if (reserved) break;
135 break;
136 }
137 return TRUE;
138}
void release_typelib(void)
Definition: apps.c:159
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#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
static HINSTANCE instance
Definition: hnetcfg.c:35

◆ DllRegisterServer()

HRESULT WINAPI DllRegisterServer ( void  )

Definition at line 179 of file hnetcfg.c.

180{
182}
HRESULT __wine_register_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:98

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 187 of file hnetcfg.c.

188{
190}
HRESULT __wine_unregister_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:110

◆ hnetcfg_cf_AddRef()

static ULONG WINAPI hnetcfg_cf_AddRef ( IClassFactory iface)
static

Definition at line 63 of file hnetcfg.c.

64{
65 return 2;
66}

◆ hnetcfg_cf_CreateInstance()

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

Definition at line 73 of file hnetcfg.c.

75{
77 HRESULT r;
78 IUnknown *punk;
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( pOuter, (LPVOID *)&punk );
88 if (FAILED(r))
89 return r;
90
91 r = IUnknown_QueryInterface( punk, riid, ppobj );
92 if (FAILED(r))
93 return r;
94
95 IUnknown_Release( punk );
96 return r;
97}
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static hnetcfg_cf * impl_from_IClassFactory(IClassFactory *iface)
Definition: hnetcfg.c:45
REFIID riid
Definition: atlbase.h:39
#define FAILED(hr)
Definition: intsafe.h:51
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662

◆ hnetcfg_cf_LockServer()

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

Definition at line 99 of file hnetcfg.c.

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

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

◆ hnetcfg_cf_Release()

static ULONG WINAPI hnetcfg_cf_Release ( IClassFactory iface)
static

Definition at line 68 of file hnetcfg.c.

69{
70 return 1;
71}

◆ impl_from_IClassFactory()

static hnetcfg_cf * impl_from_IClassFactory ( IClassFactory iface)
inlinestatic

Definition at line 45 of file hnetcfg.c.

46{
47 return CONTAINING_RECORD(iface, hnetcfg_cf, IClassFactory_iface);
48}
#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 115 of file hnetcfg.c.

Referenced by DllGetClassObject().

◆ fw_manager_cf

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

Definition at line 114 of file hnetcfg.c.

Referenced by DllGetClassObject().

◆ fw_openport_cf

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

Definition at line 116 of file hnetcfg.c.

Referenced by DllGetClassObject().

◆ fw_policy2_cf

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

Definition at line 117 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:63
static HRESULT WINAPI hnetcfg_cf_LockServer(IClassFactory *iface, BOOL dolock)
Definition: hnetcfg.c:99
static ULONG WINAPI hnetcfg_cf_Release(IClassFactory *iface)
Definition: hnetcfg.c:68
static HRESULT WINAPI hnetcfg_cf_CreateInstance(IClassFactory *iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
Definition: hnetcfg.c:73
static HRESULT WINAPI hnetcfg_cf_QueryInterface(IClassFactory *iface, REFIID riid, LPVOID *ppobj)
Definition: hnetcfg.c:50

Definition at line 105 of file hnetcfg.c.

◆ instance

HINSTANCE instance
static

Definition at line 35 of file hnetcfg.c.

Referenced by DllMain(), DllRegisterServer(), and DllUnregisterServer().

◆ upnpnat_cf

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

Definition at line 118 of file hnetcfg.c.

Referenced by DllGetClassObject().