[Autogenerated] I've written some code here.
To show how to build this private namespace So let's go ahead.
And run this code step by step.
And See what happens.
Let let just switch to the correct project of course,
and We'll see what happens in every stage.
And then We'll also see what the actual name of an object will be
once we're done with what we're doing here.
So the first thing we need to do is create something
called the boundary descriptor, boundary descriptor,
is a helper object,
that can further provide more I would say control over which users can access
that particular private namespace We're about to build.
So in this case, what I'm doing, I'm creating a seed,
which is the well known seed, which is the users seed,
which essentially means that Every authenticated user is allowed.
To use this particular namespace I'll be building in a moment,
and then calling add seeds, to boundary descriptor here,
to perform the actual operation.
And Of course, you can add more seeds or changes.
To something completely different.
I'm not going to go over that in detail.
Since this is a bit out of scope for these core In any case.
That would be probably the simplest way.
To allow normal users.
To access these namespace We're about to create.
So here's our namespace using the create private namespace API Now,
in the case,
the function might fail because maybe the namespace exists or and since
the private namespace is not truly a kernel object,
in the normal sense of the world, that we discussed so far,
it's not behaving as a create or open but it only tries to
create a new namespace I'm not giving it some private name
here called my namespace If it fails.
We can Go ahead.
And try to open, a handle,
to that existing namespace because maybe I'm the second process that's
trying to Use the same namespace and That's fine.
In this case,
I'm just the first of these create operation succeeds and here here,
is where we are actually performing the creation of some kernel object.
In this example, I'm using a section object or a file mapping object.
But it doesn't matter.
It works with any named object like a mutt,
check Sema, four an event anything, that can have a name,
and I'm using the prefix here as my namespace as the
associated with this boundary descriptor.
So this is the private namespace I'm using here,
and this is the actual name I want to use for that object for sharing purposes.
So if I have another process performing the same kinds of operations,
opening, a boundary descriptor, you don't have to create it.
You can actually open it if it exists already.
And then using the same name with this particular string here.
Then you'll get another handle.
To the same object.
Let's do that So we get some handle here which has a value,
E eight Let's see what that looks like in process explorer,
our application,
is called private namespace dot ec That's the one executable here.
And Notice the handle for the section with the value E,
eight Notice the name this is the name that we see in process explorer,
and cross explore uses the most powerful APIs you can have
from user mode to obtain these names.
So even cross explore, is unable to locate the real name of the object.
So there's no way to foil.
The process by trying to grab an existing handle or another handle.
To that object, you just can't do that because the names,
are not visible anymore.
At least by name you cannot get another handle.
To the same object.
So this is private object name spaces, which is an available feature,
in order to have your cake, and eat it too.
So essentially you can continue sharing by name which is a very easy way.
To share, kernel objects, but still have those names hidden.
So, that processes,
that shouldn't really be able to use these objects
will not be able to use those.