2223d294a24a6c41ec558909da8d44583d10b8bd
[reactos.git] / reactos / dll / win32 / msv1_0 / msv1_0.h
1 /*
2 * PROJECT: Authentication Package DLL
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: dll/win32/msv1_0/msv1_0.h
5 * PURPOSE: Common header file
6 * COPYRIGHT: Copyright 2013 Eric Kohl
7 */
8
9 #define WIN32_NO_STATUS
10 #define _INC_WINDOWS
11 #define COM_NO_WINDOWS_H
12 #include <stdarg.h>
13 #include <windef.h>
14 #include <winbase.h>
15 #include <winreg.h>
16 #define NTOS_MODE_USER
17 #include <ndk/cmfuncs.h>
18 #include <ndk/kefuncs.h>
19 #include <ndk/lpctypes.h>
20 #include <ndk/lpcfuncs.h>
21 #include <ndk/mmfuncs.h>
22 #include <ndk/obfuncs.h>
23 #include <ndk/psfuncs.h>
24 #include <ndk/rtlfuncs.h>
25 #include <ndk/setypes.h>
26 #include <ndk/sefuncs.h>
27
28 #include <sspi.h>
29 #include <ntsecapi.h>
30 #include <ntsecpkg.h>
31 #include <ntsam.h>
32 #include <ntlsa.h>
33
34 #include <samsrv/samsrv.h>
35 //#include <lsass/lsasrv.h>
36
37 #include <wine/debug.h>
38
39
40 #define FIXUP_POINTER(Pointer, Offset) ((Pointer != NULL) ? ((PWSTR)((ULONG_PTR)Pointer + Offset)) : NULL)
41
42
43 typedef struct _RPC_SID
44 {
45 UCHAR Revision;
46 UCHAR SubAuthorityCount;
47 SID_IDENTIFIER_AUTHORITY IdentifierAuthority;
48 DWORD SubAuthority[];
49 } RPC_SID, *PRPC_SID;
50
51 typedef struct _RPC_UNICODE_STRING
52 {
53 unsigned short Length;
54 unsigned short MaximumLength;
55 wchar_t *Buffer;
56 } RPC_UNICODE_STRING, *PRPC_UNICODE_STRING;
57
58 typedef wchar_t *PSAMPR_SERVER_NAME;
59 typedef void *SAMPR_HANDLE;
60
61 typedef struct _OLD_LARGE_INTEGER
62 {
63 unsigned long LowPart;
64 long HighPart;
65 } OLD_LARGE_INTEGER, *POLD_LARGE_INTEGER;
66
67 typedef struct RPC_SHORT_BLOB
68 {
69 unsigned short Length;
70 unsigned short MaximumLength;
71 unsigned short *Buffer;
72 } RPC_SHORT_BLOB, *PRPC_SHORT_BLOB;
73
74 typedef struct _SAMPR_SR_SECURITY_DESCRIPTOR
75 {
76 unsigned long Length;
77 unsigned char *SecurityDescriptor;
78 } SAMPR_SR_SECURITY_DESCRIPTOR, *PSAMPR_SR_SECURITY_DESCRIPTOR;
79
80 typedef struct _ENCRYPTED_LM_OWF_PASSWORD
81 {
82 char data[16];
83 } ENCRYPTED_LM_OWF_PASSWORD, *PENCRYPTED_LM_OWF_PASSWORD, ENCRYPTED_NT_OWF_PASSWORD, *PENCRYPTED_NT_OWF_PASSWORD;
84
85 typedef struct _SAMPR_ULONG_ARRAY
86 {
87 ULONG Count;
88 PULONG Element;
89 } SAMPR_ULONG_ARRAY, *PSAMPR_ULONG_ARRAY;
90
91 typedef struct _SAMPR_LOGON_HOURS
92 {
93 unsigned short UnitsPerWeek;
94 unsigned char *LogonHours;
95 } SAMPR_LOGON_HOURS, *PSAMPR_LOGON_HOURS;
96
97 typedef struct _SAMPR_USER_ALL_INFORMATION
98 {
99 OLD_LARGE_INTEGER LastLogon;
100 OLD_LARGE_INTEGER LastLogoff;
101 OLD_LARGE_INTEGER PasswordLastSet;
102 OLD_LARGE_INTEGER AccountExpires;
103 OLD_LARGE_INTEGER PasswordCanChange;
104 OLD_LARGE_INTEGER PasswordMustChange;
105 RPC_UNICODE_STRING UserName;
106 RPC_UNICODE_STRING FullName;
107 RPC_UNICODE_STRING HomeDirectory;
108 RPC_UNICODE_STRING HomeDirectoryDrive;
109 RPC_UNICODE_STRING ScriptPath;
110 RPC_UNICODE_STRING ProfilePath;
111 RPC_UNICODE_STRING AdminComment;
112 RPC_UNICODE_STRING WorkStations;
113 RPC_UNICODE_STRING UserComment;
114 RPC_UNICODE_STRING Parameters;
115 RPC_SHORT_BLOB LmOwfPassword;
116 RPC_SHORT_BLOB NtOwfPassword;
117 RPC_UNICODE_STRING PrivateData;
118 SAMPR_SR_SECURITY_DESCRIPTOR SecurityDescriptor;
119 unsigned long UserId;
120 unsigned long PrimaryGroupId;
121 unsigned long UserAccountControl;
122 unsigned long WhichFields;
123 SAMPR_LOGON_HOURS LogonHours;
124 unsigned short BadPasswordCount;
125 unsigned short LogonCount;
126 unsigned short CountryCode;
127 unsigned short CodePage;
128 unsigned char LmPasswordPresent;
129 unsigned char NtPasswordPresent;
130 unsigned char PasswordExpired;
131 unsigned char PrivateDataSensitive;
132 } SAMPR_USER_ALL_INFORMATION, *PSAMPR_USER_ALL_INFORMATION;
133
134 typedef union _SAMPR_USER_INFO_BUFFER
135 {
136 #if 0
137 SAMPR_USER_GENERAL_INFORMATION General;
138 SAMPR_USER_PREFERENCES_INFORMATION Preferences;
139 SAMPR_USER_LOGON_INFORMATION Logon;
140 SAMPR_USER_LOGON_HOURS_INFORMATION LogonHours;
141 SAMPR_USER_ACCOUNT_INFORMATION Account;
142 SAMPR_USER_NAME_INFORMATION Name;
143 SAMPR_USER_A_NAME_INFORMATION AccountName;
144 SAMPR_USER_F_NAME_INFORMATION FullName;
145 USER_PRIMARY_GROUP_INFORMATION PrimaryGroup;
146 SAMPR_USER_HOME_INFORMATION Home;
147 SAMPR_USER_SCRIPT_INFORMATION Script;
148 SAMPR_USER_PROFILE_INFORMATION Profile;
149 SAMPR_USER_ADMIN_COMMENT_INFORMATION AdminComment;
150 SAMPR_USER_WORKSTATIONS_INFORMATION WorkStations;
151 SAMPR_USER_SET_PASSWORD_INFORMATION SetPassword;
152 USER_CONTROL_INFORMATION Control;
153 USER_EXPIRES_INFORMATION Expires;
154 SAMPR_USER_INTERNAL1_INFORMATION Internal1;
155 SAMPR_USER_PARAMETERS_INFORMATION Parameters;
156 #endif
157 SAMPR_USER_ALL_INFORMATION All;
158 #if 0
159 SAMPR_USER_INTERNAL4_INFORMATION Internal4;
160 SAMPR_USER_INTERNAL5_INFORMATION Internal5;
161 SAMPR_USER_INTERNAL4_INFORMATION_NEW Internal4New;
162 SAMPR_USER_INTERNAL5_INFORMATION_NEW Internal5New;
163 #endif
164 } SAMPR_USER_INFO_BUFFER, *PSAMPR_USER_INFO_BUFFER;
165
166
167 NTSTATUS
168 NTAPI
169 SamIConnect(IN PSAMPR_SERVER_NAME ServerName,
170 OUT SAMPR_HANDLE *ServerHandle,
171 IN ACCESS_MASK DesiredAccess,
172 IN BOOLEAN Trusted);
173
174 VOID
175 NTAPI
176 SamIFree_SAMPR_ULONG_ARRAY(PSAMPR_ULONG_ARRAY Ptr);
177
178 VOID
179 NTAPI
180 SamIFree_SAMPR_USER_INFO_BUFFER(PSAMPR_USER_INFO_BUFFER Ptr,
181 USER_INFORMATION_CLASS InformationClass);
182
183 NTSTATUS
184 NTAPI
185 SamrCloseHandle(IN OUT SAMPR_HANDLE *SamHandle);
186
187 NTSTATUS
188 NTAPI
189 SamrLookupNamesInDomain(IN SAMPR_HANDLE DomainHandle,
190 IN ULONG Count,
191 IN RPC_UNICODE_STRING Names[],
192 OUT PSAMPR_ULONG_ARRAY RelativeIds,
193 OUT PSAMPR_ULONG_ARRAY Use);
194
195 NTSTATUS
196 NTAPI
197 SamrOpenDomain(IN SAMPR_HANDLE ServerHandle,
198 IN ACCESS_MASK DesiredAccess,
199 IN PRPC_SID DomainId,
200 OUT SAMPR_HANDLE *DomainHandle);
201
202 NTSTATUS
203 NTAPI
204 SamrOpenUser(IN SAMPR_HANDLE DomainHandle,
205 IN ACCESS_MASK DesiredAccess,
206 IN ULONG UserId,
207 OUT SAMPR_HANDLE *UserHandle);
208
209 NTSTATUS
210 NTAPI
211 SamrQueryInformationUser(IN SAMPR_HANDLE UserHandle,
212 IN USER_INFORMATION_CLASS UserInformationClass,
213 OUT PSAMPR_USER_INFO_BUFFER *Buffer);
214
215
216 typedef PVOID LSAPR_HANDLE;
217
218 typedef struct _LSAPR_POLICY_AUDIT_EVENTS_INFO
219 {
220 BOOLEAN AuditingMode;
221 DWORD *EventAuditingOptions;
222 DWORD MaximumAuditEventCount;
223 } LSAPR_POLICY_AUDIT_EVENTS_INFO, *PLSAPR_POLICY_AUDIT_EVENTS_INFO;
224
225 typedef struct _LSAPR_POLICY_PRIMARY_DOM_INFO
226 {
227 RPC_UNICODE_STRING Name;
228 PRPC_SID Sid;
229 } LSAPR_POLICY_PRIMARY_DOM_INFO, *PLSAPR_POLICY_PRIMARY_DOM_INFO;
230
231 typedef struct _LSAPR_POLICY_ACCOUNT_DOM_INFO
232 {
233 RPC_UNICODE_STRING DomainName;
234 PRPC_SID Sid;
235 } LSAPR_POLICY_ACCOUNT_DOM_INFO, *PLSAPR_POLICY_ACCOUNT_DOM_INFO;
236
237 typedef struct _LSAPR_POLICY_PD_ACCOUNT_INFO
238 {
239 RPC_UNICODE_STRING Name;
240 } LSAPR_POLICY_PD_ACCOUNT_INFO, *PLSAPR_POLICY_PD_ACCOUNT_INFO;
241
242 typedef struct _POLICY_LSA_REPLICA_SRCE_INFO
243 {
244 RPC_UNICODE_STRING ReplicaSource;
245 RPC_UNICODE_STRING ReplicaAccountName;
246 } POLICY_LSA_REPLICA_SRCE_INFO, *PPOLICY_LSA_REPLICA_SRCE_INFO;
247
248 typedef struct _LSAPR_POLICY_DNS_DOMAIN_INFO
249 {
250 RPC_UNICODE_STRING Name;
251 RPC_UNICODE_STRING DnsDomainName;
252 RPC_UNICODE_STRING DnsForestName;
253 GUID DomainGuid;
254 PRPC_SID Sid;
255 } LSAPR_POLICY_DNS_DOMAIN_INFO, *PLSAPR_POLICY_DNS_DOMAIN_INFO;
256
257 typedef union _LSAPR_POLICY_INFORMATION
258 {
259 POLICY_AUDIT_LOG_INFO PolicyAuditLogInfo;
260 LSAPR_POLICY_AUDIT_EVENTS_INFO PolicyAuditEventsInfo;
261 LSAPR_POLICY_PRIMARY_DOM_INFO PolicyPrimaryDomInfo;
262 LSAPR_POLICY_PD_ACCOUNT_INFO PolicyPdAccountInfo;
263 LSAPR_POLICY_ACCOUNT_DOM_INFO PolicyAccountDomainInfo;
264 POLICY_LSA_SERVER_ROLE_INFO PolicyServerRoleInfo;
265 POLICY_LSA_REPLICA_SRCE_INFO PolicyReplicaSourceInfo;
266 POLICY_DEFAULT_QUOTA_INFO PolicyDefaultQuotaInfo;
267 POLICY_MODIFICATION_INFO PolicyModificationInfo;
268 POLICY_AUDIT_FULL_SET_INFO PolicyAuditFullSetInfo;
269 POLICY_AUDIT_FULL_QUERY_INFO PolicyAuditFullQueryInfo;
270 LSAPR_POLICY_DNS_DOMAIN_INFO PolicyDnsDomainInfo;
271 LSAPR_POLICY_DNS_DOMAIN_INFO PolicyDnsDomainInfoInt;
272 LSAPR_POLICY_ACCOUNT_DOM_INFO PolicyLocalAccountDomainInfo;
273 } LSAPR_POLICY_INFORMATION, *PLSAPR_POLICY_INFORMATION;
274
275 VOID
276 NTAPI
277 LsaIFree_LSAPR_POLICY_INFORMATION(IN POLICY_INFORMATION_CLASS InformationClass,
278 IN PLSAPR_POLICY_INFORMATION PolicyInformation);
279
280 NTSTATUS
281 WINAPI
282 LsaIOpenPolicyTrusted(OUT LSAPR_HANDLE *PolicyHandle);
283
284 NTSTATUS
285 WINAPI
286 LsarClose(IN OUT LSAPR_HANDLE *ObjectHandle);
287
288 NTSTATUS
289 WINAPI
290 LsarLookupPrivilegeValue(IN LSAPR_HANDLE PolicyHandle,
291 IN PRPC_UNICODE_STRING Name,
292 OUT PLUID Value);
293
294 NTSTATUS
295 WINAPI
296 LsarQueryInformationPolicy(IN LSAPR_HANDLE PolicyHandle,
297 IN POLICY_INFORMATION_CLASS InformationClass,
298 OUT PLSAPR_POLICY_INFORMATION *PolicyInformation);
299
300 /* EOF */