mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 20:25:39 +00:00
[SACDRV] Add 2 OBJ_KERNEL_HANDLE
Match Zw*() uses. Plus: - GetRegistryValueBuffer(): Add missing ZwClose(Handle), Fix a copypasta. - SetRegistryValue(): 1 s/NtClose/ZwClose/. CORE-10207
This commit is contained in:
parent
9f8fbe14f5
commit
ed125de9f3
1 changed files with 10 additions and 7 deletions
|
@ -406,7 +406,7 @@ GetRegistryValueBuffer(IN PCWSTR KeyName,
|
||||||
RtlInitUnicodeString(&DestinationString, KeyName);
|
RtlInitUnicodeString(&DestinationString, KeyName);
|
||||||
InitializeObjectAttributes(&ObjectAttributes,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
&DestinationString,
|
&DestinationString,
|
||||||
OBJ_CASE_INSENSITIVE,
|
OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
Status = ZwOpenKey(&Handle,
|
Status = ZwOpenKey(&Handle,
|
||||||
|
@ -427,7 +427,8 @@ GetRegistryValueBuffer(IN PCWSTR KeyName,
|
||||||
NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
&ResultLength);
|
&ResultLength);
|
||||||
if (!ResultLength) return Status;
|
if (!ResultLength)
|
||||||
|
goto Quit;
|
||||||
|
|
||||||
/* Allocate the buffer for the partial info structure and our integer data */
|
/* Allocate the buffer for the partial info structure and our integer data */
|
||||||
ResultLength += sizeof(ULONG);
|
ResultLength += sizeof(ULONG);
|
||||||
|
@ -435,7 +436,7 @@ GetRegistryValueBuffer(IN PCWSTR KeyName,
|
||||||
if (!*Buffer)
|
if (!*Buffer)
|
||||||
{
|
{
|
||||||
SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC GetRegistryValueBuffer: failed allocation\n");
|
SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC GetRegistryValueBuffer: failed allocation\n");
|
||||||
return Status;
|
goto Quit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now read the data */
|
/* Now read the data */
|
||||||
|
@ -452,8 +453,10 @@ GetRegistryValueBuffer(IN PCWSTR KeyName,
|
||||||
SacFreePool(*Buffer);
|
SacFreePool(*Buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return the result */
|
Quit:
|
||||||
SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC SetRegistryValue: Exiting.\n");
|
/* Close the handle and exit */
|
||||||
|
ZwClose(Handle);
|
||||||
|
SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC GetRegistryValueBuffer: Exiting.\n");
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -478,7 +481,7 @@ SetRegistryValue(IN PCWSTR KeyName,
|
||||||
RtlInitUnicodeString(&DestinationString, KeyName);
|
RtlInitUnicodeString(&DestinationString, KeyName);
|
||||||
InitializeObjectAttributes(&ObjectAttributes,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
&DestinationString,
|
&DestinationString,
|
||||||
OBJ_CASE_INSENSITIVE,
|
OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
Status = ZwOpenKey(&Handle,
|
Status = ZwOpenKey(&Handle,
|
||||||
|
@ -501,7 +504,7 @@ SetRegistryValue(IN PCWSTR KeyName,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Close the handle and exit */
|
/* Close the handle and exit */
|
||||||
NtClose(Handle);
|
ZwClose(Handle);
|
||||||
SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC SetRegistryValue: Exiting.\n");
|
SAC_DBG(SAC_DBG_ENTRY_EXIT, "SAC SetRegistryValue: Exiting.\n");
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue