ReactOS  0.4.14-dev-376-gaedba84
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 {
142  IClassFactory *cf = NULL;
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 }
static hnetcfg_cf fw_openport_cf
Definition: hnetcfg.c:116
static hnetcfg_cf upnpnat_cf
Definition: hnetcfg.c:118
static hnetcfg_cf fw_app_cf
Definition: hnetcfg.c:115
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
static hnetcfg_cf fw_policy2_cf
Definition: hnetcfg.c:117
IClassFactory IClassFactory_iface
Definition: hnetcfg.c:41
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
static hnetcfg_cf fw_manager_cf
Definition: hnetcfg.c:114

◆ 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;
128  case DLL_PROCESS_ATTACH:
129  instance = hInstDLL;
130  DisableThreadLibraryCalls(hInstDLL);
131  break;
132  case DLL_PROCESS_DETACH:
133  if (reserved) break;
134  release_typelib();
135  break;
136  }
137  return TRUE;
138 }
#define TRUE
Definition: types.h:120
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
#define DLL_PROCESS_ATTACH
Definition: compat.h:120
r reserved
Definition: btrfs.c:2865
#define DLL_PROCESS_DETACH
Definition: compat.h:119
#define TRACE(s)
Definition: solgame.cpp:4
void release_typelib(void)
Definition: apps.c:159
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
static HINSTANCE instance
Definition: hnetcfg.c:35

◆ 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
static HINSTANCE instance
Definition: hnetcfg.c:35

◆ 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)
85  return CLASS_E_NOAGGREGATION;
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 }
REFIID riid
Definition: precomp.h:44
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
static hnetcfg_cf * impl_from_IClassFactory(IClassFactory *iface)
Definition: hnetcfg.c:45
LONG HRESULT
Definition: typedefs.h:77
#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:110
#define S_OK
Definition: intsafe.h:59

◆ 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 {
52  if (IsEqualGUID(riid, &IID_IUnknown) ||
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 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_guid
Definition: kernel32.h:35
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
const GUID IID_IClassFactory

◆ 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 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

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_QueryInterface(IClassFactory *iface, REFIID riid, LPVOID *ppobj)
Definition: hnetcfg.c:50
static HRESULT WINAPI hnetcfg_cf_CreateInstance(IClassFactory *iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
Definition: hnetcfg.c:73

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().