Re: MmGetSystemAddressForMdlSafe
- From: <peterwie@xxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 11 Jul 2006 11:15:33 -0700
Why are you calling it with priority set to High? Is the entire system going to grind to a halt if you don't have your memory?
The function can fail when there's not enough kernel address space avaialble to map the buffer. If the buffer is huge this is going to be very likely. If it's small but KVA is fragmented or you're running with 3GB user-mode address spaces then this is also likely.
MDLs always describe locked memory ranges - if you have one you don't need to lock it. Likewise you don't need to unlock it once you're done with the mapping.
If you want to make forward progress in the face of low resources look at MmAllocateMappingAddress. If you can work on the buffer a little at a time then you should allocate a few pages for reserves & then chunk through the request bit by bit. If you can't then you'll need to pick an arbitrary maximum buffer that you guarantee will work even if resources are low & suggest you clients keep to that if they can't handle errors.
-p
--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.
"Michael" <micbarca@xxxxxxxxxxx> wrote in message news:1152614267.065784.257740@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi
We are using MmGetSystemAddressForMdlSafe function to convert address
from user space to kernel space, we call it with priority parameter set
to High.
When we call this function is sometimes fails and returns NULL.
What can be the reason for this function to fail?
Do i need to lock and MDL before calling this function?
Do i need to unlock the MDL after calling this function?
Is there any other way to convert user mode address to kernel mode
address?
Thanks,
Michael
.
- Prev by Date: Re: Microsecond delay in Windows
- Next by Date: Re: TreeView_GetImageList and TreeView_SetImageList
- Previous by thread: overlapped file I/o and ERROR_NO_SYSTEM_RESOURCES help?
- Next by thread: Re: MmGetSystemAddressForMdlSafe
- Index(es):
Relevant Pages
|