1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 02:58:02 -06:00

Windows: Avoid calling RegCloseKey on an invalid handle.

This commit is contained in:
Mounir IDRASSI
2014-11-11 19:23:35 +01:00
parent b2438b5029
commit bc9005968a

View File

@@ -2409,14 +2409,15 @@ void InitApp (HINSTANCE hInstance, char *lpszCommandLine)
DWORD val = 0, size = sizeof(val); DWORD val = 0, size = sizeof(val);
HKEY hkey; HKEY hkey;
if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Services\\Atapi\\Parameters", 0, KEY_READ, &hkey) == ERROR_SUCCESS if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Services\\Atapi\\Parameters", 0, KEY_READ, &hkey) == ERROR_SUCCESS)
&& (RegQueryValueEx (hkey, "EnableBigLba", 0, 0, (LPBYTE) &val, &size) != ERROR_SUCCESS
|| val != 1))
{ {
Warning ("LARGE_IDE_WARNING_2K_REGISTRY"); if (RegQueryValueEx (hkey, "EnableBigLba", 0, 0, (LPBYTE) &val, &size) != ERROR_SUCCESS
|| val != 1)
{
Warning ("LARGE_IDE_WARNING_2K_REGISTRY");
}
RegCloseKey (hkey);
} }
RegCloseKey (hkey);
} }
break; break;