From 6fd5df9a7be8d94a636c1e938f86b70766ba2388 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Wed, 15 Dec 2004 12:29:36 +0000 Subject: [PATCH] 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 --- reactos/lib/advapi32/advapi32.def | 24 ++--- reactos/lib/advapi32/sec/trustee.c | 140 +++++++++++++++++++++++++++-- 2 files changed, 148 insertions(+), 16 deletions(-) diff --git a/reactos/lib/advapi32/advapi32.def b/reactos/lib/advapi32/advapi32.def index bb8151504f6..912ad498a65 100644 --- a/reactos/lib/advapi32/advapi32.def +++ b/reactos/lib/advapi32/advapi32.def @@ -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 ; @@ -35,8 +35,8 @@ BackupEventLogW@8 ;BuildExplicitAccessWithNameW@20 ;BuildImpersonateExplicitAccessWithNameA@24 ;BuildImpersonateExplicitAccessWithNameW@24 -;BuildImpersonateTrusteeA@8 -;BuildImpersonateTrusteeW@8 +BuildImpersonateTrusteeA@8 +BuildImpersonateTrusteeW@8 ;BuildSecurityDescriptorA@36 ;BuildSecurityDescriptorW@36 BuildTrusteeWithNameA@8 @@ -148,10 +148,10 @@ GetInheritanceSourceA@40 GetInheritanceSourceW@40 GetKernelObjectSecurity@20 GetLengthSid@4 -;GetMultipleTrusteeA@4 -;GetMultipleTrusteeOperationA@4 -;GetMultipleTrusteeOperationW@4 -;GetMultipleTrusteeW@4 +GetMultipleTrusteeA@4 +GetMultipleTrusteeOperationA@4 +GetMultipleTrusteeOperationW@4 +GetMultipleTrusteeW@4 GetNamedSecurityInfoA@32 GetNamedSecurityInfoW@32 GetNumberOfEventLogRecords@8 @@ -175,10 +175,12 @@ GetSidLengthRequired@4 GetSidSubAuthority@8 GetSidSubAuthorityCount@4 GetTokenInformation@20 -;GetTrusteeNameA@4 -;GetTrusteeNameW@4 -;GetTrusteeTypeA@4 -;GetTrusteeTypeW@4 +GetTrusteeFormA@4 +GetTrusteeFormW@4 +GetTrusteeNameA@4 +GetTrusteeNameW@4 +GetTrusteeTypeA@4 +GetTrusteeTypeW@4 GetUserNameA@8 GetUserNameW@8 ;GrantAccessRightsA@16 diff --git a/reactos/lib/advapi32/sec/trustee.c b/reactos/lib/advapi32/sec/trustee.c index 7745615f1fa..9cd3de285c4 100644 --- a/reactos/lib/advapi32/sec/trustee.c +++ b/reactos/lib/advapi32/sec/trustee.c @@ -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 * PROJECT: ReactOS system libraries @@ -12,10 +12,35 @@ #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.@] */ -VOID WINAPI BuildTrusteeWithSidA(PTRUSTEEA pTrustee, PSID pSid) +VOID WINAPI +BuildTrusteeWithSidA(PTRUSTEE_A pTrustee, PSID pSid) { DPRINT("%p %p\n", pTrustee, pSid); @@ -30,7 +55,8 @@ VOID WINAPI BuildTrusteeWithSidA(PTRUSTEEA pTrustee, PSID pSid) /****************************************************************************** * BuildTrusteeWithSidW [ADVAPI32.@] */ -VOID WINAPI BuildTrusteeWithSidW(PTRUSTEEW pTrustee, PSID pSid) +VOID WINAPI +BuildTrusteeWithSidW(PTRUSTEE_W pTrustee, PSID pSid) { DPRINT("%p %p\n", pTrustee, pSid); @@ -45,7 +71,8 @@ VOID WINAPI BuildTrusteeWithSidW(PTRUSTEEW pTrustee, PSID pSid) /****************************************************************************** * BuildTrusteeWithNameA [ADVAPI32.@] */ -VOID WINAPI BuildTrusteeWithNameA(PTRUSTEEA pTrustee, LPSTR name) +VOID WINAPI +BuildTrusteeWithNameA(PTRUSTEE_A pTrustee, LPSTR name) { DPRINT("%p %s\n", pTrustee, name); @@ -60,7 +87,8 @@ VOID WINAPI BuildTrusteeWithNameA(PTRUSTEEA pTrustee, LPSTR name) /****************************************************************************** * BuildTrusteeWithNameW [ADVAPI32.@] */ -VOID WINAPI BuildTrusteeWithNameW(PTRUSTEEW pTrustee, LPWSTR name) +VOID WINAPI +BuildTrusteeWithNameW(PTRUSTEE_W pTrustee, LPWSTR name) { DPRINT("%p %s\n", pTrustee, name); @@ -70,3 +98,105 @@ VOID WINAPI BuildTrusteeWithNameW(PTRUSTEEW pTrustee, LPWSTR name) pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN; 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 */