File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments