hi,
i am trying to allocate physically contiguous memory from
non-paged pool using MmAllocateContiguousMemory on NT4. when i
deallocate the same using MmFreeContiguousMemory, this is what
i get :
POOL:unable to find big page slot ffb55000
POOL: Unable to find tracker 20474942, table corrupted
while the system doesn’t crash or do funny things, i’m not
able to find whats going wrong and where.
attached below is the src.
help.
—javed
====================================================================
#define MAXIMUM_DMA_ADDRESS 0xffffffffffffffff
/*------------------------------------------------------------------------------------------*/
//** Global variables
NTSTATUS DriverEntry(
IN PDRIVER_OBJECT pDriverObject,
IN PUNICODE_STRING puniRegistryPath
)
{
NTSTATUS ntStatus=STATUS_SUCCESS; //Status variable
PUCHAR pBuffer1=NULL;
PUCHAR pBuffer2=NULL;
LARGE_INTEGER maxDmaAddress;
maxDmaAddress.QuadPart = MAXIMUM_DMA_ADDRESS;
pBuffer1 =
(PUCHAR) MmAllocateContiguousMemory
(
1024 * 6,
maxDmaAddress
);
if(pBuffer1 == NULL){
DbgPrint(“\ntest: Couldn’t allocate buffer1\n”);
ntStatus = STATUS_INSUFFICIENT_RESOURCES;
goto Done;
}
pBuffer2 =
(PUCHAR) MmAllocateContiguousMemory
(
10240,
maxDmaAddress
);
if(pBuffer2 == NULL){
DbgPrint(“\ntest: Couldn’t allocate buffer2 \n”);
ntStatus = STATUS_INSUFFICIENT_RESOURCES;
}
if(pBuffer1){
MmFreeContiguousMemory(pBuffer1);
}
if(pBuffer2){
MmFreeContiguousMemory(pBuffer2);
}
Done:
ntStatus = STATUS_INSUFFICIENT_RESOURCES;
return ntStatus;
}