mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[NTOS:CM] Do not call ZwQueryObject with a zero-size buffer. CORE-15882
Actually fixes ntdll_apitest:NtLoadUnloadKey.
This commit is contained in:
parent
627f0242ad
commit
f86360fdbc
2 changed files with 8 additions and 6 deletions
|
@ -135,6 +135,7 @@ CmpAddToHiveFileList(IN PCMHIVE Hive)
|
|||
UNICODE_STRING HivePath;
|
||||
PWCHAR FilePath;
|
||||
ULONG Length;
|
||||
OBJECT_NAME_INFORMATION DummyNameInfo;
|
||||
POBJECT_NAME_INFORMATION FileNameInfo;
|
||||
|
||||
HivePath.Buffer = NULL;
|
||||
|
@ -175,10 +176,10 @@ CmpAddToHiveFileList(IN PCMHIVE Hive)
|
|||
/* Determine the right buffer size and allocate */
|
||||
Status = ZwQueryObject(Hive->FileHandles[HFILE_TYPE_PRIMARY],
|
||||
ObjectNameInformation,
|
||||
NULL,
|
||||
0,
|
||||
&DummyNameInfo,
|
||||
sizeof(DummyNameInfo),
|
||||
&Length);
|
||||
if (Status != STATUS_INFO_LENGTH_MISMATCH)
|
||||
if (Status != STATUS_BUFFER_OVERFLOW)
|
||||
{
|
||||
DPRINT1("CmpAddToHiveFileList: Hive file name size query failed, status = 0x%08lx\n", Status);
|
||||
goto Quickie;
|
||||
|
|
|
@ -279,6 +279,7 @@ CmpCmdHiveOpen(IN POBJECT_ATTRIBUTES FileAttributes,
|
|||
UNICODE_STRING FileName;
|
||||
PWCHAR FilePath;
|
||||
ULONG Length;
|
||||
OBJECT_NAME_INFORMATION DummyNameInfo;
|
||||
POBJECT_NAME_INFORMATION FileNameInfo;
|
||||
|
||||
PAGED_CODE();
|
||||
|
@ -299,10 +300,10 @@ CmpCmdHiveOpen(IN POBJECT_ATTRIBUTES FileAttributes,
|
|||
/* Determine the right buffer size and allocate */
|
||||
Status = ZwQueryObject(FileAttributes->RootDirectory,
|
||||
ObjectNameInformation,
|
||||
NULL,
|
||||
0,
|
||||
&DummyNameInfo,
|
||||
sizeof(DummyNameInfo),
|
||||
&Length);
|
||||
if (Status != STATUS_INFO_LENGTH_MISMATCH)
|
||||
if (Status != STATUS_BUFFER_OVERFLOW)
|
||||
{
|
||||
DPRINT1("CmpCmdHiveOpen(): Root directory handle object name size query failed, Status = 0x%08lx\n", Status);
|
||||
return Status;
|
||||
|
|
Loading…
Reference in a new issue