mardi 31 mars 2015

Shared memory between kernel and user mode. How to share handle?

I am trying to use shared memory between user process and kernel.


Option one - to let kernel to create section and let user mode app to open memory by name "Global\my_mem". It's working only in read-only mode. When I am trying to open section with FILE_MAP_WRITE it gives access denied(5). Not sure how to grant access or modify DACL.


Option two - pass handle back via IOCTL. This one is questionable since handle to section opened in KERNEL is 0xFFFFFFFF80001234. My understanding that handles that have any of upper bits set can not be used in user mode. Especially if app will be 32-bit :) Initially I expected that section handle will be somewhat similar to kernel file handle and I will be able to use it.


What would be the correct approach to establish shared memory channel between kernel and user mode?


Aucun commentaire:

Enregistrer un commentaire