Hi all,
I have the below code fragment in the beginning of an IOCTL function. After allocating memory for the SystemInformation structure below, I get an access denied. Any ideas why I may be hitting this?
Thanks,
I have the below code fragment in the beginning of an IOCTL function. After allocating memory for the SystemInformation structure below, I get an access denied. Any ideas why I may be hitting this?
Thanks,
Code: Select all
PEPROCESS ntProcess;
NTSTRSAFE_PWSTR buffer;
PVOID ssdtAddress;
PVOID SystemInformation = NULL;
NTSTATUS ntStatus = STATUS_SUCCESS;
PULONG ReturnLength = 0;
RTL_PROCESS_MODULES moduleList;
RTL_PROCESS_MODULE_INFORMATION module;
ULONG Size = 0;
int counter = 0;
Size = sizeof(RTL_PROCESS_MODULE_INFORMATION);
SystemInformation = ExAllocatePoolWithTag(PagedPool, Size, 'tagx');
DbgPrint("Size: %d\n", Size);
if(SystemInformation == NULL)
{
DbgPrint("Could not allocate memory for the module list from paged pool. \n");
return;
}
ntStatus = NtQuerySystemInformation(
SystemModuleInformation,
SystemInformation,
Size,
0
);
-------------
DriverObject
DriverObject