Implement simple trustee functions:

- BuildImpersonateTrustee[A/W]
 - GetMultipleTrustee[A/W]
 - GetMultipleTrusteeOperation[A/W]
 - GetTrusteeForm[A/W]
 - GetTrusteeName[A/W]
 - GetTrusteeType[A/W]

svn path=/trunk/; revision=12136
This commit is contained in:
Eric Kohl 2004-12-15 12:29:36 +00:00
parent 473143e808
commit 6fd5df9a7b
2 changed files with 148 additions and 16 deletions

View file

@ -1,4 +1,4 @@
; $Id: advapi32.def,v 1.27 2004/12/13 19:06:27 weiden Exp $ ; $Id: advapi32.def,v 1.28 2004/12/15 12:29:36 ekohl Exp $
; ;
; advapi32.def ; advapi32.def
; ;
@ -35,8 +35,8 @@ BackupEventLogW@8
;BuildExplicitAccessWithNameW@20 ;BuildExplicitAccessWithNameW@20
;BuildImpersonateExplicitAccessWithNameA@24 ;BuildImpersonateExplicitAccessWithNameA@24
;BuildImpersonateExplicitAccessWithNameW@24 ;BuildImpersonateExplicitAccessWithNameW@24
;BuildImpersonateTrusteeA@8 BuildImpersonateTrusteeA@8
;BuildImpersonateTrusteeW@8 BuildImpersonateTrusteeW@8
;BuildSecurityDescriptorA@36 ;BuildSecurityDescriptorA@36
;BuildSecurityDescriptorW@36 ;BuildSecurityDescriptorW@36
BuildTrusteeWithNameA@8 BuildTrusteeWithNameA@8
@ -148,10 +148,10 @@ GetInheritanceSourceA@40
GetInheritanceSourceW@40 GetInheritanceSourceW@40
GetKernelObjectSecurity@20 GetKernelObjectSecurity@20
GetLengthSid@4 GetLengthSid@4
;GetMultipleTrusteeA@4 GetMultipleTrusteeA@4
;GetMultipleTrusteeOperationA@4 GetMultipleTrusteeOperationA@4
;GetMultipleTrusteeOperationW@4 GetMultipleTrusteeOperationW@4
;GetMultipleTrusteeW@4 GetMultipleTrusteeW@4
GetNamedSecurityInfoA@32 GetNamedSecurityInfoA@32
GetNamedSecurityInfoW@32 GetNamedSecurityInfoW@32
GetNumberOfEventLogRecords@8 GetNumberOfEventLogRecords@8
@ -175,10 +175,12 @@ GetSidLengthRequired@4
GetSidSubAuthority@8 GetSidSubAuthority@8
GetSidSubAuthorityCount@4 GetSidSubAuthorityCount@4
GetTokenInformation@20 GetTokenInformation@20
;GetTrusteeNameA@4 GetTrusteeFormA@4
;GetTrusteeNameW@4 GetTrusteeFormW@4
;GetTrusteeTypeA@4 GetTrusteeNameA@4
;GetTrusteeTypeW@4 GetTrusteeNameW@4
GetTrusteeTypeA@4
GetTrusteeTypeW@4
GetUserNameA@8 GetUserNameA@8
GetUserNameW@8 GetUserNameW@8
;GrantAccessRightsA@16 ;GrantAccessRightsA@16

View file

@ -1,4 +1,4 @@
/* $Id: trustee.c,v 1.2 2004/12/12 15:16:49 ekohl Exp $ /* $Id: trustee.c,v 1.3 2004/12/15 12:29:13 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries * PROJECT: ReactOS system libraries
@ -12,10 +12,35 @@
#include "debug.h" #include "debug.h"
/******************************************************************************
* BuildImpersonateTrusteeA [ADVAPI32.@]
*/
VOID WINAPI
BuildImpersonateTrusteeA(PTRUSTEE_A pTrustee,
PTRUSTEE_A pImpersonateTrustee)
{
pTrustee->pMultipleTrustee = pImpersonateTrustee;
pTrustee->MultipleTrusteeOperation = TRUSTEE_IS_IMPERSONATE;
}
/******************************************************************************
* BuildImpersonateTrusteeW [ADVAPI32.@]
*/
VOID WINAPI
BuildImpersonateTrusteeW(PTRUSTEE_W pTrustee,
PTRUSTEE_W pImpersonateTrustee)
{
pTrustee->pMultipleTrustee = pImpersonateTrustee;
pTrustee->MultipleTrusteeOperation = TRUSTEE_IS_IMPERSONATE;
}
/****************************************************************************** /******************************************************************************
* BuildTrusteeWithSidA [ADVAPI32.@] * BuildTrusteeWithSidA [ADVAPI32.@]
*/ */
VOID WINAPI BuildTrusteeWithSidA(PTRUSTEEA pTrustee, PSID pSid) VOID WINAPI
BuildTrusteeWithSidA(PTRUSTEE_A pTrustee, PSID pSid)
{ {
DPRINT("%p %p\n", pTrustee, pSid); DPRINT("%p %p\n", pTrustee, pSid);
@ -30,7 +55,8 @@ VOID WINAPI BuildTrusteeWithSidA(PTRUSTEEA pTrustee, PSID pSid)
/****************************************************************************** /******************************************************************************
* BuildTrusteeWithSidW [ADVAPI32.@] * BuildTrusteeWithSidW [ADVAPI32.@]
*/ */
VOID WINAPI BuildTrusteeWithSidW(PTRUSTEEW pTrustee, PSID pSid) VOID WINAPI
BuildTrusteeWithSidW(PTRUSTEE_W pTrustee, PSID pSid)
{ {
DPRINT("%p %p\n", pTrustee, pSid); DPRINT("%p %p\n", pTrustee, pSid);
@ -45,7 +71,8 @@ VOID WINAPI BuildTrusteeWithSidW(PTRUSTEEW pTrustee, PSID pSid)
/****************************************************************************** /******************************************************************************
* BuildTrusteeWithNameA [ADVAPI32.@] * BuildTrusteeWithNameA [ADVAPI32.@]
*/ */
VOID WINAPI BuildTrusteeWithNameA(PTRUSTEEA pTrustee, LPSTR name) VOID WINAPI
BuildTrusteeWithNameA(PTRUSTEE_A pTrustee, LPSTR name)
{ {
DPRINT("%p %s\n", pTrustee, name); DPRINT("%p %s\n", pTrustee, name);
@ -60,7 +87,8 @@ VOID WINAPI BuildTrusteeWithNameA(PTRUSTEEA pTrustee, LPSTR name)
/****************************************************************************** /******************************************************************************
* BuildTrusteeWithNameW [ADVAPI32.@] * BuildTrusteeWithNameW [ADVAPI32.@]
*/ */
VOID WINAPI BuildTrusteeWithNameW(PTRUSTEEW pTrustee, LPWSTR name) VOID WINAPI
BuildTrusteeWithNameW(PTRUSTEE_W pTrustee, LPWSTR name)
{ {
DPRINT("%p %s\n", pTrustee, name); DPRINT("%p %s\n", pTrustee, name);
@ -70,3 +98,105 @@ VOID WINAPI BuildTrusteeWithNameW(PTRUSTEEW pTrustee, LPWSTR name)
pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN; pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN;
pTrustee->ptstrName = name; pTrustee->ptstrName = name;
} }
/******************************************************************************
* GetMultipleTrusteeA [ADVAPI32.@]
*/
PTRUSTEEA WINAPI
GetMultipleTrusteeA(PTRUSTEE_A pTrustee)
{
return pTrustee->pMultipleTrustee;
}
/******************************************************************************
* GetMultipleTrusteeW [ADVAPI32.@]
*/
PTRUSTEEW WINAPI
GetMultipleTrusteeW(PTRUSTEE_W pTrustee)
{
return pTrustee->pMultipleTrustee;
}
/******************************************************************************
* GetMultipleTrusteeOperationA [ADVAPI32.@]
*/
MULTIPLE_TRUSTEE_OPERATION WINAPI
GetMultipleTrusteeOperationA(PTRUSTEE_A pTrustee)
{
return pTrustee->MultipleTrusteeOperation;
}
/******************************************************************************
* GetMultipleTrusteeOperationW [ADVAPI32.@]
*/
MULTIPLE_TRUSTEE_OPERATION WINAPI
GetMultipleTrusteeOperationW(PTRUSTEE_W pTrustee)
{
return pTrustee->MultipleTrusteeOperation;
}
/******************************************************************************
* GetTrusteeFormW [ADVAPI32.@]
*/
TRUSTEE_FORM WINAPI
GetTrusteeFormA(PTRUSTEE_A pTrustee)
{
return pTrustee->TrusteeForm;
}
/******************************************************************************
* GetTrusteeFormW [ADVAPI32.@]
*/
TRUSTEE_FORM WINAPI
GetTrusteeFormW(PTRUSTEE_W pTrustee)
{
return pTrustee->TrusteeForm;
}
/******************************************************************************
* GetTrusteeNameA [ADVAPI32.@]
*/
LPSTR WINAPI
GetTrusteeNameA(PTRUSTEE_A pTrustee)
{
return (pTrustee->TrusteeForm == TRUSTEE_IS_NAME) ? pTrustee->ptstrName : NULL;
}
/******************************************************************************
* GetTrusteeNameW [ADVAPI32.@]
*/
LPWSTR WINAPI
GetTrusteeNameW(PTRUSTEE_W pTrustee)
{
return (pTrustee->TrusteeForm == TRUSTEE_IS_NAME) ? pTrustee->ptstrName : NULL;
}
/******************************************************************************
* GetTrusteeTypeA [ADVAPI32.@]
*/
TRUSTEE_TYPE WINAPI
GetTrusteeTypeA(PTRUSTEE_A pTrustee)
{
return pTrustee->TrusteeType;
}
/******************************************************************************
* GetTrusteeTypeW [ADVAPI32.@]
*/
TRUSTEE_TYPE WINAPI
GetTrusteeTypeW(PTRUSTEE_W pTrustee)
{
return pTrustee->TrusteeType;
}
/* EOF */