ZwOpenSection - correct object name parameter

This is about sharing memory between user and kernel mode, (aware that IOCTL’S can be used but that’s not the point). The app should create a named memory mapped file, the driver would open and use it, the app can run without elevated privilege. I call CreateFileMapping and pass the name “Local\TestMemoryMap1234”. WinObj shows the object is created and it is living under “\Sessions\1\BaseNamedObjects\TestMemoryMap1234” in Windows 10 (I remember it used to live under \BaseNamedObjects\ years ago, something has obviously changed in Win10).

What is the correct name should I pass to ZwOpenSection in the driver to open this memory mapped file?

“\BaseNamedObjects\TestMemoryMap1234” results in error STATUS_OBJECT_NAME_NOT_FOUND, which indicates that I am not passing the correct name.

Any help?

Running the app elevated allows it to live under global namespace (“Global\TestMemoryMap1234”) which lets the driver open the section “\BaseNamedObjects\TestMemoryMap1234”.