[ADVAPI32]
[reactos.git] / reactos / dll / win32 / advapi32 / sec / trustee.c
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS system libraries
4 * FILE: lib/advapi32/sec/trustee.c
5 * PURPOSE: Trustee functions
6 */
7
8 #include <advapi32.h>
9 WINE_DEFAULT_DEBUG_CHANNEL(advapi);
10
11
12 /******************************************************************************
13 * BuildImpersonateTrusteeA [ADVAPI32.@]
14 */
15 VOID WINAPI
16 BuildImpersonateTrusteeA(PTRUSTEE_A pTrustee,
17 PTRUSTEE_A pImpersonateTrustee)
18 {
19 pTrustee->pMultipleTrustee = pImpersonateTrustee;
20 pTrustee->MultipleTrusteeOperation = TRUSTEE_IS_IMPERSONATE;
21 }
22
23
24 /******************************************************************************
25 * BuildImpersonateTrusteeW [ADVAPI32.@]
26 */
27 VOID WINAPI
28 BuildImpersonateTrusteeW(PTRUSTEE_W pTrustee,
29 PTRUSTEE_W pImpersonateTrustee)
30 {
31 pTrustee->pMultipleTrustee = pImpersonateTrustee;
32 pTrustee->MultipleTrusteeOperation = TRUSTEE_IS_IMPERSONATE;
33 }
34
35 /******************************************************************************
36 * BuildImpersonateExplicitAccessWithNameA [ADVAPI32.@]
37 */
38 VOID WINAPI
39 BuildImpersonateExplicitAccessWithNameA(PEXPLICIT_ACCESS_A pExplicitAccess,
40 LPSTR pTrusteeName,
41 PTRUSTEE_A pTrustee,
42 DWORD AccessPermissions,
43 ACCESS_MODE AccessMode,
44 DWORD Inheritance)
45 {
46 pExplicitAccess->grfAccessPermissions = AccessPermissions;
47 pExplicitAccess->grfAccessMode = AccessMode;
48 pExplicitAccess->grfInheritance = Inheritance;
49
50 pExplicitAccess->Trustee.pMultipleTrustee = pTrustee;
51 pExplicitAccess->Trustee.MultipleTrusteeOperation = TRUSTEE_IS_IMPERSONATE;
52 pExplicitAccess->Trustee.TrusteeForm = TRUSTEE_IS_NAME;
53 pExplicitAccess->Trustee.TrusteeType = TRUSTEE_IS_UNKNOWN;
54 pExplicitAccess->Trustee.ptstrName = pTrusteeName;
55 }
56
57
58 /******************************************************************************
59 * BuildImpersonateExplicitAccessWithNameW [ADVAPI32.@]
60 */
61 VOID WINAPI
62 BuildImpersonateExplicitAccessWithNameW(PEXPLICIT_ACCESS_W pExplicitAccess,
63 LPWSTR pTrusteeName,
64 PTRUSTEE_W pTrustee,
65 DWORD AccessPermissions,
66 ACCESS_MODE AccessMode,
67 DWORD Inheritance)
68 {
69 pExplicitAccess->grfAccessPermissions = AccessPermissions;
70 pExplicitAccess->grfAccessMode = AccessMode;
71 pExplicitAccess->grfInheritance = Inheritance;
72
73 pExplicitAccess->Trustee.pMultipleTrustee = pTrustee;
74 pExplicitAccess->Trustee.MultipleTrusteeOperation = TRUSTEE_IS_IMPERSONATE;
75 pExplicitAccess->Trustee.TrusteeForm = TRUSTEE_IS_NAME;
76 pExplicitAccess->Trustee.TrusteeType = TRUSTEE_IS_UNKNOWN;
77 pExplicitAccess->Trustee.ptstrName = pTrusteeName;
78 }
79
80 /******************************************************************************
81 * GetMultipleTrusteeA [ADVAPI32.@]
82 */
83 PTRUSTEEA WINAPI
84 GetMultipleTrusteeA(PTRUSTEE_A pTrustee)
85 {
86 return pTrustee->pMultipleTrustee;
87 }
88
89
90 /******************************************************************************
91 * GetMultipleTrusteeW [ADVAPI32.@]
92 */
93 PTRUSTEEW WINAPI
94 GetMultipleTrusteeW(PTRUSTEE_W pTrustee)
95 {
96 return pTrustee->pMultipleTrustee;
97 }
98
99
100 /******************************************************************************
101 * GetMultipleTrusteeOperationA [ADVAPI32.@]
102 */
103 MULTIPLE_TRUSTEE_OPERATION WINAPI
104 GetMultipleTrusteeOperationA(PTRUSTEE_A pTrustee)
105 {
106 return pTrustee->MultipleTrusteeOperation;
107 }
108
109
110 /******************************************************************************
111 * GetMultipleTrusteeOperationW [ADVAPI32.@]
112 */
113 MULTIPLE_TRUSTEE_OPERATION WINAPI
114 GetMultipleTrusteeOperationW(PTRUSTEE_W pTrustee)
115 {
116 return pTrustee->MultipleTrusteeOperation;
117 }
118
119 /* EOF */