pass LUIDs to RosEnableThreadPrivileges()

svn path=/trunk/; revision=10496
This commit is contained in:
Thomas Bluemel 2004-08-11 08:48:20 +00:00
parent 2f6a9da97d
commit 86f612b5f1
2 changed files with 5 additions and 6 deletions

View file

@ -1,4 +1,4 @@
/* $Id: priv.h,v 1.1 2004/08/11 08:28:13 weiden Exp $ /* $Id: priv.h,v 1.2 2004/08/11 08:48:20 weiden Exp $
*/ */
#ifndef ROSRTL_SEC_H__ #ifndef ROSRTL_SEC_H__
@ -10,7 +10,7 @@ extern "C"
#endif #endif
BOOL BOOL
RosEnableThreadPrivileges(HANDLE *hToken, DWORD *Privileges, DWORD PrivilegeCount); RosEnableThreadPrivileges(HANDLE *hToken, LUID *Privileges, DWORD PrivilegeCount);
BOOL BOOL
RosResetThreadPrivileges(HANDLE hToken); RosResetThreadPrivileges(HANDLE hToken);

View file

@ -6,14 +6,14 @@
* Utility to copy and enable thread privileges * Utility to copy and enable thread privileges
* *
* OUT HANDLE *hPreviousToken -> Pointer to a variable that receives the previous token handle * OUT HANDLE *hPreviousToken -> Pointer to a variable that receives the previous token handle
* IN DWORD *Privileges -> Points to an array of privileges to be enabled * IN LUID *Privileges -> Points to an array of privileges to be enabled
* IN DWORD PrivilegeCount -> Number of the privileges in the array * IN DWORD PrivilegeCount -> Number of the privileges in the array
* *
* Returns TRUE on success and copies the thread token (if any) handle that was active before impersonation. * Returns TRUE on success and copies the thread token (if any) handle that was active before impersonation.
*/ */
BOOL BOOL
RosEnableThreadPrivileges(HANDLE *hPreviousToken, RosEnableThreadPrivileges(HANDLE *hPreviousToken,
DWORD *Privileges, LUID *Privileges,
DWORD PrivilegeCount) DWORD PrivilegeCount)
{ {
HANDLE hToken; HANDLE hToken;
@ -55,8 +55,7 @@ RosEnableThreadPrivileges(HANDLE *hPreviousToken,
privs->PrivilegeCount = PrivilegeCount; privs->PrivilegeCount = PrivilegeCount;
for(la = privs->Privileges; PrivilegeCount-- > 0; la++) for(la = privs->Privileges; PrivilegeCount-- > 0; la++)
{ {
la->Luid.LowPart = *(Privileges++); la->Luid = *(Privileges++);
la->Luid.HighPart = 0;
la->Attributes = SE_PRIVILEGE_ENABLED; la->Attributes = SE_PRIVILEGE_ENABLED;
} }