hopefully fix something in CreateClassKey

svn path=/trunk/; revision=16415
This commit is contained in:
Gunnar Dalsnes 2005-07-04 21:54:36 +00:00
parent 199b9bce22
commit d8e78cc66b

View file

@ -1308,12 +1308,7 @@ static HKEY CreateClassKey(HINF hInf)
lstrcpyW(FullBuffer, ControlClass);
lstrcatW(FullBuffer, Buffer);
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE,
FullBuffer,
0,
KEY_ALL_ACCESS,
&hClassKey))
{
if (!SetupGetLineTextW(NULL,
hInf,
Version,
@ -1322,10 +1317,11 @@ static HKEY CreateClassKey(HINF hInf)
MAX_PATH,
&RequiredSize))
{
RegDeleteKeyW(HKEY_LOCAL_MACHINE, FullBuffer);
return INVALID_HANDLE_VALUE;
}
if (RegCreateKeyExW(HKEY_LOCAL_MACHINE,
if (ERROR_SUCCESS != RegCreateKeyExW(HKEY_LOCAL_MACHINE,
FullBuffer,
0,
NULL,
@ -1335,12 +1331,11 @@ static HKEY CreateClassKey(HINF hInf)
&hClassKey,
NULL))
{
RegDeleteKeyW(HKEY_LOCAL_MACHINE, FullBuffer);
return INVALID_HANDLE_VALUE;
}
}
if (RegSetValueExW(hClassKey,
if (ERROR_SUCCESS != RegSetValueExW(hClassKey,
Class,
0,
REG_SZ,
@ -1348,8 +1343,7 @@ static HKEY CreateClassKey(HINF hInf)
RequiredSize * sizeof(WCHAR)))
{
RegCloseKey(hClassKey);
RegDeleteKeyW(HKEY_LOCAL_MACHINE,
FullBuffer);
RegDeleteKeyW(HKEY_LOCAL_MACHINE, FullBuffer);
return INVALID_HANDLE_VALUE;
}
@ -1397,6 +1391,7 @@ BOOL WINAPI SetupDiInstallClassW(
SetupCloseInfFile(hInf);
return FALSE;
}
RegCloseKey(hClassKey);
/* Try to append a layout file */