Skip to content

Commit a60d19a

Browse files
committed
fix lm
1 parent 2676d3e commit a60d19a

1 file changed

Lines changed: 4 additions & 11 deletions

File tree

sysinfo.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,11 @@ RtlCliListDrivers(VOID)
4444
PRTL_PROCESS_MODULES ModuleInfo;
4545
PRTL_PROCESS_MODULE_INFORMATION ModuleEntry;
4646
NTSTATUS Status;
47-
ULONG Size = 0;
47+
ULONG Size = 1024*1024;
4848
ULONG i;
4949

50-
// Get the count first
51-
Status = NtQuerySystemInformation(SystemModuleInformation,
52-
&Size,
53-
sizeof(Size),
54-
NULL);
55-
56-
// Get the total buffer size
57-
Size = sizeof(*ModuleInfo) + (Size * sizeof(*ModuleInfo));
58-
5950
// Allocate it
60-
ModuleInfo = RtlAllocateHeap(RtlGetProcessHeap(), 0, Size);
51+
ModuleInfo = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, Size);
6152

6253
// Query the buffer
6354
Status = NtQuerySystemInformation(SystemModuleInformation,
@@ -92,6 +83,8 @@ RtlCliListDrivers(VOID)
9283
ModuleEntry->ImageSize);
9384
}
9485

86+
RtlFreeHeap(RtlGetProcessHeap(), 0, ModuleInfo);
87+
9588
// Return error code
9689
return Status;
9790
}

0 commit comments

Comments
 (0)