dsound: Runtime link to advapi32.RegDeleteTree.
This commit is contained in:
parent
63c06b4b38
commit
beaa1cde64
|
@ -34,6 +34,9 @@
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(dsound);
|
WINE_DEFAULT_DEBUG_CHANNEL(dsound);
|
||||||
|
|
||||||
|
static typeof(RegDeleteTreeW) * pRegDeleteTreeW;
|
||||||
|
static typeof(RegDeleteTreeA) * pRegDeleteTreeA;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Near the bottom of this file are the exported DllRegisterServer and
|
* Near the bottom of this file are the exported DllRegisterServer and
|
||||||
* DllUnregisterServer, which make all this worthwhile.
|
* DllUnregisterServer, which make all this worthwhile.
|
||||||
|
@ -203,7 +206,7 @@ static HRESULT unregister_interfaces(struct regsvr_interface const *list)
|
||||||
WCHAR buf[39];
|
WCHAR buf[39];
|
||||||
|
|
||||||
StringFromGUID2(list->iid, buf, 39);
|
StringFromGUID2(list->iid, buf, 39);
|
||||||
res = RegDeleteTreeW(interface_key, buf);
|
res = pRegDeleteTreeW(interface_key, buf);
|
||||||
if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS;
|
if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -311,18 +314,18 @@ static HRESULT unregister_coclasses(struct regsvr_coclass const *list)
|
||||||
WCHAR buf[39];
|
WCHAR buf[39];
|
||||||
|
|
||||||
StringFromGUID2(list->clsid, buf, 39);
|
StringFromGUID2(list->clsid, buf, 39);
|
||||||
res = RegDeleteTreeW(coclass_key, buf);
|
res = pRegDeleteTreeW(coclass_key, buf);
|
||||||
if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS;
|
if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS;
|
||||||
if (res != ERROR_SUCCESS) goto error_close_coclass_key;
|
if (res != ERROR_SUCCESS) goto error_close_coclass_key;
|
||||||
|
|
||||||
if (list->progid) {
|
if (list->progid) {
|
||||||
res = RegDeleteTreeA(HKEY_CLASSES_ROOT, list->progid);
|
res = pRegDeleteTreeA(HKEY_CLASSES_ROOT, list->progid);
|
||||||
if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS;
|
if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS;
|
||||||
if (res != ERROR_SUCCESS) goto error_close_coclass_key;
|
if (res != ERROR_SUCCESS) goto error_close_coclass_key;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (list->viprogid) {
|
if (list->viprogid) {
|
||||||
res = RegDeleteTreeA(HKEY_CLASSES_ROOT, list->viprogid);
|
res = pRegDeleteTreeA(HKEY_CLASSES_ROOT, list->viprogid);
|
||||||
if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS;
|
if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS;
|
||||||
if (res != ERROR_SUCCESS) goto error_close_coclass_key;
|
if (res != ERROR_SUCCESS) goto error_close_coclass_key;
|
||||||
}
|
}
|
||||||
|
@ -511,6 +514,12 @@ HRESULT WINAPI DllUnregisterServer(void)
|
||||||
{
|
{
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
|
HMODULE advapi32 = GetModuleHandleA("advapi32");
|
||||||
|
if (!advapi32) return E_FAIL;
|
||||||
|
pRegDeleteTreeA = (typeof(RegDeleteTreeA)*) GetProcAddress(advapi32, "RegDeleteTreeA");
|
||||||
|
pRegDeleteTreeW = (typeof(RegDeleteTreeW)*) GetProcAddress(advapi32, "RegDeleteTreeW");
|
||||||
|
if (!pRegDeleteTreeA || !pRegDeleteTreeW) return E_FAIL;
|
||||||
|
|
||||||
TRACE("\n");
|
TRACE("\n");
|
||||||
|
|
||||||
hr = unregister_coclasses(coclass_list);
|
hr = unregister_coclasses(coclass_list);
|
||||||
|
|
Loading…
Reference in New Issue