qcap: Replace DeleteEntireSubKey with RegDeleteTreeW.
This commit is contained in:
parent
b7233ba33f
commit
163815180a
|
@ -54,37 +54,6 @@ static WCHAR const tmodel_keyname[15] =
|
|||
static WCHAR const tmodel_both[] =
|
||||
{'B','o','t','h',0};
|
||||
|
||||
/*
|
||||
* Delete a key and all its subkeys
|
||||
*/
|
||||
static HRESULT DeleteEntireSubKey(HKEY hkey, LPWSTR strSubKey)
|
||||
{
|
||||
WCHAR buffer[MAX_KEY_LEN];
|
||||
DWORD dw = MAX_KEY_LEN;
|
||||
FILETIME ft;
|
||||
HKEY hk;
|
||||
LONG ret = RegOpenKeyExW(hkey, strSubKey, 0, MAXIMUM_ALLOWED, &hk);
|
||||
|
||||
if (ERROR_SUCCESS == ret)
|
||||
{
|
||||
/* Keep on enumerating the first key and deleting that */
|
||||
for( ; ; )
|
||||
{
|
||||
dw = MAX_KEY_LEN;
|
||||
|
||||
ret = RegEnumKeyExW(hk, 0, buffer, &dw, NULL, NULL, NULL, &ft);
|
||||
|
||||
if (ERROR_SUCCESS == ret)
|
||||
DeleteEntireSubKey(hk, buffer);
|
||||
else
|
||||
break;
|
||||
}
|
||||
RegCloseKey(hk);
|
||||
RegDeleteKeyW(hkey, strSubKey);
|
||||
}
|
||||
return NOERROR;
|
||||
}
|
||||
|
||||
/*
|
||||
* SetupRegisterClass()
|
||||
*/
|
||||
|
@ -252,7 +221,7 @@ static HRESULT SetupRegisterAllClasses(const CFactoryTemplate * pList, int num,
|
|||
pList->m_Name, szFileName,
|
||||
ips32_keyname, tmodel_both);
|
||||
else
|
||||
hr = DeleteEntireSubKey(hkey, szCLSID);
|
||||
hr = RegDeleteTreeW(hkey, szCLSID);
|
||||
}
|
||||
}
|
||||
RegCloseKey(hkey);
|
||||
|
|
Loading…
Reference in New Issue