ADVAPI32.LookupAccountSidA and ADVAPI32.LookupAccountSidW stubs added.
[reactos.git] / reactos / lib / advapi32 / sec / sid.c
1 /* $Id: sid.c,v 1.2 2001/01/14 12:15:19 ea 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 #include <ddk/ntddk.h>
10 #include <ntdll/rtl.h>
11 #include <windows.h>
12
13
14 BOOL
15 STDCALL
16 AllocateAndInitializeSid (
17 PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
18 BYTE nSubAuthorityCount,
19 DWORD dwSubAuthority0,
20 DWORD dwSubAuthority1,
21 DWORD dwSubAuthority2,
22 DWORD dwSubAuthority3,
23 DWORD dwSubAuthority4,
24 DWORD dwSubAuthority5,
25 DWORD dwSubAuthority6,
26 DWORD dwSubAuthority7,
27 PSID *pSid
28 )
29 {
30 NTSTATUS Status;
31
32 Status = RtlAllocateAndInitializeSid (pIdentifierAuthority,
33 nSubAuthorityCount,
34 dwSubAuthority0,
35 dwSubAuthority1,
36 dwSubAuthority2,
37 dwSubAuthority3,
38 dwSubAuthority4,
39 dwSubAuthority5,
40 dwSubAuthority6,
41 dwSubAuthority7,
42 pSid);
43 if (!NT_SUCCESS(Status))
44 {
45 SetLastError (RtlNtStatusToDosError (Status));
46 return FALSE;
47 }
48
49 return TRUE;
50
51 }
52
53 BOOL
54 STDCALL
55 CopySid (
56 DWORD nDestinationSidLength,
57 PSID pDestinationSid,
58 PSID pSourceSid
59 )
60 {
61 NTSTATUS Status;
62
63 Status = RtlCopySid (nDestinationSidLength,
64 pDestinationSid,
65 pSourceSid);
66 if (!NT_SUCCESS(Status))
67 {
68 SetLastError (RtlNtStatusToDosError (Status));
69 return FALSE;
70 }
71
72 return TRUE;
73 }
74
75 WINBOOL
76 STDCALL
77 EqualPrefixSid (
78 PSID pSid1,
79 PSID pSid2
80 )
81 {
82 return RtlEqualPrefixSid (pSid1, pSid2);
83 }
84
85 WINBOOL
86 STDCALL
87 EqualSid (
88 PSID pSid1,
89 PSID pSid2
90 )
91 {
92 return RtlEqualSid (pSid1, pSid2);
93 }
94
95 PVOID
96 STDCALL
97 FreeSid (
98 PSID pSid
99 )
100 {
101 return RtlFreeSid (pSid);
102 }
103
104 DWORD
105 STDCALL
106 GetLengthSid (
107 PSID pSid
108 )
109 {
110 return (DWORD)RtlLengthSid (pSid);
111 }
112
113 PSID_IDENTIFIER_AUTHORITY
114 STDCALL
115 GetSidIdentifierAuthority (
116 PSID pSid
117 )
118 {
119 return RtlIdentifierAuthoritySid (pSid);
120 }
121
122 DWORD
123 STDCALL
124 GetSidLengthRequired (
125 UCHAR nSubAuthorityCount
126 )
127 {
128 return (DWORD)RtlLengthRequiredSid (nSubAuthorityCount);
129 }
130
131 PDWORD
132 STDCALL
133 GetSidSubAuthority (
134 PSID pSid,
135 DWORD nSubAuthority
136 )
137 {
138 return (PDWORD)RtlSubAuthoritySid (pSid, nSubAuthority);
139 }
140
141 PUCHAR
142 STDCALL
143 GetSidSubAuthorityCount (
144 PSID pSid
145 )
146 {
147 return RtlSubAuthorityCountSid (pSid);
148 }
149
150 WINBOOL
151 STDCALL
152 InitializeSid (
153 PSID Sid,
154 PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
155 BYTE nSubAuthorityCount
156 )
157 {
158 NTSTATUS Status;
159
160 Status = RtlInitializeSid (Sid,
161 pIdentifierAuthority,
162 nSubAuthorityCount);
163 if (!NT_SUCCESS(Status))
164 {
165 SetLastError (RtlNtStatusToDosError (Status));
166 return FALSE;
167 }
168
169 return TRUE;
170 }
171
172 WINBOOL
173 STDCALL
174 IsValidSid (
175 PSID pSid
176 )
177 {
178 return (WINBOOL)RtlValidSid (pSid);
179 }
180
181 WINBOOL
182 STDCALL
183 LookupAccountSidA (
184 LPCSTR lpSystemName,
185 PSID Sid,
186 LPSTR Name,
187 LPDWORD cbName,
188 LPSTR ReferencedDomainName,
189 LPDWORD cbReferencedDomainName,
190 PSID_NAME_USE peUse
191 )
192 {
193 return (FALSE);
194 }
195
196
197 WINBOOL
198 STDCALL
199 LookupAccountSidW (
200 LPCWSTR lpSystemName,
201 PSID Sid,
202 LPWSTR Name,
203 LPDWORD cbName,
204 LPWSTR ReferencedDomainName,
205 LPDWORD cbReferencedDomainName,
206 PSID_NAME_USE peUse
207 )
208 {
209 return (FALSE);
210 }
211
212 /* EOF */