2013-03-16 20:41:13 +00:00
|
|
|
/*
|
2004-12-11 00:21:33 +00:00
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS system libraries
|
2004-12-12 15:17:38 +00:00
|
|
|
* FILE: lib/advapi32/sec/trustee.c
|
|
|
|
* PURPOSE: Trustee functions
|
2004-12-11 00:21:33 +00:00
|
|
|
*/
|
|
|
|
|
2005-08-05 10:31:28 +00:00
|
|
|
#include <advapi32.h>
|
2004-12-11 00:21:33 +00:00
|
|
|
|
2004-12-15 12:29:36 +00:00
|
|
|
/******************************************************************************
|
|
|
|
* BuildImpersonateTrusteeA [ADVAPI32.@]
|
|
|
|
*/
|
|
|
|
VOID WINAPI
|
|
|
|
BuildImpersonateTrusteeA(PTRUSTEE_A pTrustee,
|
|
|
|
PTRUSTEE_A pImpersonateTrustee)
|
|
|
|
{
|
2008-09-21 13:55:53 +00:00
|
|
|
pTrustee->pMultipleTrustee = pImpersonateTrustee;
|
|
|
|
pTrustee->MultipleTrusteeOperation = TRUSTEE_IS_IMPERSONATE;
|
2004-12-15 12:29:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* BuildImpersonateTrusteeW [ADVAPI32.@]
|
|
|
|
*/
|
|
|
|
VOID WINAPI
|
|
|
|
BuildImpersonateTrusteeW(PTRUSTEE_W pTrustee,
|
|
|
|
PTRUSTEE_W pImpersonateTrustee)
|
|
|
|
{
|
2008-09-21 13:55:53 +00:00
|
|
|
pTrustee->pMultipleTrustee = pImpersonateTrustee;
|
|
|
|
pTrustee->MultipleTrusteeOperation = TRUSTEE_IS_IMPERSONATE;
|
2004-12-15 12:29:36 +00:00
|
|
|
}
|
|
|
|
|
2005-01-04 09:35:28 +00:00
|
|
|
/******************************************************************************
|
|
|
|
* BuildImpersonateExplicitAccessWithNameA [ADVAPI32.@]
|
|
|
|
*/
|
|
|
|
VOID WINAPI
|
|
|
|
BuildImpersonateExplicitAccessWithNameA(PEXPLICIT_ACCESS_A pExplicitAccess,
|
|
|
|
LPSTR pTrusteeName,
|
|
|
|
PTRUSTEE_A pTrustee,
|
|
|
|
DWORD AccessPermissions,
|
|
|
|
ACCESS_MODE AccessMode,
|
|
|
|
DWORD Inheritance)
|
|
|
|
{
|
|
|
|
pExplicitAccess->grfAccessPermissions = AccessPermissions;
|
|
|
|
pExplicitAccess->grfAccessMode = AccessMode;
|
|
|
|
pExplicitAccess->grfInheritance = Inheritance;
|
|
|
|
|
|
|
|
pExplicitAccess->Trustee.pMultipleTrustee = pTrustee;
|
|
|
|
pExplicitAccess->Trustee.MultipleTrusteeOperation = TRUSTEE_IS_IMPERSONATE;
|
|
|
|
pExplicitAccess->Trustee.TrusteeForm = TRUSTEE_IS_NAME;
|
|
|
|
pExplicitAccess->Trustee.TrusteeType = TRUSTEE_IS_UNKNOWN;
|
|
|
|
pExplicitAccess->Trustee.ptstrName = pTrusteeName;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* BuildImpersonateExplicitAccessWithNameW [ADVAPI32.@]
|
|
|
|
*/
|
|
|
|
VOID WINAPI
|
|
|
|
BuildImpersonateExplicitAccessWithNameW(PEXPLICIT_ACCESS_W pExplicitAccess,
|
|
|
|
LPWSTR pTrusteeName,
|
|
|
|
PTRUSTEE_W pTrustee,
|
|
|
|
DWORD AccessPermissions,
|
|
|
|
ACCESS_MODE AccessMode,
|
|
|
|
DWORD Inheritance)
|
|
|
|
{
|
|
|
|
pExplicitAccess->grfAccessPermissions = AccessPermissions;
|
|
|
|
pExplicitAccess->grfAccessMode = AccessMode;
|
|
|
|
pExplicitAccess->grfInheritance = Inheritance;
|
|
|
|
|
|
|
|
pExplicitAccess->Trustee.pMultipleTrustee = pTrustee;
|
|
|
|
pExplicitAccess->Trustee.MultipleTrusteeOperation = TRUSTEE_IS_IMPERSONATE;
|
|
|
|
pExplicitAccess->Trustee.TrusteeForm = TRUSTEE_IS_NAME;
|
|
|
|
pExplicitAccess->Trustee.TrusteeType = TRUSTEE_IS_UNKNOWN;
|
|
|
|
pExplicitAccess->Trustee.ptstrName = pTrusteeName;
|
|
|
|
}
|
|
|
|
|
2004-12-15 12:29:36 +00:00
|
|
|
/******************************************************************************
|
|
|
|
* GetMultipleTrusteeA [ADVAPI32.@]
|
|
|
|
*/
|
|
|
|
PTRUSTEEA WINAPI
|
|
|
|
GetMultipleTrusteeA(PTRUSTEE_A pTrustee)
|
|
|
|
{
|
2008-09-21 13:55:53 +00:00
|
|
|
return pTrustee->pMultipleTrustee;
|
2004-12-15 12:29:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* GetMultipleTrusteeW [ADVAPI32.@]
|
|
|
|
*/
|
|
|
|
PTRUSTEEW WINAPI
|
|
|
|
GetMultipleTrusteeW(PTRUSTEE_W pTrustee)
|
|
|
|
{
|
2008-09-21 13:55:53 +00:00
|
|
|
return pTrustee->pMultipleTrustee;
|
2004-12-15 12:29:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* GetMultipleTrusteeOperationA [ADVAPI32.@]
|
|
|
|
*/
|
|
|
|
MULTIPLE_TRUSTEE_OPERATION WINAPI
|
|
|
|
GetMultipleTrusteeOperationA(PTRUSTEE_A pTrustee)
|
|
|
|
{
|
2008-09-21 13:55:53 +00:00
|
|
|
return pTrustee->MultipleTrusteeOperation;
|
2004-12-15 12:29:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* GetMultipleTrusteeOperationW [ADVAPI32.@]
|
|
|
|
*/
|
|
|
|
MULTIPLE_TRUSTEE_OPERATION WINAPI
|
|
|
|
GetMultipleTrusteeOperationW(PTRUSTEE_W pTrustee)
|
|
|
|
{
|
2008-09-21 13:55:53 +00:00
|
|
|
return pTrustee->MultipleTrusteeOperation;
|
2004-12-15 12:29:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* EOF */
|