mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[NTOS:MM] Fix MmGetFileNameForAddress() callers. (#1723)
MmGetFileNameForAddress() calls RtlCreateUnicodeString(). This also fixes a leak in MiQueryMemorySectionName().
This commit is contained in:
parent
46c052e0f2
commit
ccf8bff3ec
2 changed files with 3 additions and 3 deletions
|
@ -558,7 +558,7 @@ DbgkpPostFakeModuleMessages(IN PEPROCESS Process,
|
|||
if (!NT_SUCCESS(Status)) LoadDll->FileHandle = NULL;
|
||||
|
||||
/* Free the name now */
|
||||
ExFreePool(ModuleName.Buffer);
|
||||
RtlFreeUnicodeString(&ModuleName);
|
||||
}
|
||||
|
||||
/* Send the fake module load message */
|
||||
|
|
|
@ -1897,7 +1897,6 @@ MiQueryMemorySectionName(IN HANDLE ProcessHandle,
|
|||
{
|
||||
PEPROCESS Process;
|
||||
NTSTATUS Status;
|
||||
WCHAR ModuleFileNameBuffer[MAX_PATH] = {0};
|
||||
UNICODE_STRING ModuleFileName;
|
||||
PMEMORY_SECTION_NAME SectionName = NULL;
|
||||
KPROCESSOR_MODE PreviousMode = ExGetPreviousMode();
|
||||
|
@ -1915,7 +1914,6 @@ MiQueryMemorySectionName(IN HANDLE ProcessHandle,
|
|||
return Status;
|
||||
}
|
||||
|
||||
RtlInitEmptyUnicodeString(&ModuleFileName, ModuleFileNameBuffer, sizeof(ModuleFileNameBuffer));
|
||||
Status = MmGetFileNameForAddress(BaseAddress, &ModuleFileName);
|
||||
|
||||
if (NT_SUCCESS(Status))
|
||||
|
@ -1947,6 +1945,8 @@ MiQueryMemorySectionName(IN HANDLE ProcessHandle,
|
|||
if (ReturnLength) *ReturnLength = ModuleFileName.Length;
|
||||
|
||||
}
|
||||
|
||||
RtlFreeUnicodeString(&ModuleFileName);
|
||||
}
|
||||
ObDereferenceObject(Process);
|
||||
return Status;
|
||||
|
|
Loading…
Reference in a new issue