[MKHIVE] Implement and use RegCloseKey().

This commit is contained in:
Hermès Bélusca-Maïto 2018-10-14 00:29:04 +02:00
parent 4caf391324
commit 81d435a181
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
3 changed files with 21 additions and 0 deletions

View file

@ -89,6 +89,10 @@ RegSetValueExW(
IN const UCHAR* lpData,
IN ULONG cbData);
LONG WINAPI
RegCloseKey(
IN HKEY hKey);
LONG WINAPI
RegDeleteKeyW(
IN HKEY hKey,

View file

@ -463,8 +463,11 @@ registry_callback(HINF hInf, PWCHAR Section, BOOL Delete)
/* and now do it */
if (!do_reg_operation(KeyHandle, ValuePtr, Context, Flags))
{
RegCloseKey(KeyHandle);
return FALSE;
}
RegCloseKey(KeyHandle);
}
InfHostFreeContext(Context);

View file

@ -485,6 +485,18 @@ RegpCreateOrOpenKey(
return ERROR_SUCCESS;
}
LONG WINAPI
RegCloseKey(
IN HKEY hKey)
{
PMEMKEY Key = HKEY_TO_MEMKEY(hKey); // ParentKey
/* Free the object */
free(Key);
return ERROR_SUCCESS;
}
LONG WINAPI
RegCreateKeyW(
IN HKEY hKey,
@ -942,6 +954,8 @@ RegInitializeRegistry(
CreateSymLink(L"Registry\\Machine\\SYSTEM\\CurrentControlSet",
NULL, ControlSetKey);
RegCloseKey(ControlSetKey);
#if 0
/* Link SECURITY to SAM */
CmpLinkKeyToHive(L"\\Registry\\Machine\\Security\\SAM", L"\\Registry\\Machine\\SAM\\SAM");