Max TotalBytes size for MmAllocatePagesForMdlEx

I heard that PMDL MmAllocatePagesForMdlEx(
__in PHYSICAL_ADDRESS LowAddress,
__in PHYSICAL_ADDRESS HighAddress,
__in PHYSICAL_ADDRESS SkipBytes,
__in SIZE_T TotalBytes,
__in MEMORY_CACHING_TYPE CacheType,
__in ULONG Flags
); can only take max totalbytes less than 4 gigs. But what is the exact max no of total bytes to pass to the function ?

>>But what is the exact max no of total bytes to pass to the function ?

The max you want to allocate , but do call MmGetMdlByteCount to know the exact amount that was returned.

/C

----- Original Message -----
From:
To: “Windows System Software Devs Interest List”
Sent: Wednesday, November 17, 2010 10:40 PM
Subject: [ntdev] Max TotalBytes size for MmAllocatePagesForMdlEx

>I heard that PMDL MmAllocatePagesForMdlEx(
> in PHYSICAL_ADDRESS LowAddress,
>
in PHYSICAL_ADDRESS HighAddress,
> in PHYSICAL_ADDRESS SkipBytes,
>
in SIZE_T TotalBytes,
> in MEMORY_CACHING_TYPE CacheType,
>
in ULONG Flags
> ); can only take max totalbytes less than 4 gigs. But what is the exact max no of total bytes to pass to the function ?
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

@Christiaan Ghijselinck I want to know what is the max value I can pass if my system has large enough memory

xxxxx@gmail.com wrote:

I want to know what is the max value I can pass if my system has large enough memory

Did you read the documentation? It seems quite unambiguous. Quoting:

The maximum amount of memory that *MmAllocatePagesForMdlEx* can
allocate in a single call is (4 gigabytes - PAGE_SIZE). The routine
can satisfy an allocation request for this amount only if enough
pages are available.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.