Implement BuildExplicitAccessWithNameA/W() and BuildImpersonateExplicitAccessWithNameA/W().
Modified: trunk/reactos/lib/advapi32/advapi32.def
Modified: trunk/reactos/lib/advapi32/sec/trustee.c

Modified: trunk/reactos/lib/advapi32/advapi32.def
--- trunk/reactos/lib/advapi32/advapi32.def	2005-01-04 07:05:31 UTC (rev 12784)
+++ trunk/reactos/lib/advapi32/advapi32.def	2005-01-04 09:35:28 UTC (rev 12785)
@@ -1,4 +1,4 @@
-; $Id: advapi32.def,v 1.28 2004/12/15 12:29:36 ekohl Exp $
+; $Id$
 ;
 ; advapi32.def
 ;
@@ -31,10 +31,10 @@
 BackupEventLogW@8
 ;BuildAccessRequestA
 ;BuildAccessRequestW
-;BuildExplicitAccessWithNameA@20
-;BuildExplicitAccessWithNameW@20
-;BuildImpersonateExplicitAccessWithNameA@24
-;BuildImpersonateExplicitAccessWithNameW@24
+BuildExplicitAccessWithNameA@20
+BuildExplicitAccessWithNameW@20
+BuildImpersonateExplicitAccessWithNameA@24
+BuildImpersonateExplicitAccessWithNameW@24
 BuildImpersonateTrusteeA@8
 BuildImpersonateTrusteeW@8
 ;BuildSecurityDescriptorA@36

Modified: trunk/reactos/lib/advapi32/sec/trustee.c
--- trunk/reactos/lib/advapi32/sec/trustee.c	2005-01-04 07:05:31 UTC (rev 12784)
+++ trunk/reactos/lib/advapi32/sec/trustee.c	2005-01-04 09:35:28 UTC (rev 12785)
@@ -1,4 +1,4 @@
-/* $Id: trustee.c,v 1.3 2004/12/15 12:29:13 ekohl Exp $
+/* $Id$
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
@@ -37,6 +37,96 @@
 
 
 /******************************************************************************
+ * BuildExplicitAccessWithNameA [ADVAPI32.@]
+ */
+VOID WINAPI
+BuildExplicitAccessWithNameA(PEXPLICIT_ACCESSA pExplicitAccess,
+                             LPSTR pTrusteeName,
+                             DWORD AccessPermissions,
+                             ACCESS_MODE AccessMode,
+                             DWORD Inheritance)
+{
+    pExplicitAccess->grfAccessPermissions = AccessPermissions;
+    pExplicitAccess->grfAccessMode = AccessMode;
+    pExplicitAccess->grfInheritance = Inheritance;
+
+    pExplicitAccess->Trustee.pMultipleTrustee = NULL;
+    pExplicitAccess->Trustee.MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
+    pExplicitAccess->Trustee.TrusteeForm = TRUSTEE_IS_NAME;
+    pExplicitAccess->Trustee.TrusteeType = TRUSTEE_IS_UNKNOWN;
+    pExplicitAccess->Trustee.ptstrName = pTrusteeName;
+}
+
+
+/******************************************************************************
+ * BuildExplicitAccessWithNameW [ADVAPI32.@]
+ */
+VOID WINAPI
+BuildExplicitAccessWithNameW(PEXPLICIT_ACCESSW pExplicitAccess,
+                             LPWSTR pTrusteeName,
+                             DWORD AccessPermissions,
+                             ACCESS_MODE AccessMode,
+                             DWORD Inheritance)
+{
+    pExplicitAccess->grfAccessPermissions = AccessPermissions;
+    pExplicitAccess->grfAccessMode = AccessMode;
+    pExplicitAccess->grfInheritance = Inheritance;
+
+    pExplicitAccess->Trustee.pMultipleTrustee = NULL;
+    pExplicitAccess->Trustee.MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
+    pExplicitAccess->Trustee.TrusteeForm = TRUSTEE_IS_NAME;
+    pExplicitAccess->Trustee.TrusteeType = TRUSTEE_IS_UNKNOWN;
+    pExplicitAccess->Trustee.ptstrName = pTrusteeName;
+}
+
+
+/******************************************************************************
+ * 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;
+}
+
+
+/******************************************************************************
  * BuildTrusteeWithSidA [ADVAPI32.@]
  */
 VOID WINAPI