Commit eb77d12b authored by Stefan Leichter's avatar Stefan Leichter Committed by Alexandre Julliard

ddrawex: Remove 'recursive registry key delete' function.

parent ff3ab480
...@@ -94,9 +94,6 @@ static LONG register_key_defvalueW(HKEY base, WCHAR const *name, ...@@ -94,9 +94,6 @@ static LONG register_key_defvalueW(HKEY base, WCHAR const *name,
WCHAR const *value); WCHAR const *value);
static LONG register_key_defvalueA(HKEY base, WCHAR const *name, static LONG register_key_defvalueA(HKEY base, WCHAR const *name,
char const *value); char const *value);
static LONG recursive_delete_key(HKEY key);
static LONG recursive_delete_keyA(HKEY base, char const *name);
static LONG recursive_delete_keyW(HKEY base, WCHAR const *name);
/*********************************************************************** /***********************************************************************
* register_coclasses * register_coclasses
...@@ -200,11 +197,13 @@ static HRESULT unregister_coclasses(struct regsvr_coclass const *list) ...@@ -200,11 +197,13 @@ 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 = recursive_delete_keyW(coclass_key, buf); res = RegDeleteTreeW(coclass_key, buf);
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 = recursive_delete_keyA(HKEY_CLASSES_ROOT, list->progid); res = RegDeleteTreeA(HKEY_CLASSES_ROOT, list->progid);
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;
} }
} }
...@@ -256,70 +255,6 @@ static LONG register_key_defvalueA( ...@@ -256,70 +255,6 @@ static LONG register_key_defvalueA(
} }
/*********************************************************************** /***********************************************************************
* recursive_delete_key
*/
static LONG recursive_delete_key(HKEY key)
{
LONG res;
WCHAR subkey_name[MAX_PATH];
DWORD cName;
HKEY subkey;
for (;;) {
cName = sizeof(subkey_name) / sizeof(WCHAR);
res = RegEnumKeyExW(key, 0, subkey_name, &cName,
NULL, NULL, NULL, NULL);
if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA) {
res = ERROR_SUCCESS; /* presumably we're done enumerating */
break;
}
res = RegOpenKeyExW(key, subkey_name, 0,
KEY_READ | KEY_WRITE, &subkey);
if (res == ERROR_FILE_NOT_FOUND) continue;
if (res != ERROR_SUCCESS) break;
res = recursive_delete_key(subkey);
RegCloseKey(subkey);
if (res != ERROR_SUCCESS) break;
}
if (res == ERROR_SUCCESS) res = RegDeleteKeyW(key, 0);
return res;
}
/***********************************************************************
* recursive_delete_keyA
*/
static LONG recursive_delete_keyA(HKEY base, char const *name)
{
LONG res;
HKEY key;
res = RegOpenKeyExA(base, name, 0, KEY_READ | KEY_WRITE, &key);
if (res == ERROR_FILE_NOT_FOUND) return ERROR_SUCCESS;
if (res != ERROR_SUCCESS) return res;
res = recursive_delete_key(key);
RegCloseKey(key);
return res;
}
/***********************************************************************
* recursive_delete_keyW
*/
static LONG recursive_delete_keyW(HKEY base, WCHAR const *name)
{
LONG res;
HKEY key;
res = RegOpenKeyExW(base, name, 0, KEY_READ | KEY_WRITE, &key);
if (res == ERROR_FILE_NOT_FOUND) return ERROR_SUCCESS;
if (res != ERROR_SUCCESS) return res;
res = recursive_delete_key(key);
RegCloseKey(key);
return res;
}
/***********************************************************************
* coclass list * coclass list
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment