ReactOS 0.4.16-dev-109-gf4cb10f
netcfgx.c File Reference
#include "precomp.h"
#include <olectl.h>
Include dependency graph for netcfgx.c:

Go to the source code of this file.

Functions

BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
 
HRESULT WINAPI DllCanUnloadNow (void)
 
STDAPI DllRegisterServer (void)
 
STDAPI DllUnregisterServer (void)
 
STDAPI DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppv)
 

Variables

HINSTANCE netcfgx_hInstance
 
const GUID CLSID_TcpipConfigNotifyObject = {0xA907657F, 0x6FDF, 0x11D0, {0x8E, 0xFB, 0x00, 0xC0, 0x4F, 0xD9, 0x12, 0xB2}}
 
static INTERFACE_TABLE InterfaceTable []
 

Function Documentation

◆ DllCanUnloadNow()

HRESULT WINAPI DllCanUnloadNow ( void  )

Definition at line 55 of file netcfgx.c.

56{
57 return S_FALSE;
58}
#define S_FALSE
Definition: winerror.h:2357

◆ DllGetClassObject()

STDAPI DllGetClassObject ( REFCLSID  rclsid,
REFIID  riid,
LPVOID ppv 
)

Definition at line 104 of file netcfgx.c.

108{
109 UINT i;
111 IClassFactory * pcf = NULL;
112
113 if (!ppv)
114 return E_INVALIDARG;
115
116 *ppv = NULL;
117
118 for (i = 0; InterfaceTable[i].riid; i++)
119 {
120 if (IsEqualIID(InterfaceTable[i].riid, rclsid))
121 {
123 break;
124 }
125 }
126
127 if (!pcf)
128 {
130 }
131
132 hres = IClassFactory_QueryInterface(pcf, riid, ppv);
133 IClassFactory_Release(pcf);
134
135 return hres;
136}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
IClassFactory * IClassFactory_fnConstructor(LPFNCREATEINSTANCE lpfnCI, PLONG pcRefDll, REFIID riidInst)
Definition: classfactory.c:125
#define NULL
Definition: types.h:112
static INTERFACE_TABLE InterfaceTable[]
Definition: netcfgx.c:18
LPFNCREATEINSTANCE lpfnCI
Definition: shellole.c:61
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
HRESULT hres
Definition: protocol.c:465
unsigned int UINT
Definition: ndis.h:50
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
const GUID * riid
Definition: precomp.h:26
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hinstDLL,
DWORD  fdwReason,
LPVOID  fImpLoad 
)

Definition at line 36 of file netcfgx.c.

37{
38 switch (fdwReason)
39 {
41 netcfgx_hInstance = hinstDLL;
44 break;
45
46 default:
47 break;
48 }
49
50 return TRUE;
51}
VOID WINAPI InitCommonControls(void)
Definition: commctrl.c:870
#define TRUE
Definition: types.h:120
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
HINSTANCE netcfgx_hInstance
Definition: netcfgx.c:15

◆ DllRegisterServer()

STDAPI DllRegisterServer ( void  )

Definition at line 61 of file netcfgx.c.

62{
63 HKEY hKey, hSubKey;
64 LPOLESTR pStr;
65 WCHAR szName[MAX_PATH] = L"CLSID\\";
66
68 return SELFREG_E_CLASS;
69
70 wcscpy(&szName[6], pStr);
71 CoTaskMemFree(pStr);
72
74 return SELFREG_E_CLASS;
75
76 if (RegCreateKeyExW(hKey, L"InProcServer32", 0, NULL, 0, KEY_WRITE, NULL, &hSubKey, NULL) == ERROR_SUCCESS)
77 {
79 {
80 RegCloseKey(hSubKey);
82 return SELFREG_E_CLASS;
83 }
84 szName[(sizeof(szName)/sizeof(WCHAR))-1] = L'\0';
85 RegSetValueW(hSubKey, NULL, REG_SZ, szName, (wcslen(szName)+1) * sizeof(WCHAR));
86 RegSetValueExW(hSubKey, L"ThreadingModel", 0, REG_SZ, (LPBYTE)L"Both", 10);
87 RegCloseKey(hSubKey);
88 }
89
91 return S_OK;
92}
#define RegCloseKey(hKey)
Definition: registry.h:49
#define ERROR_SUCCESS
Definition: deptool.c:10
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1096
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4882
LONG WINAPI RegSetValueW(HKEY hKeyOriginal, LPCWSTR lpSubKey, DWORD dwType, LPCWSTR lpData, DWORD cbData)
Definition: reg.c:5000
#define MAX_PATH
Definition: compat.h:34
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:600
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
Definition: compobj.c:2412
FxAutoRegKey hKey
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
#define REG_SZ
Definition: layer.c:22
static LPOLESTR
Definition: stg_prop.c:27
EXTERN_C const GUID CLSID_CNetCfg
Definition: netcfgx.h:299
#define KEY_WRITE
Definition: nt_native.h:1031
#define L(x)
Definition: ntvdm.h:50
#define SELFREG_E_CLASS
Definition: olectl.h:261
static const WCHAR szName[]
Definition: powrprof.c:45
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
unsigned char * LPBYTE
Definition: typedefs.h:53
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ DllUnregisterServer()

STDAPI DllUnregisterServer ( void  )

Definition at line 95 of file netcfgx.c.

96{
97 //FIXME
98 // implement unregistering services
99 //
100 return S_OK;
101}

Variable Documentation

◆ CLSID_TcpipConfigNotifyObject

const GUID CLSID_TcpipConfigNotifyObject = {0xA907657F, 0x6FDF, 0x11D0, {0x8E, 0xFB, 0x00, 0xC0, 0x4F, 0xD9, 0x12, 0xB2}}

Definition at line 16 of file netcfgx.c.

◆ InterfaceTable

INTERFACE_TABLE InterfaceTable[]
static
Initial value:
=
{
{
},
{
},
{
}
}
const GUID CLSID_TcpipConfigNotifyObject
Definition: netcfgx.c:16
HRESULT WINAPI TcpipConfigNotify_Constructor(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv)
HRESULT WINAPI INetCfg_Constructor(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv)
Definition: netcfg_iface.c:865

Definition at line 18 of file netcfgx.c.

Referenced by DllGetClassObject().

◆ netcfgx_hInstance