ReactOS  r76032
regsvr.c File Reference
#include "precomp.h"
Include dependency graph for regsvr.c:

Go to the source code of this file.

Classes

struct  regsvr_interface
 
struct  regsvr_coclass
 

Functions

static LSTATUS (WINAPI *pRegDeleteTreeW)(HKEY
 
static HRESULT register_interfaces (struct regsvr_interface const *list)
 
static HRESULT unregister_interfaces (struct regsvr_interface const *list)
 
static HRESULT register_coclasses (struct regsvr_coclass const *list)
 
static HRESULT unregister_coclasses (struct regsvr_coclass const *list)
 
static LONG register_key_guid (HKEY base, WCHAR const *name, GUID const *guid)
 
static LONG register_key_defvalueW (HKEY base, WCHAR const *name, WCHAR const *value)
 
static LONG register_key_defvalueA (HKEY base, WCHAR const *name, char const *value)
 
static LONG register_progid (WCHAR const *clsid, char const *progid, char const *curver_progid, char const *name, char const *extra)
 
HRESULT WINAPI DllRegisterServer (void)
 
HRESULT WINAPI DllUnregisterServer (void)
 

Variables

static LPCWSTR
 
static LPCSTR
 
static WCHAR const interface_keyname [10]
 
static WCHAR const base_ifa_keyname [14]
 
static WCHAR const num_methods_keyname [11]
 
static WCHAR const ps_clsid_keyname [15]
 
static WCHAR const ps_clsid32_keyname [17]
 
static WCHAR const clsid_keyname [6]
 
static WCHAR const curver_keyname [7]
 
static WCHAR const ips_keyname [13]
 
static WCHAR const ips32_keyname [15]
 
static WCHAR const progid_keyname [7]
 
static WCHAR const viprogid_keyname [25]
 
static char const tmodel_valuename [] = "ThreadingModel"
 
static GUID const CLSID_DirectSoundBufferConfig
 
static struct regsvr_coclass const coclass_list []
 
static struct regsvr_interface
const 
interface_list []
 

Function Documentation

HRESULT WINAPI DllRegisterServer ( void  )

Definition at line 484 of file regsvr.c.

485 {
486  HRESULT hr;
487 
489  if (SUCCEEDED(hr))
491  return hr;
492 }
static struct regsvr_interface const interface_list[]
Definition: regsvr.c:477
LONG HRESULT
Definition: typedefs.h:77
static struct regsvr_coclass const coclass_list[]
Definition: regsvr.c:433
static HRESULT register_interfaces(struct regsvr_interface const *list)
Definition: regsvr.c:111
static HRESULT register_coclasses(struct regsvr_coclass const *list)
Definition: regsvr.c:207
#define SUCCEEDED(hr)
Definition: intsafe.h:57
HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 497 of file regsvr.c.

498 {
499  HRESULT hr;
500 
501  HMODULE advapi32 = GetModuleHandleA("advapi32");
502  if (!advapi32) return E_FAIL;
503  pRegDeleteTreeA = (void *) GetProcAddress(advapi32, "RegDeleteTreeA");
504  pRegDeleteTreeW = (void *) GetProcAddress(advapi32, "RegDeleteTreeW");
505  if (!pRegDeleteTreeA || !pRegDeleteTreeW) return E_FAIL;
506 
508  if (SUCCEEDED(hr))
510  return hr;
511 }
static struct regsvr_interface const interface_list[]
Definition: regsvr.c:477
#define E_FAIL
Definition: ddrawi.h:102
LONG HRESULT
Definition: typedefs.h:77
static struct regsvr_coclass const coclass_list[]
Definition: regsvr.c:433
static HRESULT unregister_interfaces(struct regsvr_interface const *list)
Definition: regsvr.c:181
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:818
HANDLE HMODULE
Definition: typedefs.h:75
#define GetProcAddress(x, y)
Definition: compat.h:410
static HRESULT unregister_coclasses(struct regsvr_coclass const *list)
Definition: regsvr.c:289
#define SUCCEEDED(hr)
Definition: intsafe.h:57
static HRESULT register_coclasses ( struct regsvr_coclass const list)
static

Definition at line 207 of file regsvr.c.

Referenced by DllRegisterServer().

208 {
210  HKEY coclass_key;
211 
213  KEY_READ | KEY_WRITE, NULL, &coclass_key, NULL);
214  if (res != ERROR_SUCCESS) goto error_return;
215 
216  for (; res == ERROR_SUCCESS && list->clsid; ++list) {
217  WCHAR buf[39];
218  HKEY clsid_key;
219 
220  StringFromGUID2(list->clsid, buf, 39);
221  res = RegCreateKeyExW(coclass_key, buf, 0, NULL, 0,
222  KEY_READ | KEY_WRITE, NULL, &clsid_key, NULL);
223  if (res != ERROR_SUCCESS) goto error_close_coclass_key;
224 
225  if (list->name) {
226  res = RegSetValueExA(clsid_key, NULL, 0, REG_SZ,
227  (CONST BYTE*)(list->name),
228  strlen(list->name) + 1);
229  if (res != ERROR_SUCCESS) goto error_close_clsid_key;
230  }
231 
232  if (list->ips) {
233  res = register_key_defvalueA(clsid_key, ips_keyname, list->ips);
234  if (res != ERROR_SUCCESS) goto error_close_clsid_key;
235  }
236 
237  if (list->ips32) {
238  HKEY ips32_key;
239 
240  res = RegCreateKeyExW(clsid_key, ips32_keyname, 0, NULL, 0,
242  &ips32_key, NULL);
243  if (res != ERROR_SUCCESS) goto error_close_clsid_key;
244 
245  res = RegSetValueExA(ips32_key, NULL, 0, REG_SZ,
246  (CONST BYTE*)list->ips32,
247  lstrlenA(list->ips32) + 1);
248  if (res == ERROR_SUCCESS && list->ips32_tmodel)
249  res = RegSetValueExA(ips32_key, tmodel_valuename, 0, REG_SZ,
250  (CONST BYTE*)list->ips32_tmodel,
251  strlen(list->ips32_tmodel) + 1);
252  RegCloseKey(ips32_key);
253  if (res != ERROR_SUCCESS) goto error_close_clsid_key;
254  }
255 
256  if (list->progid) {
257  res = register_key_defvalueA(clsid_key, progid_keyname,
258  list->progid);
259  if (res != ERROR_SUCCESS) goto error_close_clsid_key;
260 
261  res = register_progid(buf, list->progid, NULL,
262  list->name, list->progid_extra);
263  if (res != ERROR_SUCCESS) goto error_close_clsid_key;
264  }
265 
266  if (list->viprogid) {
267  res = register_key_defvalueA(clsid_key, viprogid_keyname,
268  list->viprogid);
269  if (res != ERROR_SUCCESS) goto error_close_clsid_key;
270 
271  res = register_progid(buf, list->viprogid, list->progid,
272  list->name, list->progid_extra);
273  if (res != ERROR_SUCCESS) goto error_close_clsid_key;
274  }
275 
276  error_close_clsid_key:
277  RegCloseKey(clsid_key);
278  }
279 
280 error_close_coclass_key:
281  RegCloseKey(coclass_key);
282 error_return:
283  return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
284 }
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define ERROR_SUCCESS
Definition: deptool.c:10
static WCHAR const ips32_keyname[15]
Definition: regsvr.c:85
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define KEY_READ
Definition: nt_native.h:1023
__wchar_t WCHAR
Definition: xmlstorage.h:180
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static WCHAR const clsid_keyname[6]
Definition: regsvr.c:78
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:1094
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
static LONG register_progid(WCHAR const *clsid, char const *progid, char const *curver_progid, char const *name, char const *extra)
Definition: regsvr.c:380
smooth NULL
Definition: ftsmooth.c:557
static WCHAR const progid_keyname[7]
Definition: regsvr.c:88
static WCHAR const ips_keyname[13]
Definition: regsvr.c:82
#define CONST
Definition: compiler.h:170
#define KEY_WRITE
Definition: nt_native.h:1031
static LONG register_key_defvalueA(HKEY base, WCHAR const *name, char const *value)
Definition: regsvr.c:360
HANDLE HKEY
Definition: registry.h:24
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2299
Definition: _list.h:228
unsigned char BYTE
Definition: ntddk_ex.h:96
static WCHAR const viprogid_keyname[25]
Definition: regsvr.c:90
#define S_OK
Definition: intsafe.h:59
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
GLuint res
Definition: glext.h:9613
#define list
Definition: rosglue.h:35
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
static char const tmodel_valuename[]
Definition: regsvr.c:94
LONG WINAPI RegSetValueExA(HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWORD dwType, CONST BYTE *lpData, DWORD cbData)
Definition: reg.c:4831
#define REG_SZ
Definition: layer.c:22
static HRESULT register_interfaces ( struct regsvr_interface const list)
static

