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__
@ -10,7 +10,7 @@ extern "C"
#endif
BOOL
RosEnableThreadPrivileges(HANDLE *hToken, DWORD *Privileges, DWORD PrivilegeCount);
RosEnableThreadPrivileges(HANDLE *hToken, LUID *Privileges, DWORD PrivilegeCount);
BOOL
RosResetThreadPrivileges(HANDLE hToken);

View file

@ -6,14 +6,14 @@
* Utility to copy and enable thread privileges
*
* 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
*
* Returns TRUE on success and copies the thread token (if any) handle that was active before impersonation.
*/
BOOL
RosEnableThreadPrivileges(HANDLE *hPreviousToken,
DWORD *Privileges,
LUID *Privileges,
DWORD PrivilegeCount)
{
HANDLE hToken;
@ -55,8 +55,7 @@ RosEnableThreadPrivileges(HANDLE *hPreviousToken,
privs->PrivilegeCount = PrivilegeCount;
for(la = privs->Privileges; PrivilegeCount-- > 0; la++)
{
la->Luid.LowPart = *(Privileges++);
la->Luid.HighPart = 0;
la->Luid = *(Privileges++);
la->Attributes = SE_PRIVILEGE_ENABLED;
}