mirror of
https://github.com/reactos/reactos.git
synced 2025-04-18 03:34:11 +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
|
@ -762,4 +762,41 @@ GetW32ThreadInfo(VOID)
|
|||
return (PTHREADINFO)PsGetCurrentThreadWin32Thread();
|
||||
}
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -105,6 +105,11 @@ PTHREADINFO FASTCALL IntTID2PTI(HANDLE);
|
|||
HBRUSH FASTCALL GetControlBrush(PWND,HDC,UINT);
|
||||
HBRUSH FASTCALL GetControlColor(PWND,PWND,HDC,UINT);
|
||||
|
||||
NTSTATUS
|
||||
GetProcessLuid(
|
||||
IN PETHREAD Thread OPTIONAL,
|
||||
OUT PLUID Luid);
|
||||
|
||||
/*************** MESSAGE.C ***************/
|
||||
|
||||
BOOL FASTCALL UserPostMessage(HWND Wnd,UINT Msg, WPARAM wParam, LPARAM lParam);
|
||||
|
|
Loading…
Reference in a new issue