Definition at line 111 of file regsvr.c.

Referenced by DllRegisterServer().

112 {
114  HKEY interface_key;
115 
117  KEY_READ | KEY_WRITE, NULL, &interface_key, NULL);
118  if (res != ERROR_SUCCESS) goto error_return;
119 
120  for (; res == ERROR_SUCCESS && list->iid; ++list) {
121  WCHAR buf[39];
122  HKEY iid_key;
123 
124  StringFromGUID2(list->iid, buf, 39);
125  res = RegCreateKeyExW(interface_key, buf, 0, NULL, 0,
126  KEY_READ | KEY_WRITE, NULL, &iid_key, NULL);
127  if (res != ERROR_SUCCESS) goto error_close_interface_key;
128 
129  if (list->name) {
130  res = RegSetValueExA(iid_key, NULL, 0, REG_SZ,
131  (CONST BYTE*)(list->name),
132  strlen(list->name) + 1);
133  if (res != ERROR_SUCCESS) goto error_close_iid_key;
134  }
135 
136  if (list->base_iid) {
137  res = register_key_guid(iid_key, base_ifa_keyname, list->base_iid);
138  if (res != ERROR_SUCCESS) goto error_close_iid_key;
139  }
140 
141  if (0 <= list->num_methods) {
142  static WCHAR const fmt[3] = { '%', 'd', 0 };
143  HKEY key;
144 
145  res = RegCreateKeyExW(iid_key, num_methods_keyname, 0, NULL, 0,
146  KEY_READ | KEY_WRITE, NULL, &key, NULL);
147  if (res != ERROR_SUCCESS) goto error_close_iid_key;
148 
149  swprintf(buf, fmt, list->num_methods);
150  res = RegSetValueExW(key, NULL, 0, REG_SZ,
151  (CONST BYTE*)buf,
152  (lstrlenW(buf) + 1) * sizeof(WCHAR));
153  RegCloseKey(key);
154 
155  if (res != ERROR_SUCCESS) goto error_close_iid_key;
156  }
157 
158  if (list->ps_clsid) {
159  res = register_key_guid(iid_key, ps_clsid_keyname, list->ps_clsid);
160  if (res != ERROR_SUCCESS) goto error_close_iid_key;
161  }
162 
163  if (list->ps_clsid32) {
164  res = register_key_guid(iid_key, ps_clsid32_keyname, list->ps_clsid32);
165  if (res != ERROR_SUCCESS) goto error_close_iid_key;
166  }
167 
168  error_close_iid_key:
169  RegCloseKey(iid_key);
170  }
171 
172 error_close_interface_key:
173  RegCloseKey(interface_key);
174 error_return:
175  return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
176 }
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define ERROR_SUCCESS
Definition: deptool.c:10
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define KEY_READ
Definition: nt_native.h:1023
__wchar_t WCHAR
Definition: xmlstorage.h:180
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define lstrlenW
Definition: compat.h:407
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:1094
static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid)
Definition: regsvr.c:329
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:557
static WCHAR const interface_keyname[10]
Definition: regsvr.c:65
#define CONST
Definition: compiler.h:170
#define KEY_WRITE
Definition: nt_native.h:1031
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:4917
HANDLE HKEY
Definition: registry.h:24
static WCHAR const ps_clsid_keyname[15]
Definition: regsvr.c:72
#define swprintf(buf, format,...)
Definition: sprintf.c:56
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2299
HKEY key
Definition: reg.c:45
Definition: _list.h:228
unsigned char BYTE
Definition: ntddk_ex.h:96
#define S_OK
Definition: intsafe.h:59
static WCHAR const num_methods_keyname[11]
Definition: regsvr.c:70
static WCHAR const base_ifa_keyname[14]
Definition: regsvr.c:67
static WCHAR const ps_clsid32_keyname[17]
Definition: regsvr.c:75
GLuint res
Definition: glext.h:9613
#define list
Definition: rosglue.h:35
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
LONG WINAPI RegSetValueExA(HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWORD dwType, CONST BYTE *lpData, DWORD cbData)
Definition: reg.c:4831
Definition: dsound.c:958
#define REG_SZ
Definition: layer.c:22
static LONG register_key_defvalueA ( HKEY  base,
WCHAR const name,
char const value 
)
static

Definition at line 360 of file regsvr.c.

Referenced by register_coclasses(), and register_progid().

364 {
365  LONG res;
366  HKEY key;
367 
368  res = RegCreateKeyExW(base, name, 0, NULL, 0,
369  KEY_READ | KEY_WRITE, NULL, &key, NULL);
370  if (res != ERROR_SUCCESS) return res;
371  res = RegSetValueExA(key, NULL, 0, REG_SZ, (CONST BYTE*)value,
372  lstrlenA(value) + 1);
373  RegCloseKey(key);
374  return res;
375 }
Definition: get.c:139
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_READ
Definition: nt_native.h:1023
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:1094
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:557
#define CONST
Definition: compiler.h:170
#define KEY_WRITE
Definition: nt_native.h:1031
HANDLE HKEY
Definition: registry.h:24
HKEY key
Definition: reg.c:45
unsigned char BYTE
Definition: ntddk_ex.h:96
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
Definition: name.c:23
GLuint res
Definition: glext.h:9613
LONG WINAPI RegSetValueExA(HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWORD dwType, CONST BYTE *lpData, DWORD cbData)
Definition: reg.c:4831
#define REG_SZ
Definition: layer.c:22
static LONG register_key_defvalueW ( HKEY  base,
WCHAR const name,
WCHAR const value 
)
static

