Stefan Leichter : msxml3: Remove 'recursive registry key delete'
function.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Aug 27 06:07:36 CDT 2007
Module: wine
Branch: master
Commit: 5987d3a37b9004378df0fd261d455e068e383d91
URL: http://source.winehq.org/git/wine.git/?a=commit;h=5987d3a37b9004378df0fd261d455e068e383d91
Author: Stefan Leichter <Stefan.Leichter at camline.com>
Date: Fri Aug 24 19:51:42 2007 +0200
msxml3: Remove 'recursive registry key delete' function.
---
dlls/msxml3/regsvr.c | 76 ++++----------------------------------------------
1 files changed, 6 insertions(+), 70 deletions(-)
diff --git a/dlls/msxml3/regsvr.c b/dlls/msxml3/regsvr.c
index 24514df..9a0d938 100644
--- a/dlls/msxml3/regsvr.c
+++ b/dlls/msxml3/regsvr.c
@@ -135,9 +135,6 @@ 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 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_interfaces
@@ -226,7 +223,8 @@ static HRESULT unregister_interfaces(struct regsvr_interface const *list)
WCHAR buf[39];
StringFromGUID2(list->iid, buf, 39);
- res = recursive_delete_keyW(interface_key, buf);
+ res = RegDeleteTreeW(interface_key, buf);
+ if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS;
}
RegCloseKey(interface_key);
@@ -347,7 +345,8 @@ static HRESULT unregister_coclasses(struct regsvr_coclass const *list)
WCHAR 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;
}
@@ -403,7 +402,8 @@ static HRESULT unregister_progids(struct progid const *list)
LONG res = ERROR_SUCCESS;
for (; res == ERROR_SUCCESS && list->name; ++list) {
- res = recursive_delete_keyA(HKEY_CLASSES_ROOT, list->name);
+ res = RegDeleteTreeA(HKEY_CLASSES_ROOT, list->name);
+ if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS;
}
return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
@@ -461,70 +461,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
*/
static struct regsvr_coclass const coclass_list[] = {
More information about the wine-cvs
mailing list