mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 17:53:21 +00:00
[WIN32K:NTUSER] Move the GetProcessLuid() function to the miscellaneous module.
This commit is contained in:
parent
9c0564063d
commit
d77c493213
3 changed files with 42 additions and 36 deletions
|
@ -88,42 +88,6 @@ IntClientShutdown(IN PWND pWindow,
|
|||
return lResult;
|
||||
}
|
||||
|
||||
|
||||
NTSTATUS
|
||||
GetProcessLuid(IN PETHREAD Thread OPTIONAL,
|
||||
OUT PLUID Luid)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
PACCESS_TOKEN Token;
|
||||
SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
|
||||
BOOLEAN CopyOnOpen, EffectiveOnly;
|
||||
|
||||
if (Thread == NULL)
|
||||
Thread = PsGetCurrentThread();
|
||||
|
||||
/* Use a thread token */
|
||||
Token = PsReferenceImpersonationToken(Thread,
|
||||
&CopyOnOpen,
|
||||
&EffectiveOnly,
|
||||
&ImpersonationLevel);
|
||||
if (Token == NULL)
|
||||
{
|
||||
/* We don't have a thread token, use a process token */
|
||||
Token = PsReferencePrimaryToken(PsGetThreadProcess(Thread));
|
||||
|
||||
/* If no token, fail */
|
||||
if (Token == NULL)
|
||||
return STATUS_NO_TOKEN;
|
||||
}
|
||||
|
||||
/* Query the LUID */
|
||||
Status = SeQueryAuthenticationIdToken(Token, Luid);
|
||||
|
||||
/* Get rid of the token and return */
|
||||
ObDereferenceObject(Token);
|
||||
return Status;
|
||||
}
|
||||
|
||||
BOOLEAN
|
||||
HasPrivilege(IN PPRIVILEGE_SET Privilege)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue