Sync with trunk (r48545)
[reactos.git] / include / psdk / subauth.h
1 #ifndef _SUBAUTH_H
2 #define _SUBAUTH_H
3
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7 #ifndef NT_SUCCESS
8 #define NT_SUCCESS(x) ((x)>=0)
9 #define STATUS_SUCCESS 0
10 #endif
11 #define CYPHER_BLOCK_LENGTH 8
12 #define USER_SESSION_KEY_LENGTH (CYPHER_BLOCK_LENGTH*2)
13 #define CLEAR_BLOCK_LENGTH 8
14 #define MSV1_0_PASSTHRU 1
15 #define MSV1_0_GUEST_LOGON 2
16 #define MSV1_0_VALIDATION_LOGOFF_TIME 1
17 #define MSV1_0_VALIDATION_KICKOFF_TIME 2
18 #define MSV1_0_VALIDATION_LOGON_SERVER 4
19 #define MSV1_0_VALIDATION_LOGON_DOMAIN 8
20 #define MSV1_0_VALIDATION_SESSION_KEY 16
21 #define MSV1_0_VALIDATION_USER_FLAGS 32
22 #define MSV1_0_VALIDATION_USER_ID 64
23 #define MSV1_0_SUBAUTH_ACCOUNT_DISABLED 1
24 #define MSV1_0_SUBAUTH_PASSWORD 2
25 #define MSV1_0_SUBAUTH_WORKSTATIONS 4
26 #define MSV1_0_SUBAUTH_LOGON_HOURS 8
27 #define MSV1_0_SUBAUTH_ACCOUNT_EXPIRY 16
28 #define MSV1_0_SUBAUTH_PASSWORD_EXPIRY 32
29 #define MSV1_0_SUBAUTH_ACCOUNT_TYPE 64
30 #define MSV1_0_SUBAUTH_LOCKOUT 128
31 #define NEXT_FREE_ACCOUNT_CONTROL_BIT 131072
32 #define SAM_DAYS_PER_WEEK 7
33 #define SAM_HOURS_PER_WEEK 168
34 #define SAM_MINUTES_PER_WEEK 10080
35 #define STATUS_INVALID_INFO_CLASS 0xC0000003L
36 #define STATUS_NO_SUCH_USER 0xC0000064L
37 #define STATUS_WRONG_PASSWORD 0xC000006AL
38 #define STATUS_PASSWORD_RESTRICTION 0xC000006CL
39 #define STATUS_LOGON_FAILURE 0xC000006DL
40 #define STATUS_ACCOUNT_RESTRICTION 0xC000006EL
41 #define STATUS_INVALID_LOGON_HOURS 0xC000006FL
42 #define STATUS_INVALID_WORKSTATION 0xC0000070L
43 #define STATUS_PASSWORD_EXPIRED 0xC0000071L
44 #define STATUS_ACCOUNT_DISABLED 0xC0000072L
45 #define STATUS_INSUFFICIENT_RESOURCES 0xC000009AL
46 #define STATUS_ACCOUNT_EXPIRED 0xC0000193L
47 #define STATUS_PASSWORD_MUST_CHANGE 0xC0000224L
48 #define STATUS_ACCOUNT_LOCKED_OUT 0xC0000234L
49 #define USER_ACCOUNT_DISABLED 1
50 #define USER_HOME_DIRECTORY_REQUIRED 2
51 #define USER_PASSWORD_NOT_REQUIRED 4
52 #define USER_TEMP_DUPLICATE_ACCOUNT 8
53 #define USER_NORMAL_ACCOUNT 16
54 #define USER_MNS_LOGON_ACCOUNT 32
55 #define USER_INTERDOMAIN_TRUST_ACCOUNT 64
56 #define USER_WORKSTATION_TRUST_ACCOUNT 128
57 #define USER_SERVER_TRUST_ACCOUNT 256
58 #define USER_DONT_EXPIRE_PASSWORD 512
59 #define USER_ACCOUNT_AUTO_LOCKED 1024
60 #define USER_ENCRYPTED_TEXT_PASSWORD_ALLOWED 2048
61 #define USER_SMARTCARD_REQUIRED 4096
62 #define USER_TRUSTED_FOR_DELEGATION 8192
63 #define USER_NOT_DELEGATED 16384
64 #define USER_USE_DES_KEY_ONLY 32768
65 #define USER_DONT_REQUIRE_PREAUTH 65536
66 #define USER_MACHINE_ACCOUNT_MASK 448
67 #define USER_ACCOUNT_TYPE_MASK 472
68 #define USER_ALL_PARAMETERS 2097152
69 #if !defined(_NTDEF_H) && !defined(_NTSECAPI_H)
70 typedef LONG NTSTATUS, *PNTSTATUS;
71 typedef struct _UNICODE_STRING {
72 USHORT Length;
73 USHORT MaximumLength;
74 PWSTR Buffer;
75 } UNICODE_STRING, *PUNICODE_STRING;
76 typedef struct _STRING {
77 USHORT Length;
78 USHORT MaximumLength;
79 PCHAR Buffer;
80 } STRING, *PSTRING;
81 #endif
82 typedef PVOID SAM_HANDLE, *PSAM_HANDLE;
83 typedef struct _OLD_LARGE_INTEGER {
84 ULONG LowPart;
85 LONG HighPart;
86 } OLD_LARGE_INTEGER, *POLD_LARGE_INTEGER;
87 typedef enum _NETLOGON_LOGON_INFO_CLASS {
88 NetlogonInteractiveInformation = 1,NetlogonNetworkInformation,
89 NetlogonServiceInformation,NetlogonGenericInformation,
90 NetlogonInteractiveTransitiveInformation,NetlogonNetworkTransitiveInformation,
91 NetlogonServiceTransitiveInformation
92 } NETLOGON_LOGON_INFO_CLASS;
93 typedef struct _CYPHER_BLOCK {
94 CHAR data[CYPHER_BLOCK_LENGTH];
95 } CYPHER_BLOCK, *PCYPHER_BLOCK;
96 typedef struct _CLEAR_BLOCK {
97 CHAR data[CLEAR_BLOCK_LENGTH];
98 } CLEAR_BLOCK, *PCLEAR_BLOCK;
99 typedef struct _LM_OWF_PASSWORD {
100 CYPHER_BLOCK data[2];
101 } LM_OWF_PASSWORD, *PLM_OWF_PASSWORD;
102 typedef struct _USER_SESSION_KEY {
103 CYPHER_BLOCK data[2];
104 } USER_SESSION_KEY, *PUSER_SESSION_KEY;
105 typedef CLEAR_BLOCK LM_CHALLENGE, *PLM_CHALLENGE;
106 typedef LM_OWF_PASSWORD NT_OWF_PASSWORD, *PNT_OWF_PASSWORD;
107 typedef LM_CHALLENGE NT_CHALLENGE, *PNT_CHALLENGE;
108 typedef struct _LOGON_HOURS {
109 USHORT UnitsPerWeek;
110 PUCHAR LogonHours;
111 } LOGON_HOURS, *PLOGON_HOURS;
112 typedef struct _SR_SECURITY_DESCRIPTOR {
113 ULONG Length;
114 PUCHAR SecurityDescriptor;
115 } SR_SECURITY_DESCRIPTOR, *PSR_SECURITY_DESCRIPTOR;
116 #pragma pack(push,4)
117 typedef struct _USER_ALL_INFORMATION {
118 LARGE_INTEGER LastLogon;
119 LARGE_INTEGER LastLogoff;
120 LARGE_INTEGER PasswordLastSet;
121 LARGE_INTEGER AccountExpires;
122 LARGE_INTEGER PasswordCanChange;
123 LARGE_INTEGER PasswordMustChange;
124 UNICODE_STRING UserName;
125 UNICODE_STRING FullName;
126 UNICODE_STRING HomeDirectory;
127 UNICODE_STRING HomeDirectoryDrive;
128 UNICODE_STRING ScriptPath;
129 UNICODE_STRING ProfilePath;
130 UNICODE_STRING AdminComment;
131 UNICODE_STRING WorkStations;
132 UNICODE_STRING UserComment;
133 UNICODE_STRING Parameters;
134 UNICODE_STRING LmPassword;
135 UNICODE_STRING NtPassword;
136 UNICODE_STRING PrivateData;
137 SR_SECURITY_DESCRIPTOR SecurityDescriptor;
138 ULONG UserId;
139 ULONG PrimaryGroupId;
140 ULONG UserAccountControl;
141 ULONG WhichFields;
142 LOGON_HOURS LogonHours;
143 USHORT BadPasswordCount;
144 USHORT LogonCount;
145 USHORT CountryCode;
146 USHORT CodePage;
147 BOOLEAN LmPasswordPresent;
148 BOOLEAN NtPasswordPresent;
149 BOOLEAN PasswordExpired;
150 BOOLEAN PrivateDataSensitive;
151 } USER_ALL_INFORMATION, *PUSER_ALL_INFORMATION;
152 #pragma pack(pop)
153 typedef struct _MSV1_0_VALIDATION_INFO {
154 LARGE_INTEGER LogoffTime;
155 LARGE_INTEGER KickoffTime;
156 UNICODE_STRING LogonServer;
157 UNICODE_STRING LogonDomainName;
158 USER_SESSION_KEY SessionKey;
159 BOOLEAN Authoritative;
160 ULONG UserFlags;
161 ULONG WhichFields;
162 ULONG UserId;
163 } MSV1_0_VALIDATION_INFO, *PMSV1_0_VALIDATION_INFO;
164 typedef struct _NETLOGON_LOGON_IDENTITY_INFO {
165 UNICODE_STRING LogonDomainName;
166 ULONG ParameterControl;
167 OLD_LARGE_INTEGER LogonId;
168 UNICODE_STRING UserName;
169 UNICODE_STRING Workstation;
170 } NETLOGON_LOGON_IDENTITY_INFO, *PNETLOGON_LOGON_IDENTITY_INFO;
171 typedef struct _NETLOGON_INTERACTIVE_INFO {
172 NETLOGON_LOGON_IDENTITY_INFO Identity;
173 LM_OWF_PASSWORD LmOwfPassword;
174 NT_OWF_PASSWORD NtOwfPassword;
175 } NETLOGON_INTERACTIVE_INFO, *PNETLOGON_INTERACTIVE_INFO;
176 typedef struct _NETLOGON_GENERIC_INFO {
177 NETLOGON_LOGON_IDENTITY_INFO Identity;
178 UNICODE_STRING PackageName;
179 ULONG DataLength;
180 PUCHAR LogonData;
181 } NETLOGON_GENERIC_INFO, *PNETLOGON_GENERIC_INFO;
182 typedef struct _NETLOGON_NETWORK_INFO {
183 NETLOGON_LOGON_IDENTITY_INFO Identity;
184 LM_CHALLENGE LmChallenge;
185 STRING NtChallengeResponse;
186 STRING LmChallengeResponse;
187 } NETLOGON_NETWORK_INFO, *PNETLOGON_NETWORK_INFO;
188 typedef struct _NETLOGON_SERVICE_INFO {
189 NETLOGON_LOGON_IDENTITY_INFO Identity;
190 LM_OWF_PASSWORD LmOwfPassword;
191 NT_OWF_PASSWORD NtOwfPassword;
192 } NETLOGON_SERVICE_INFO, *PNETLOGON_SERVICE_INFO;
193 NTSTATUS NTAPI Msv1_0SubAuthenticationRoutine(NETLOGON_LOGON_INFO_CLASS,PVOID,
194 ULONG,PUSER_ALL_INFORMATION,PULONG,PULONG,
195 PBOOLEAN,PLARGE_INTEGER,PLARGE_INTEGER);
196 NTSTATUS NTAPI Msv1_0SubAuthenticationFilter(NETLOGON_LOGON_INFO_CLASS,PVOID,
197 ULONG,PUSER_ALL_INFORMATION,PULONG,PULONG,
198 PBOOLEAN,PLARGE_INTEGER,PLARGE_INTEGER);
199 NTSTATUS NTAPI Msv1_0SubAuthenticationRoutineGeneric(PVOID,ULONG,PULONG,PVOID*);
200 NTSTATUS NTAPI Msv1_0SubAuthenticationRoutineEx(NETLOGON_LOGON_INFO_CLASS,PVOID,
201 ULONG,PUSER_ALL_INFORMATION,SAM_HANDLE,
202 PMSV1_0_VALIDATION_INFO,PULONG);
203 #ifdef __cplusplus
204 }
205 #endif
206 #endif /* _SUBAUTH_H */