Re: Get Handle Owner,...
- From: "Volodymyr M. Shcherbyna" <v_scherbina@xxxxxxxxxxxxxxx>
- Date: Wed, 4 Jun 2008 10:33:00 +0200
In other words, you want to get SID of user which run the process or
service? If so, ZwOpenProcessToken to open process, and
ZwQueryInformationToken with TokenUser to get SID.
--
V.
This posting is provided "AS IS" with no warranties, and confers no
rights.
"Kerem Gümrükcü" <kareem114@xxxxxxxxxxx> wrote in message
news:OYXXsFhxIHA.3968@xxxxxxxxxxxxxxxxxxxxxxx
Hi Jeroen ,
the point is, that i operate from Mannaged .NET Code
and i have several Process Handles and Ids and Service
Handles. I need to know in which Context they Run. I
expressed myelf a little unclear. I need a reliable way to
get the user context in which they run. I used the method
of GetTheToken->DuplicateIt->Impersonate->GetThe
UserName->RevertToSelf->CloseTheToken. But is there
another way? I got the process and service handles. The
more Problem are the Service Handles here: How do i get
the User Context from just a service handle?
Regards
Kerem
--
--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."
"Jeroen Mostert" <jmostert@xxxxxxxxx> schrieb im Newsbeitrag
news:484626c4$0$14351$e4fe514c@xxxxxxxxxxxxxxxxx
Kerem Gümrükcü wrote:created
my application has sufficient privileges enabledWhat you seem to be asking for is "the SID of the owner of the token
and i can open any process,thread,kernel/user-object
to query information from the objects. The Point is
that i want to find out, from who owns this handle, e.g.
the Username of the Owner. Calls to GetKernelObjectSecurity
and GetUserObjectSecurity return sometimes different information
than e.g. Process Explorer. I also dont want to do things like
get the process token->Impersonate->GetUserName->RevertToSelf.
Calls to GetSecurityInfo also just return owner of the token, but
not the Usercontext that was responsible for the creation of the
Token. Invoking LookupAccountSid works just fine after i got
the sid buffers. I hope, you know what i want to do. Who created
the handle and in what user context has it been created,...
associated with the thread that created the object at the moment it
it". AFAIK, that information is not recorded anywhere -- the system doeshence
record which process created an object (if any), but that's it. A
security
descriptor contains the SID of the owner, which need not have any
relation
to who created the object, and it can always be changed afterwards.
Take care also to distinguish between handles and objects. Objects have
owners, handles belong to processes. An object has only one DACL (and
only one owner), a handle can be duplicated among many processes. It's
not
entirely clear what you want or whether what you want makes sense.
--
J.
http://symbolsprose.blogspot.com
.
- Follow-Ups:
- Re: Get Handle Owner,...
- From: Kerem Gümrükcü
- Re: Get Handle Owner,...
- References:
- Get Handle Owner,...
- From: Kerem Gümrükcü
- Re: Get Handle Owner,...
- From: Jeroen Mostert
- Re: Get Handle Owner,...
- From: Kerem Gümrükcü
- Get Handle Owner,...
- Prev by Date: Re: Device Driver that uploads it's own code?
- Next by Date: Need help about lock hierarchy design
- Previous by thread: Re: Get Handle Owner,...
- Next by thread: Re: Get Handle Owner,...
- Index(es):
Relevant Pages
|
Loading