From: Hermès Bélusca-Maïto Date: Sat, 13 Oct 2018 22:29:04 +0000 (+0200) Subject: [MKHIVE] Implement and use RegCloseKey(). X-Git-Tag: 0.4.12-dev~532 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=81d435a181db3d7d0b93149dd61c971f5a0147ae;ds=sidebyside [MKHIVE] Implement and use RegCloseKey(). --- diff --git a/sdk/tools/mkhive/mkhive.h b/sdk/tools/mkhive/mkhive.h index 517925a6b63..82c8ecc2c33 100644 --- a/sdk/tools/mkhive/mkhive.h +++ b/sdk/tools/mkhive/mkhive.h @@ -89,6 +89,10 @@ RegSetValueExW( IN const UCHAR* lpData, IN ULONG cbData); +LONG WINAPI +RegCloseKey( + IN HKEY hKey); + LONG WINAPI RegDeleteKeyW( IN HKEY hKey, diff --git a/sdk/tools/mkhive/reginf.c b/sdk/tools/mkhive/reginf.c index c6087a96ba2..47f0d8525b7 100644 --- a/sdk/tools/mkhive/reginf.c +++ b/sdk/tools/mkhive/reginf.c @@ -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); diff --git a/sdk/tools/mkhive/registry.c b/sdk/tools/mkhive/registry.c index 1686fca08da..cd238dcd95e 100644 --- a/sdk/tools/mkhive/registry.c +++ b/sdk/tools/mkhive/registry.c @@ -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");