Definition at line 340 of file regsvr.c.

Referenced by register_key_guid(), and register_progid().

344 {
345  LONG res;
346  HKEY key;
347 
348  res = RegCreateKeyExW(base, name, 0, NULL, 0,
349  KEY_READ | KEY_WRITE, NULL, &key, NULL);
350  if (res != ERROR_SUCCESS) return res;
351  res = RegSetValueExW(key, NULL, 0, REG_SZ, (CONST BYTE*)value,
352  (lstrlenW(value) + 1) * sizeof(WCHAR));
353  RegCloseKey(key);
354  return res;
355 }
Definition: get.c:139
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_READ
Definition: nt_native.h:1023
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define lstrlenW
Definition: compat.h:407
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:1094
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:557
#define CONST
Definition: compiler.h:170
#define KEY_WRITE
Definition: nt_native.h:1031
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:4917
HANDLE HKEY
Definition: registry.h:24
HKEY key
Definition: reg.c:45
unsigned char BYTE
Definition: ntddk_ex.h:96
Definition: name.c:23
GLuint res
Definition: glext.h:9613
#define REG_SZ
Definition: layer.c:22
static LONG register_key_guid ( HKEY  base,
WCHAR const name,
GUID const guid 
)
static

Definition at line 329 of file regsvr.c.

Referenced by register_interfaces().

330 {
331  WCHAR buf[39];
332 
333  StringFromGUID2(guid, buf, 39);
334  return register_key_defvalueW(base, name, buf);
335 }
__wchar_t WCHAR
Definition: xmlstorage.h:180
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
const GUID * guid
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2299
static LONG register_key_defvalueW(HKEY base, WCHAR const *name, WCHAR const *value)
Definition: regsvr.c:340
Definition: name.c:23
static LONG register_progid ( WCHAR const clsid,
char const progid,
char const curver_progid,
char const name,
char const extra 
)
static

Definition at line 380 of file regsvr.c.

Referenced by register_coclasses().

