Remove ALL stubs which might be of questionable origin.
[reactos.git] / reactos / lib / advapi32 / sec / sid.c
1 /* $Id: sid.c,v 1.10 2004/02/25 14:25:11 ekohl Exp $
2 *
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS system libraries
5 * FILE: lib/advapi32/sec/sid.c
6 * PURPOSE: Security ID functions
7 */
8
9 #define NTOS_MODE_USER
10 #include <ntos.h>
11 #include <windows.h>
12
13
14 /*
15 * @implemented
16 */
17 BOOL STDCALL
18 AllocateLocallyUniqueId(PLUID Luid)
19 {
20 NTSTATUS Status;
21
22 Status = NtAllocateLocallyUniqueId(Luid);
23 if (!NT_SUCCESS(Status))
24 {
25 SetLastError(RtlNtStatusToDosError(Status));
26 return(FALSE);
27 }
28 return(TRUE);
29 }
30
31
32 /*
33 * @implemented
34 */
35 BOOL STDCALL
36 AllocateAndInitializeSid (
37 PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
38 BYTE nSubAuthorityCount,
39 DWORD dwSubAuthority0,
40 DWORD dwSubAuthority1,
41 DWORD dwSubAuthority2,
42 DWORD dwSubAuthority3,
43 DWORD dwSubAuthority4,
44 DWORD dwSubAuthority5,
45 DWORD dwSubAuthority6,
46 DWORD dwSubAuthority7,
47 PSID *pSid
48 )
49 {
50 NTSTATUS Status;
51
52 Status = RtlAllocateAndInitializeSid (pIdentifierAuthority,
53 nSubAuthorityCount,
54 dwSubAuthority0,
55 dwSubAuthority1,
56 dwSubAuthority2,
57 dwSubAuthority3,
58 dwSubAuthority4,
59 dwSubAuthority5,
60 dwSubAuthority6,
61 dwSubAuthority7,
62 pSid);
63 if (!NT_SUCCESS(Status))
64 {
65 SetLastError (RtlNtStatusToDosError (Status));
66 return FALSE;
67 }
68
69 return TRUE;
70 }
71
72
73 /*
74 * @implemented
75 */
76 BOOL
77 STDCALL
78 CopySid (
79 DWORD nDestinationSidLength,
80 PSID pDestinationSid,
81 PSID pSourceSid
82 )
83 {
84 NTSTATUS Status;
85
86 Status = RtlCopySid (nDestinationSidLength,
87 pDestinationSid,
88 pSourceSid);
89 if (!NT_SUCCESS(Status))
90 {
91 SetLastError (RtlNtStatusToDosError (Status));
92 return FALSE;
93 }
94
95 return TRUE;
96 }
97
98
99 /*
100 * @implemented
101 */
102 BOOL
103 STDCALL
104 EqualPrefixSid (
105 PSID pSid1,
106 PSID pSid2
107 )
108 {
109 return RtlEqualPrefixSid (pSid1, pSid2);
110 }
111
112 /*
113 * @implemented
114 */
115 BOOL
116 STDCALL
117 EqualSid (
118 PSID pSid1,
119 PSID pSid2
120 )
121 {
122 return RtlEqualSid (pSid1, pSid2);
123 }
124
125
126 /*
127 * @implemented
128 */
129 PVOID
130 STDCALL
131 FreeSid (
132 PSID pSid
133 )
134 {
135 return RtlFreeSid (pSid);
136 }
137
138
139 /*
140 * @implemented
141 */
142 DWORD
143 STDCALL
144 GetLengthSid (
145 PSID pSid
146 )
147 {
148 return (DWORD)RtlLengthSid (pSid);
149 }
150
151
152 /*
153 * @implemented
154 */
155 PSID_IDENTIFIER_AUTHORITY
156 STDCALL
157 GetSidIdentifierAuthority (
158 PSID pSid
159 )
160 {
161 return RtlIdentifierAuthoritySid (pSid);
162 }
163
164
165 /*
166 * @implemented
167 */
168 DWORD
169 STDCALL
170 GetSidLengthRequired (
171 UCHAR nSubAuthorityCount
172 )
173 {
174 return (DWORD)RtlLengthRequiredSid (nSubAuthorityCount);
175 }
176
177
178 /*
179 * @implemented
180 */
181 PDWORD
182 STDCALL
183 GetSidSubAuthority (
184 PSID pSid,
185 DWORD nSubAuthority
186 )
187 {
188 return (PDWORD)RtlSubAuthoritySid (pSid, nSubAuthority);
189 }
190
191
192 /*
193 * @implemented
194 */
195 PUCHAR
196 STDCALL
197 GetSidSubAuthorityCount (
198 PSID pSid
199 )
200 {
201 return RtlSubAuthorityCountSid (pSid);
202 }
203
204
205 /*
206 * @implemented
207 */
208 BOOL
209 STDCALL
210 InitializeSid (
211 PSID Sid,
212 PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
213 BYTE nSubAuthorityCount
214 )
215 {
216 NTSTATUS Status;
217
218 Status = RtlInitializeSid (Sid,
219 pIdentifierAuthority,
220 nSubAuthorityCount);
221 if (!NT_SUCCESS(Status))
222 {
223 SetLastError (RtlNtStatusToDosError (Status));
224 return FALSE;
225 }
226
227 return TRUE;
228 }
229
230
231 /*
232 * @implemented
233 */
234 BOOL STDCALL
235 IsValidSid(PSID pSid)
236 {
237 return((BOOL)RtlValidSid(pSid));
238 }
239
240 /* EOF */