This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients eryksun, paul.moore, ronny-rentner, steve.dower, tim.golden, zach.ware
Date 2022-03-01.13:03:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1646139817.77.0.425716411412.issue46888@roundup.psfhosted.org>
In-reply-to
Content
> Yes, named memory mappings only exist on Windows until the last 
> reference is closed, so this is a difference due to the underlying OS. 

That's true for the Windows API, so it's true for all practical purposes. In the underlying NT API, creating a permanent kernel object is possible by setting OBJ_PERMANENT in the initial object attributes [1], or subsequently via the undocumented system call NtMakePermanentObject(handle). Creating a permanent object requires SeCreatePermanentPrivilege, which normally is granted to just the SYSTEM account. An administrator can grant this privilege to any user, group, or well-known group, but creating permanent objects should generally be limited to drivers and system services. An object can be reverted back to a temporary object via NtMakeTemporaryObject(handle).

A named section object (i.e. file mapping) can also be created as a global name, i.e. r"Global\{object name}", which is accessible to all sessions. This requires SeCreateGlobalPrivilege, which by default is granted to system service accounts and administrators. This is separate from whether the section is temporary or permanent, but a permanent section object is more likely to be needed in the global namespace.

---

[1] https://docs.microsoft.com/en-us/windows/win32/api/ntdef/nf-ntdef-initializeobjectattributes
[2] https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-zwmaketemporaryobject
History
Date User Action Args
2022-03-01 13:03:37eryksunsetrecipients: + eryksun, paul.moore, tim.golden, zach.ware, steve.dower, ronny-rentner
2022-03-01 13:03:37eryksunsetmessageid: <1646139817.77.0.425716411412.issue46888@roundup.psfhosted.org>
2022-03-01 13:03:37eryksunlinkissue46888 messages
2022-03-01 13:03:37eryksuncreate