1

I am writing some proof of concept code for KVM for communication between Windows 10 and the Host Linux system.

What I have is a virtual RAM device that is actually connected to a shared memory segment on the Host. The PCIe BAR 2 is a direct mapping to this RAM.

My intent is to provide a high bandwidth low latency means of transferring data that doesn't involve other common means used (sockets, etc). ZeroCopy would be ideal.

So far I have pretty much everything working, I have written a driver that calls MmAllocateMdlForIoSpace and then maps the memory using MmMapLockedPagesSpecifyCache to user mode via a DeviceIOControl. This works perfectly, the user mode application is able to address the shared memory and write to it.

What I am missing is the ability to use CreateFileMapping in user mode to obtain a HANDLE to a mapping of this memory. I am fairly new to windows driver programming and as such I am uncertain as to if this is even possible. Any pointers as to the best way to achieve this would be very helpful.

Geoffrey
  • 10,843
  • 3
  • 33
  • 46
  • I don't *think* that's possible, a memory section must be backed either by a specific file or by the pagefile. There's no provision that I can see for a memory section that is backed by memory-mapped I/O. Interesting idea though. One of the experts may be able to answer more definitively. – Harry Johnston Oct 09 '17 at 02:01

0 Answers0