Hi All,
Environment :
virtual machine of Windows 10 IOT x64
Visual studio 2017 community edition
project type : windows driver → Legacy → WDM driver
RAM size : 5 GB
Trying to allocate more than 2Gb of memory chunk in physical memory, able to allocate 2047 MB of memory chunk but it fails to allocate any chunk greater that 2047 MB.
but as per Microsoft, on Windows 64-bit architecture we can assign non paged memory up to 75% of RAM or 128 GB
(Whichever is lower)
sample source code is as follows:
#include “ntddk.h”
PVOID AllocatedMemory = NULL;
NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
{
NTSTATUS status = STATUS_SUCCESS;
DriverObject->DriverUnload = Unload;
AllocatedMemory = ExAllocatePoolWithTag(NonPagedPool, 2048 * 1024 * 1024, 'Tag1');
if (AllocatedMemory != NULL)
{
KdPrint(("2048 MB NonCachedMemory is allocated. \r\n"));
}
else
{
KdPrint(("2048 MB NonCachedMemory is not allocated. \r\n"));
}
return status;
}
VOID Unload(PDRIVER_OBJECT DriverObject)
{
if (AllocatedMemory != NULL)
{
ExFreePoolWithTag(AllocatedMemory, 'Tag1');
KdPrint(("2048 MB NonCachedMemory is freed. \r\n"));
}
}
please suggest how can memory chunk more than 2 GB can be allocated.
Thank You