Eryk Sun <[email protected]> added the comment:
> 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
----------
nosy: +eryksun
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue46888>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com