ReactOS 0.4.16-dev-197-g92996da
netcfgx.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Configuration of network devices
4 * FILE: dll/win32/netcfgx/netcfgx.c
5 * PURPOSE: Network devices installer
6 *
7 * PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.org)
8 */
9
10#include "precomp.h"
11
12#include <olectl.h>
13
14
16const GUID CLSID_TcpipConfigNotifyObject = {0xA907657F, 0x6FDF, 0x11D0, {0x8E, 0xFB, 0x00, 0xC0, 0x4F, 0xD9, 0x12, 0xB2}};
17
19{
20 {
23 },
24 {
27 },
28 {
29 NULL,
30 NULL
31 }
32};
33
34BOOL
36DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
37{
38 switch (fdwReason)
39 {
41 netcfgx_hInstance = hinstDLL;
44 break;
45
46 default:
47 break;
48 }
49
50 return TRUE;
51}
52
56{
57 return S_FALSE;
58}
59
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}
93
96{
97 //FIXME
98 // implement unregistering services
99 //
100 return S_OK;
101}
102
103STDAPI
105 REFCLSID rclsid,
106 REFIID riid,
107 LPVOID* ppv)
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}
DWORD LPVOID fImpLoad
Definition: misc.cpp:142
#define STDAPI
Definition: basetyps.h:41
#define RegCloseKey(hKey)
Definition: registry.h:49
VOID WINAPI InitCommonControls(void)
Definition: commctrl.c:870
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define ERROR_SUCCESS
Definition: deptool.c:10
IClassFactory * IClassFactory_fnConstructor(LPFNCREATEINSTANCE lpfnCI, PLONG pcRefDll, REFIID riidInst)
Definition: classfactory.c:125
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
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 DLL_PROCESS_ATTACH
Definition: compat.h:131
#define MAX_PATH
Definition: compat.h:34
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:600
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
static INTERFACE_TABLE InterfaceTable[]
Definition: netcfgx.c:18
STDAPI DllRegisterServer(void)
Definition: netcfgx.c:61
const GUID CLSID_TcpipConfigNotifyObject
Definition: netcfgx.c:16
STDAPI DllUnregisterServer(void)
Definition: netcfgx.c:95
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
Definition: netcfgx.c:36
STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
Definition: netcfgx.c:104
HINSTANCE netcfgx_hInstance
Definition: netcfgx.c:15
HRESULT WINAPI DllCanUnloadNow(void)
Definition: netcfgx.c:55
HRESULT WINAPI TcpipConfigNotify_Constructor(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv)
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
Definition: compobj.c:2412
LPFNCREATEINSTANCE lpfnCI
Definition: shellole.c:61
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
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
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
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 REG_SZ
Definition: layer.c:22
HRESULT hres
Definition: protocol.c:465
static LPOLESTR
Definition: stg_prop.c:27
unsigned int UINT
Definition: ndis.h:50
HRESULT WINAPI INetCfg_Constructor(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv)
Definition: netcfg_iface.c:865
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
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
#define REFCLSID
Definition: guiddef.h:117
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
const GUID * riid
Definition: precomp.h:26
unsigned char * LPBYTE
Definition: typedefs.h:53
#define WINAPI
Definition: msvc.h:6
#define S_FALSE
Definition: winerror.h:2357
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
__wchar_t WCHAR
Definition: xmlstorage.h:180