[MSV1_0]
[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 typedef struct _RPC_SID
40 {
41 UCHAR Revision;
42 UCHAR SubAuthorityCount;
43 SID_IDENTIFIER_AUTHORITY IdentifierAuthority;
44 DWORD SubAuthority[];
45 } RPC_SID, *PRPC_SID;
46
47 typedef struct _RPC_UNICODE_STRING
48 {
49 unsigned short Length;
50 unsigned short MaximumLength;
51 wchar_t *Buffer;
52 } RPC_UNICODE_STRING, *PRPC_UNICODE_STRING;
53
54 typedef wchar_t *PSAMPR_SERVER_NAME;
55 typedef void *SAMPR_HANDLE;
56
57 typedef struct _OLD_LARGE_INTEGER
58 {
59 unsigned long LowPart;
60 long HighPart;
61 } OLD_LARGE_INTEGER, *POLD_LARGE_INTEGER;
62
63 typedef struct RPC_SHORT_BLOB
64 {
65 unsigned short Length;
66 unsigned short MaximumLength;
67 unsigned short *Buffer;
68 } RPC_SHORT_BLOB, *PRPC_SHORT_BLOB;
69
70 typedef struct _SAMPR_SR_SECURITY_DESCRIPTOR
71 {
72 unsigned long Length;
73 unsigned char *SecurityDescriptor;
74 } SAMPR_SR_SECURITY_DESCRIPTOR, *PSAMPR_SR_SECURITY_DESCRIPTOR;
75
76 typedef struct _ENCRYPTED_LM_OWF_PASSWORD
77 {
78 char data[16];
79 } ENCRYPTED_LM_OWF_PASSWORD, *PENCRYPTED_LM_OWF_PASSWORD, ENCRYPTED_NT_OWF_PASSWORD, *PENCRYPTED_NT_OWF_PASSWORD;
80
81 typedef struct _SAMPR_ULONG_ARRAY
82 {
83 ULONG Count;
84 PULONG Element;
85 } SAMPR_ULONG_ARRAY, *PSAMPR_ULONG_ARRAY;
86
87 typedef struct _SAMPR_LOGON_HOURS
88 {
89 unsigned short UnitsPerWeek;
90 unsigned char *LogonHours;
91 } SAMPR_LOGON_HOURS, *PSAMPR_LOGON_HOURS;
92
93 typedef struct _SAMPR_USER_ALL_INFORMATION
94 {
95 OLD_LARGE_INTEGER LastLogon;
96 OLD_LARGE_INTEGER LastLogoff;
97 OLD_LARGE_INTEGER PasswordLastSet;
98 OLD_LARGE_INTEGER AccountExpires;
99 OLD_LARGE_INTEGER PasswordCanChange;
100 OLD_LARGE_INTEGER PasswordMustChange;
101 RPC_UNICODE_STRING UserName;
102 RPC_UNICODE_STRING FullName;
103 RPC_UNICODE_STRING HomeDirectory;
104 RPC_UNICODE_STRING HomeDirectoryDrive;
105 RPC_UNICODE_STRING ScriptPath;
106 RPC_UNICODE_STRING ProfilePath;
107 RPC_UNICODE_STRING AdminComment;
108 RPC_UNICODE_STRING WorkStations;
109 RPC_UNICODE_STRING UserComment;
110 RPC_UNICODE_STRING Parameters;
111 RPC_SHORT_BLOB LmOwfPassword;
112 RPC_SHORT_BLOB NtOwfPassword;
113 RPC_UNICODE_STRING PrivateData;
114 SAMPR_SR_SECURITY_DESCRIPTOR SecurityDescriptor;
115 unsigned long UserId;
116 unsigned long PrimaryGroupId;
117 unsigned long UserAccountControl;
118 unsigned long WhichFields;
119 SAMPR_LOGON_HOURS LogonHours;
120 unsigned short BadPasswordCount;
121 unsigned short LogonCount;
122 unsigned short CountryCode;
123 unsigned short CodePage;
124 unsigned char LmPasswordPresent;
125 unsigned char NtPasswordPresent;
126 unsigned char PasswordExpired;
127 unsigned char PrivateDataSensitive;
128 } SAMPR_USER_ALL_INFORMATION, *PSAMPR_USER_ALL_INFORMATION;
129
130 typedef union _SAMPR_USER_INFO_BUFFER
131 {
132 #if 0
133 SAMPR_USER_GENERAL_INFORMATION General;
134 SAMPR_USER_PREFERENCES_INFORMATION Preferences;
135 SAMPR_USER_LOGON_INFORMATION Logon;
136 SAMPR_USER_LOGON_HOURS_INFORMATION LogonHours;
137 SAMPR_USER_ACCOUNT_INFORMATION Account;
138 SAMPR_USER_NAME_INFORMATION Name;
139 SAMPR_USER_A_NAME_INFORMATION AccountName;
140 SAMPR_USER_F_NAME_INFORMATION FullName;
141 USER_PRIMARY_GROUP_INFORMATION PrimaryGroup;
142 SAMPR_USER_HOME_INFORMATION Home;
143 SAMPR_USER_SCRIPT_INFORMATION Script;
144 SAMPR_USER_PROFILE_INFORMATION Profile;
145 SAMPR_USER_ADMIN_COMMENT_INFORMATION AdminComment;
146 SAMPR_USER_WORKSTATIONS_INFORMATION WorkStations;
147 SAMPR_USER_SET_PASSWORD_INFORMATION SetPassword;
148 USER_CONTROL_INFORMATION Control;
149 USER_EXPIRES_INFORMATION Expires;
150 SAMPR_USER_INTERNAL1_INFORMATION Internal1;
151 SAMPR_USER_PARAMETERS_INFORMATION Parameters;
152 #endif
153 SAMPR_USER_ALL_INFORMATION All;
154 #if 0
155 SAMPR_USER_INTERNAL4_INFORMATION Internal4;
156 SAMPR_USER_INTERNAL5_INFORMATION Internal5;
157 SAMPR_USER_INTERNAL4_INFORMATION_NEW Internal4New;
158 SAMPR_USER_INTERNAL5_INFORMATION_NEW Internal5New;
159 #endif
160 } SAMPR_USER_INFO_BUFFER, *PSAMPR_USER_INFO_BUFFER;
161
162
163 NTSTATUS
164 NTAPI
165 SamIConnect(IN PSAMPR_SERVER_NAME ServerName,
166 OUT SAMPR_HANDLE *ServerHandle,
167 IN ACCESS_MASK DesiredAccess,
168 IN BOOLEAN Trusted);
169
170 VOID
171 NTAPI
172 SamIFree_SAMPR_ULONG_ARRAY(PSAMPR_ULONG_ARRAY Ptr);
173
174 VOID
175 NTAPI
176 SamIFree_SAMPR_USER_INFO_BUFFER(PSAMPR_USER_INFO_BUFFER Ptr,
177 USER_INFORMATION_CLASS InformationClass);
178
179 NTSTATUS
180 NTAPI
181 SamrCloseHandle(IN OUT SAMPR_HANDLE *SamHandle);
182
183 NTSTATUS
184 NTAPI
185 SamrLookupNamesInDomain(IN SAMPR_HANDLE DomainHandle,
186 IN ULONG Count,
187 IN RPC_UNICODE_STRING Names[],
188 OUT PSAMPR_ULONG_ARRAY RelativeIds,
189 OUT PSAMPR_ULONG_ARRAY Use);
190
191 NTSTATUS
192 NTAPI
193 SamrOpenDomain(IN SAMPR_HANDLE ServerHandle,
194 IN ACCESS_MASK DesiredAccess,
195 IN PRPC_SID DomainId,
196 OUT SAMPR_HANDLE *DomainHandle);
197
198 NTSTATUS
199 NTAPI
200 SamrOpenUser(IN SAMPR_HANDLE DomainHandle,
201 IN ACCESS_MASK DesiredAccess,
202 IN ULONG UserId,
203 OUT SAMPR_HANDLE *UserHandle);
204
205 NTSTATUS
206 NTAPI
207 SamrQueryInformationUser(IN SAMPR_HANDLE UserHandle,
208 IN USER_INFORMATION_CLASS UserInformationClass,
209 OUT PSAMPR_USER_INFO_BUFFER *Buffer);
210
211
212 typedef PVOID LSAPR_HANDLE;
213
214 typedef struct _LSAPR_POLICY_AUDIT_EVENTS_INFO
215 {
216 BOOLEAN AuditingMode;
217 DWORD *EventAuditingOptions;
218 DWORD MaximumAuditEventCount;
219 } LSAPR_POLICY_AUDIT_EVENTS_INFO, *PLSAPR_POLICY_AUDIT_EVENTS_INFO;
220
221 typedef struct _LSAPR_POLICY_PRIMARY_DOM_INFO
222 {
223 RPC_UNICODE_STRING Name;
224 PRPC_SID Sid;
225 } LSAPR_POLICY_PRIMARY_DOM_INFO, *PLSAPR_POLICY_PRIMARY_DOM_INFO;
226
227 typedef struct _LSAPR_POLICY_ACCOUNT_DOM_INFO
228 {
229 RPC_UNICODE_STRING DomainName;
230 PRPC_SID Sid;
231 } LSAPR_POLICY_ACCOUNT_DOM_INFO, *PLSAPR_POLICY_ACCOUNT_DOM_INFO;
232
233 typedef struct _LSAPR_POLICY_PD_ACCOUNT_INFO
234 {
235 RPC_UNICODE_STRING Name;
236 } LSAPR_POLICY_PD_ACCOUNT_INFO, *PLSAPR_POLICY_PD_ACCOUNT_INFO;
237
238 typedef struct _POLICY_LSA_REPLICA_SRCE_INFO
239 {
240 RPC_UNICODE_STRING ReplicaSource;
241 RPC_UNICODE_STRING ReplicaAccountName;
242 } POLICY_LSA_REPLICA_SRCE_INFO, *PPOLICY_LSA_REPLICA_SRCE_INFO;
243
244 typedef struct _LSAPR_POLICY_DNS_DOMAIN_INFO
245 {
246 RPC_UNICODE_STRING Name;
247 RPC_UNICODE_STRING DnsDomainName;
248 RPC_UNICODE_STRING DnsForestName;
249 GUID DomainGuid;
250 PRPC_SID Sid;
251 } LSAPR_POLICY_DNS_DOMAIN_INFO, *PLSAPR_POLICY_DNS_DOMAIN_INFO;
252
253 typedef union _LSAPR_POLICY_INFORMATION
254 {
255 POLICY_AUDIT_LOG_INFO PolicyAuditLogInfo;
256 LSAPR_POLICY_AUDIT_EVENTS_INFO PolicyAuditEventsInfo;
257 LSAPR_POLICY_PRIMARY_DOM_INFO PolicyPrimaryDomInfo;
258 LSAPR_POLICY_PD_ACCOUNT_INFO PolicyPdAccountInfo;
259 LSAPR_POLICY_ACCOUNT_DOM_INFO PolicyAccountDomainInfo;
260 POLICY_LSA_SERVER_ROLE_INFO PolicyServerRoleInfo;
261 POLICY_LSA_REPLICA_SRCE_INFO PolicyReplicaSourceInfo;
262 POLICY_DEFAULT_QUOTA_INFO PolicyDefaultQuotaInfo;
263 POLICY_MODIFICATION_INFO PolicyModificationInfo;
264 POLICY_AUDIT_FULL_SET_INFO PolicyAuditFullSetInfo;
265 POLICY_AUDIT_FULL_QUERY_INFO PolicyAuditFullQueryInfo;
266 LSAPR_POLICY_DNS_DOMAIN_INFO PolicyDnsDomainInfo;
267 LSAPR_POLICY_DNS_DOMAIN_INFO PolicyDnsDomainInfoInt;
268 LSAPR_POLICY_ACCOUNT_DOM_INFO PolicyLocalAccountDomainInfo;
269 } LSAPR_POLICY_INFORMATION, *PLSAPR_POLICY_INFORMATION;
270
271 VOID
272 NTAPI
273 LsaIFree_LSAPR_POLICY_INFORMATION(IN POLICY_INFORMATION_CLASS InformationClass,
274 IN PLSAPR_POLICY_INFORMATION PolicyInformation);
275
276 NTSTATUS
277 WINAPI
278 LsaIOpenPolicyTrusted(OUT LSAPR_HANDLE *PolicyHandle);
279
280 NTSTATUS
281 WINAPI
282 LsarClose(IN OUT LSAPR_HANDLE *ObjectHandle);
283
284 NTSTATUS
285 WINAPI
286 LsarQueryInformationPolicy(IN LSAPR_HANDLE PolicyHandle,
287 IN POLICY_INFORMATION_CLASS InformationClass,
288 OUT PLSAPR_POLICY_INFORMATION *PolicyInformation);
289
290
291 /* EOF */