386 {
387  LONG res;
388  HKEY progid_key;
389 
391  NULL, 0, KEY_READ | KEY_WRITE, NULL,
392  &progid_key, NULL);
393  if (res != ERROR_SUCCESS) return res;
394 
395  if (name) {
396  res = RegSetValueExA(progid_key, NULL, 0, REG_SZ,
397  (CONST BYTE*)name, strlen(name) + 1);
398  if (res != ERROR_SUCCESS) goto error_close_progid_key;
399  }
400 
401  if (clsid) {
402  res = register_key_defvalueW(progid_key, clsid_keyname, clsid);
403  if (res != ERROR_SUCCESS) goto error_close_progid_key;
404  }
405 
406  if (curver_progid) {
407  res = register_key_defvalueA(progid_key, curver_keyname,
408  curver_progid);
409  if (res != ERROR_SUCCESS) goto error_close_progid_key;
410  }
411 
412  if (extra) {
413  HKEY extra_key;
414 
415  res = RegCreateKeyExA(progid_key, extra, 0,
416  NULL, 0, KEY_READ | KEY_WRITE, NULL,
417  &extra_key, NULL);
418  if (res == ERROR_SUCCESS)
419  RegCloseKey(extra_key);
420  }
421 
422 error_close_progid_key:
423  RegCloseKey(progid_key);
424  return res;
425 }
static WCHAR const curver_keyname[7]
Definition: regsvr.c:80
#define ERROR_SUCCESS
Definition: deptool.c:10
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define KEY_READ
Definition: nt_native.h:1023
static WCHAR const clsid_keyname[6]
Definition: regsvr.c:78
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:557
#define CONST
Definition: compiler.h:170
#define KEY_WRITE
Definition: nt_native.h:1031
static LONG register_key_defvalueA(HKEY base, WCHAR const *name, char const *value)
Definition: regsvr.c:360
Definition: id3.c:18
HANDLE HKEY
Definition: registry.h:24
REFCLSID clsid
Definition: msctf.c:66
unsigned char BYTE
Definition: ntddk_ex.h:96
static LONG register_key_defvalueW(HKEY base, WCHAR const *name, WCHAR const *value)
Definition: regsvr.c:340
Definition: name.c:23
GLuint res
Definition: glext.h:9613
#define progid(str)
Definition: exdisp.idl:31
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
LONG WINAPI RegSetValueExA(HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWORD dwType, CONST BYTE *lpData, DWORD cbData)
Definition: reg.c:4831
LONG WINAPI RegCreateKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD Reserved, _In_ LPSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_ LPDWORD lpdwDisposition)
Definition: reg.c:1032
#define REG_SZ
Definition: layer.c:22
static HRESULT unregister_coclasses ( struct regsvr_coclass const list)
static

Definition at line 289 of file regsvr.c.

Referenced by DllUnregisterServer().

290 {
292  HKEY coclass_key;
293 
295  KEY_READ | KEY_WRITE, &coclass_key);
296  if (res == ERROR_FILE_NOT_FOUND) return S_OK;
297  if (res != ERROR_SUCCESS) goto error_return;
298 
299  for (; res == ERROR_SUCCESS && list->clsid; ++list) {
300  WCHAR buf[39];
301 
302  StringFromGUID2(list->clsid, buf, 39);
303  res = pRegDeleteTreeW(coclass_key, buf);
304  if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS;
305  if (res != ERROR_SUCCESS) goto error_close_coclass_key;
306 
307  if (list->progid) {
308  res = pRegDeleteTreeA(HKEY_CLASSES_ROOT, list->progid);
309  if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS;
310  if (res != ERROR_SUCCESS) goto error_close_coclass_key;
311  }
312 
313  if (list->viprogid) {
314  res = pRegDeleteTreeA(HKEY_CLASSES_ROOT, list->viprogid);
315  if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS;
316  if (res != ERROR_SUCCESS) goto error_close_coclass_key;
317  }
318  }
319 
320 error_close_coclass_key:
321  RegCloseKey(coclass_key);
322 error_return:
323  return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
324 }
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_READ
Definition: nt_native.h:1023
__wchar_t WCHAR
Definition: xmlstorage.h:180
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static WCHAR const clsid_keyname[6]
Definition: regsvr.c:78
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define KEY_WRITE
Definition: nt_native.h:1031
HANDLE HKEY
Definition: registry.h:24
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2299
Definition: _list.h:228
#define S_OK
Definition: intsafe.h:59
GLuint res
Definition: glext.h:9613
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3381
#define list
Definition: rosglue.h:35
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
static HRESULT unregister_interfaces ( struct regsvr_interface const list)
static

Definition at line 181 of file regsvr.c.

Referenced by DllUnregisterServer().

182 {
184  HKEY interface_key;
185 
187  KEY_READ | KEY_WRITE, &interface_key);
188  if (res == ERROR_FILE_NOT_FOUND) return S_OK;
189  if (res != ERROR_SUCCESS) goto error_return;
190 
191  for (; res == ERROR_SUCCESS && list->iid; ++list) {
192  WCHAR buf[39];
193 
194  StringFromGUID2(list->iid, buf, 39);
195  res = pRegDeleteTreeW(interface_key, buf);
196  if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS;
197  }
198 
199  RegCloseKey(interface_key);
200 error_return:
201  return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
202 }
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_READ
Definition: nt_native.h:1023
__wchar_t WCHAR
Definition: xmlstorage.h:180
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
static WCHAR const interface_keyname[10]
Definition: regsvr.c:65
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define KEY_WRITE
Definition: nt_native.h:1031
HANDLE HKEY
Definition: registry.h:24
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2299
Definition: _list.h:228
#define S_OK
Definition: intsafe.h:59
GLuint res
Definition: glext.h:9613
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3381
#define list
Definition: rosglue.h:35
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10

