Refact. Delete check reg fingerprint (#7631)
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
parent
0c294eefae
commit
f36f065508
@ -186,17 +186,22 @@ BOOL DeleteRustDeskTestCertsW_SingleHive(HKEY RootKey, LPWSTR Prefix = NULL) {
|
|||||||
if ((res != ERROR_SUCCESS) || (SubKeyName == NULL))
|
if ((res != ERROR_SUCCESS) || (SubKeyName == NULL))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// "佒呏..." key begins with "ROOT" encoded as UTF-16
|
||||||
|
if ((SubKeyName[0] == SubKeyPrefix[0]) && (SubKeyName[1] == SubKeyPrefix[1])) {
|
||||||
// Remove test certificate
|
// Remove test certificate
|
||||||
|
{
|
||||||
LPWSTR Complete = (LPWSTR)malloc(512 * sizeof(WCHAR));
|
LPWSTR Complete = (LPWSTR)malloc(512 * sizeof(WCHAR));
|
||||||
if (Complete == 0) break;
|
if (Complete == 0) break;
|
||||||
wsprintfW(Complete, L"%s\\%s\\Certificates\\%s", lpSystemCertificatesPath, SubKeyName, lpCertFingerPrint);
|
wsprintfW(Complete, L"%s\\%s\\Certificates\\%s", lpSystemCertificatesPath, SubKeyName, lpCertFingerPrint);
|
||||||
std::wcout << "Try delete from: " << SubKeyName << std::endl;
|
// std::wcout << "Try delete from: " << SubKeyName << std::endl;
|
||||||
RegDelnodeW(RootKey, Complete, FALSE);
|
RegDelnodeW(RootKey, Complete, FALSE);
|
||||||
free(Complete);
|
free(Complete);
|
||||||
|
}
|
||||||
|
|
||||||
if ((SubKeyName[0] == SubKeyPrefix[0]) && (SubKeyName[1] == SubKeyPrefix[1])) {
|
// Remove wrong empty key store
|
||||||
// "Chinese Characters" key begins with "ROOT" encoded as UTF-16
|
{
|
||||||
LPWSTR Complete = (LPWSTR)malloc(512 * sizeof(WCHAR));
|
LPWSTR Complete = (LPWSTR)malloc(512 * sizeof(WCHAR));
|
||||||
|
memset(Complete, 0, 512 * sizeof(WCHAR));
|
||||||
if (Complete == 0) break;
|
if (Complete == 0) break;
|
||||||
wsprintfW(Complete, L"%s\\%s", lpSystemCertificatesPath, SubKeyName);
|
wsprintfW(Complete, L"%s\\%s", lpSystemCertificatesPath, SubKeyName);
|
||||||
if (RegDelnodeW(RootKey, Complete, TRUE)) {
|
if (RegDelnodeW(RootKey, Complete, TRUE)) {
|
||||||
@ -208,6 +213,7 @@ BOOL DeleteRustDeskTestCertsW_SingleHive(HKEY RootKey, LPWSTR Prefix = NULL) {
|
|||||||
}
|
}
|
||||||
free(Complete);
|
free(Complete);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
free(SubKeyName);
|
free(SubKeyName);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user