From: "Tony Mason" Newsgroups: comp.os.ms-windows.programmer.nt.kernel-mode References: <348C88CE.15538058@natinst.com.nospam> Subject: Re: ioAllocateMDL fails for large blocks Date: Tue, 9 Dec 1997 15:28:32 -0500 Lines: 54 Organization: OSR Open Systems Resources, Inc. X-Newsreader: Microsoft Outlook Express 4.71.1712.3 X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3 NNTP-Posting-Host: feanor.osr.com Message-ID: <348da9f0.0@news.osr.com> Path: news.mitre.org!blanket.mitre.org!philabs!newsjunkie.ans.net!newsfeeds.ans.net!news-was.dfn.de!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!howland.erols.net!europa.clark.net!206.1.179.76!newsrouter.icnc.com!psinntp!news.osr.com!feanor.osr.com In creating an MDL there are two limits. First, you cannot be mapping more than 2GB (a reasonable limitation, I suppose, although this might change for Enterprise Server systems where you could have a 3GB address space.) Second, the entire MDL must be less than 65536 bytes long. It's this second limitation which is hitting you. Specifically, the largest MDL you can create on a system with a 4K page size would be 67,080,192 which is 64MB-28KB. Why? Because the MDL itself consists of 7 longwords (assuming I counted correctly). If an MDL is restricted to being no more than 64KB long, and it includes a pointer for each 4K page in the memory region, there's a maximum of 16384 - 7 pointers available. On an AXP (Alpha) system you would have a similar situation, except that you would have double the amount of memory addressed (128MB-56KB) since PAGE_SIZE is 8K on that system. So the basic answer is "this is an NT limitation with which you will just have to live". I suppose you could try building your own MDL directly (allocate the memory and call MmInitializeMdl, for example) but I'm not sure if the I/O Manager limit is there because its needed by the Memory Manager, or because the I/O Manager folks though that 64KB was a "big enough" MDL for an NT driver. You can, of course, try it and see if it works... Best of luck! Regards, Tony Mason Consulting Partner OSR Open Systems Resources, Inc. mason@osr.com http://www.osr.com Chris Bartz wrote in message <348C88CE.15538058@natinst.com.nospam>... >If I attempt to call ioAllocateMDL for a block that is larger than 64 >MBytes, it fails. I can >not find any documentation that indicates there is a limit on the size >of memory block >you can create an MDL for so I was wondering if this is a hard limit >that I just have to >live with or is there some way around it. > >My computer has 256 MBytes of physical RAM in it and most of it is >available so >I am not running out of memory. > > >-chris bartz >