On Wed Jan 31 18:02:03 2024 +0000, Paul Gofman wrote:
Of course, I guess this exact snippet will break right at `NtClose( handle );`which will destroy the mapping. But it is not the core problem even, that can probably be worked around somehow, just it seems obvious to me that doing lower level management of Nt objects behind the back of their implementation leaves them in a broken state and we'll have to keep that in mind and workaround on various occasions, it just doesn't worth mixing those.
That applies the same for KUSD, which I don't think is a section object on Windows. But even then, the object is never intended to be exposed to the user anyway so I'd say we've already lost the moment the existence (and, transitively, its potentially-broken state) of the mapping object becomes publicly accessible to the app.