Variable Documentation

WCHAR const base_ifa_keyname[14]
static
Initial value:
= {
'B', 'a', 's', 'e', 'I', 'n', 't', 'e', 'r', 'f', 'a', 'c',
'e', 0 }

Definition at line 67 of file regsvr.c.

Referenced by register_interfaces().

GUID const CLSID_DirectSoundBufferConfig
static
Initial value:
= {
0xB2F586D4, 0x5558, 0x49D1, {0xA0,0x7B,0x32,0x49,0xDB,0xBB,0x33,0xC2} }

Definition at line 430 of file regsvr.c.

WCHAR const clsid_keyname[6]
static
Initial value:
= {
'C', 'L', 'S', 'I', 'D', 0 }

Definition at line 78 of file regsvr.c.

Referenced by register_coclasses(), register_progid(), and unregister_coclasses().

struct regsvr_coclass const coclass_list[]
static

Definition at line 433 of file regsvr.c.

WCHAR const curver_keyname[7]
static
Initial value:
= {
'C', 'u', 'r', 'V', 'e', 'r', 0 }

Definition at line 80 of file regsvr.c.

Referenced by register_progid().

WCHAR const interface_keyname[10]
static
Initial value:
= {
'I', 'n', 't', 'e', 'r', 'f', 'a', 'c', 'e', 0 }

Definition at line 65 of file regsvr.c.

Referenced by register_interfaces(), and unregister_interfaces().

struct regsvr_interface const interface_list[]
static
Initial value:
= {
{ NULL }
}
smooth NULL
Definition: ftsmooth.c:557

Definition at line 477 of file regsvr.c.

Referenced by RunningObjectTableImpl_EnumRunning().

WCHAR const ips32_keyname[15]
static
Initial value:
= {
'I', 'n', 'P', 'r', 'o', 'c', 'S', 'e', 'r', 'v', 'e', 'r',
'3', '2', 0 }

Definition at line 85 of file regsvr.c.

Referenced by register_coclasses().

WCHAR const ips_keyname[13]
static
Initial value:
= {
'I', 'n', 'P', 'r', 'o', 'c', 'S', 'e', 'r', 'v', 'e', 'r',
0 }

Definition at line 82 of file regsvr.c.

Referenced by register_coclasses().

Definition at line 24 of file regsvr.c.

Definition at line 23 of file regsvr.c.

WCHAR const num_methods_keyname[11]
static
Initial value:
= {
'N', 'u', 'm', 'M', 'e', 't', 'h', 'o', 'd', 's', 0 }

Definition at line 70 of file regsvr.c.

Referenced by register_interfaces().

WCHAR const progid_keyname[7]
static
Initial value:
= {
'P', 'r', 'o', 'g', 'I', 'D', 0 }

Definition at line 88 of file regsvr.c.

Referenced by register_coclasses().

WCHAR const ps_clsid32_keyname[17]
static
Initial value:
= {
'P', 'r', 'o', 'x', 'y', 'S', 't', 'u', 'b', 'C', 'l', 's',
'i', 'd', '3', '2', 0 }

Definition at line 75 of file regsvr.c.

Referenced by register_interfaces().

WCHAR const ps_clsid_keyname[15]
static
Initial value:
= {
'P', 'r', 'o', 'x', 'y', 'S', 't', 'u', 'b', 'C', 'l', 's',
'i', 'd', 0 }

Definition at line 72 of file regsvr.c.

Referenced by register_interfaces().

char const tmodel_valuename[] = "ThreadingModel"
static

Definition at line 94 of file regsvr.c.

Referenced by register_coclasses().

WCHAR const viprogid_keyname[25]
static
Initial value:
= {
'V', 'e', 'r', 's', 'i', 'o', 'n', 'I', 'n', 'd', 'e', 'p',
'e', 'n', 'd', 'e', 'n', 't', 'P', 'r', 'o', 'g', 'I', 'D',
0 }

Definition at line 90 of file regsvr.c.

Referenced by register_coclasses().