* - Implement RegDeleteKeyW() and RegDeleteValueW()
*/
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-
#define NDEBUG
#include "mkhive.h"
Volatile,
&BlockOffset);
}
+ else // if (BlockOffset == HCELL_NIL)
+ {
+ Status = STATUS_OBJECT_NAME_NOT_FOUND; // ERROR_PATH_NOT_FOUND;
+ }
HvReleaseCell(&ParentRegistryHive->Hive, ParentCellOffset);
if (!NT_SUCCESS(Status))
+ {
+ DPRINT("RegpCreateOrOpenKey('%S'): Could not create or open subkey '%wZ'\n", KeyName, &KeyString);
return ERROR_UNSUCCESSFUL;
+ }
ParentCellOffset = BlockOffset;
if (End)
}
-// Synced with freeldr/windows/registry.c
+// Synced with freeldr/ntldr/registry.c
static
VOID
RepGetValueData(
}
}
-// Similar to RegQueryValue in freeldr/windows/registry.c
+// Similar to RegQueryValue in freeldr/ntldr/registry.c
LONG WINAPI
RegQueryValueExW(
IN HKEY hKey,
// IN PCWSTR TargetKeyPath OPTIONAL,
IN HKEY TargetKeyHandle)
{
+ LONG rc;
PMEMKEY LinkKey, TargetKey;
PREPARSE_POINT ReparsePoint;
if (LinkKeyPath && !(LinkKeyHandle && *LinkKeyHandle))
{
/* Create the link key */
- RegCreateKeyExW(NULL,
- LinkKeyPath,
- 0,
- NULL,
- REG_OPTION_VOLATILE,
- 0,
- NULL,
- (HKEY*)&LinkKey,
- NULL);
+ rc = RegCreateKeyExW(NULL,
+ LinkKeyPath,
+ 0,
+ NULL,
+ REG_OPTION_VOLATILE,
+ 0,
+ NULL,
+ (PHKEY)&LinkKey,
+ NULL);
+ if (rc != ERROR_SUCCESS)
+ {
+ free(ReparsePoint);
+ return FALSE;
+ }
}
else if (LinkKeyHandle)
{