Prev: Execute user code from kernel
Next: RegisterDeviceNotification fails with ERROR_SERVICE_SPECIFIC_ERROR (1066)
From: ysht on 5 Jul 2010 01:19 Hi, I'm Yot and I'm writing a driver. Here is my driver code: === DeviceExtension->SystemVirtualAddress = ExAllocatePool( NonPagedPool , Size6M ); DeviceExtension->Mdl = IoAllocateMdl( DeviceExtension->SystemVirtualAddress, Size6M, FALSE, FALSE, NULL ); DeviceExtension->UserVirtualAddress = MmMapLockedPagesSpecifyCache( DeviceExtension->Mdl, UserMode, MmNonCached, NULL, FALSE, NormalPagePriority); --- After MmMapLockedPagesSpecifyCache returns the address of the mapped pages, my application code accesses the address with it. === This code and my application code works well in WindowsXP Professional Version 2002 SP3. But in Windows Server 2003 R2 Standard Edition SP3, MmMapLockedPagesSpecifyCache returns non-NULL value but my application code can't access the address with it. Therefore I use WindowsXP,but want to actually Windows Server 2003 now. Can anyone provide suggestions ? Any help or guidance would be appreciated. Thanks!
From: David Craig on 5 Jul 2010 03:17 This newsgroup is for Win32 where it intersects the kernel. This is not a device driver forum except for those few in the win32 arena. Sharing kernel memory with a user mode program is a very difficult task to master and usually leads to security holes unless the driver writer is very experienced (10 years or more in kernel mode). "ysht" <yshtnoo(a)gmail.com> wrote in message news:urf62IAHLHA.1016(a)TK2MSFTNGP06.phx.gbl... > Hi, > I'm Yot and I'm writing a driver. > > Here is my driver code: > === > DeviceExtension->SystemVirtualAddress = ExAllocatePool( NonPagedPool , > Size6M ); > DeviceExtension->Mdl = IoAllocateMdl( > DeviceExtension->SystemVirtualAddress, > Size6M, FALSE, FALSE, NULL ); > DeviceExtension->UserVirtualAddress = MmMapLockedPagesSpecifyCache( > DeviceExtension->Mdl, > UserMode, MmNonCached, NULL, > FALSE, NormalPagePriority); > --- > After MmMapLockedPagesSpecifyCache returns the address of the mapped > pages, > my application code accesses the address with it. > === > > This code and my application code works well in WindowsXP > Professional Version 2002 SP3. > But in Windows Server 2003 R2 Standard Edition SP3, > MmMapLockedPagesSpecifyCache returns non-NULL value but my application > code > can't access the address with it. > > Therefore I use WindowsXP,but want to actually Windows Server 2003 now. > > Can anyone provide suggestions ? > Any help or guidance would be appreciated. > > Thanks! > >
From: ysht on 5 Jul 2010 05:34
David,thank you very much. I'm sorry that I took wrong what I contributed to here because I had had all of you help here before. Yot. (2010/07/05 16:17), David Craig wrote: > This newsgroup is for Win32 where it intersects the kernel. This is not > a device driver forum except for those few in the win32 arena. Sharing > kernel memory with a user mode program is a very difficult task to > master and usually leads to security holes unless the driver writer is > very experienced (10 years or more in kernel mode). > > > "ysht" <yshtnoo(a)gmail.com> wrote in message > news:urf62IAHLHA.1016(a)TK2MSFTNGP06.phx.gbl... >> Hi, >> I'm Yot and I'm writing a driver. >> >> Here is my driver code: >> === >> DeviceExtension->SystemVirtualAddress = ExAllocatePool( NonPagedPool , >> Size6M ); >> DeviceExtension->Mdl = IoAllocateMdl( >> DeviceExtension->SystemVirtualAddress, >> Size6M, FALSE, FALSE, NULL ); >> DeviceExtension->UserVirtualAddress = MmMapLockedPagesSpecifyCache( >> DeviceExtension->Mdl, >> UserMode, MmNonCached, NULL, >> FALSE, NormalPagePriority); >> --- >> After MmMapLockedPagesSpecifyCache returns the address of the mapped >> pages, >> my application code accesses the address with it. >> === >> >> This code and my application code works well in WindowsXP >> Professional Version 2002 SP3. >> But in Windows Server 2003 R2 Standard Edition SP3, >> MmMapLockedPagesSpecifyCache returns non-NULL value but my application >> code >> can't access the address with it. >> >> Therefore I use WindowsXP,but want to actually Windows Server 2003 now. >> >> Can anyone provide suggestions ? >> Any help or guidance would be appreciated. >> >> Thanks! >> >> |