From: Marc-Antoine R. <ma...@eo...> - 2004-09-17 18:21:00
|
Here is the prototype I could find out (unverified, never tested): NTSTATUS __stdcall MmMapUserAddressesToPage(PVOID BaseAddress,SIZE_T NumberOfBytes,PVOID PageAddress); - BaseAddress must be user-mode. - I think PageAddress should be locked in memory because it is directly passed to MmGetPhysicalAddress(PageAddress); You can try without locking it. Never tried anyway. but you may use : MmSecureVirtualMemory(); MmMapLockedPagesSpecifyCache(); MmUnsecureVirtualMemory(); When done, do MmUnmapLockedPages() Still haven't tried anything of that, but I'm about to do so. The problem is, indeed, that the pages must be locked in memory... In the first case, maybe you can unlock the pages after doing the call but I'm not sure. Marc-Antoine Ruel "Digital Infra, Inc." <ok...@di...> wrote in message news:200...@wi...... > > >(If I'm talking through my hat, please ignore me and I'll go away > >quietly; I'm just trying to be helpful while being 8 years out of date) > > Not at all! your advice is very useful. > > I have not checked your suggestion well, but APIs you suggested is > very close to what I want. Maybe it is just what I want. > I can not find how to use "MmMapUserAddressesToPage", but if it can > map pages on kernle space described by MDL to a user space, > every prolem solves. > > In other words, I just want to map this "PMDL mdl" to my user space daemon!. > this "PMDL mdl" holds all infomation about coLinux virtual physical pages. > > extracted from src/colinux/os/winnt/kernel/alloc.c > > co_rc_t co_os_get_page(struct co_manager *manager, co_pfn_t *pfn) > > { > > PMDL mdl; > > mdl = MmAllocatePagesForMdl(LowAddress, > > HighAddress, > > SkipBytes, > > PAGE_SIZE); > > } > > > --- Okajima. |