Contiguous Memory Limit on Windows 7

Hi,
Is there a way to adjust the behavior for contiguous memory allocation on Windows 7? The driver attempts to allocate 1GB aligned at 256MB using
mdl = MmAllocatePagesForMdlEx(zero, sky, aligned,
size, MmNonCached, MM_ALLOCATE_FULLY_REQUIRED | MM_ALLOCATE_REQUIRE_CONTIGUOUS_CHUNKS);
On Windows 7, with 16 GB RAM, the code above fails.
On Windows 10, with 8 GB RAM, it works.
Thank you.

Consider using MmAllocateContiguousMemorySpecifyCache() and if you want to be sure you get the memory either make you driver a boot start driver, or provide a small service boot start driver that allocates the memory. I have used the latter for multiple clients, and easily acquired more than 1GB on a Windows 7 system.

Don Burn
Windows Driver Consulting
Website: http://www.windrvr.com

Thanks Don! Changing StartType to SERVICE_BOOT_START is an improvement. On a box with 12 GB RAM, it fails or succeeds, with 16 GB RAM it always succeeds.