kernel32/tests: Fix a race condition in test_QueryInformationJobObject().
[wine.git] / include / ntsecpkg.h
blob99b9ec7d407fab3c341078c244623b8fd6ca6338
1 /*
2 * Copyright (C) 2007 Yuval Fledel
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifndef _NTSECPKG_H
20 #define _NTSECPKG_H
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
26 /* Flags for the MachineState field in SECPKG_PARAMETERS */
27 #define SECPKG_STATE_ENCRYPTION_PERMITTED 0x01
28 #define SECPKG_STATE_STRONG_ENCRYPTION_PERMITTED 0x02
29 #define SECPKG_STATE_DOMAIN_CONTROLLER 0x04
30 #define SECPKG_STATE_WORKSTATION 0x08
31 #define SECPKG_STATE_STANDALONE 0x10
33 /* Version magics as passed to or returned from Sp[Lsa,Mode]ModeInitialize */
34 #define SECPKG_INTERFACE_VERSION 0x10000
35 #define SECPKG_INTERFACE_VERSION_2 0x20000
36 #define SECPKG_INTERFACE_VERSION_3 0x40000
37 #define SECPKG_INTERFACE_VERSION_4 0x80000
38 #define SECPKG_INTERFACE_VERSION_5 0x100000
39 #define SECPKG_INTERFACE_VERSION_6 0x200000
40 #define SECPKG_INTERFACE_VERSION_7 0x400000
41 #define SECPKG_INTERFACE_VERSION_8 0x800000
43 /* enum definitions for Secure Service Provider/Authentication Packages */
44 typedef enum _LSA_TOKEN_INFORMATION_TYPE {
45 LsaTokenInformationNull,
46 LsaTokenInformationV1
47 } LSA_TOKEN_INFORMATION_TYPE, *PLSA_TOKEN_INFORMATION_TYPE;
49 typedef enum _SECPKG_EXTENDED_INFORMATION_CLASS
51 SecpkgGssInfo = 1,
52 SecpkgContextThunks,
53 SecpkgMutualAuthLevel,
54 SecpkgMaxInfo
55 } SECPKG_EXTENDED_INFORMATION_CLASS;
57 typedef enum _SECPKG_NAME_TYPE {
58 SecNameSamCompatible,
59 SecNameAlternateId,
60 SecNameFlat,
61 SecNameDN
62 } SECPKG_NAME_TYPE;
64 /* struct definitions for SSP/AP */
65 typedef struct _SECPKG_PRIMARY_CRED {
66 LUID LogonId;
67 UNICODE_STRING DownlevelName;
68 UNICODE_STRING DomainName;
69 UNICODE_STRING Password;
70 UNICODE_STRING OldPassword;
71 PSID UserSid;
72 ULONG Flags;
73 UNICODE_STRING DnsDomainName;
74 UNICODE_STRING Upn;
75 UNICODE_STRING LogonServer;
76 UNICODE_STRING Spare1;
77 UNICODE_STRING Spare2;
78 UNICODE_STRING Spare3;
79 UNICODE_STRING Spare4;
80 } SECPKG_PRIMARY_CRED, *PSECPKG_PRIMARY_CRED;
82 typedef struct _SECPKG_SUPPLEMENTAL_CRED {
83 UNICODE_STRING PackageName;
84 ULONG CredentialSize;
85 PUCHAR Credentials;
86 } SECPKG_SUPPLEMENTAL_CRED, *PSECPKG_SUPPLEMENTAL_CRED;
88 typedef struct _SECPKG_SUPPLEMENTAL_CRED_ARRAY {
89 ULONG CredentialCount;
90 SECPKG_SUPPLEMENTAL_CRED Credentials[1];
91 } SECPKG_SUPPLEMENTAL_CRED_ARRAY, *PSECPKG_SUPPLEMENTAL_CRED_ARRAY;
93 typedef struct _SECPKG_PARAMETERS {
94 ULONG Version;
95 ULONG MachineState;
96 ULONG SetupMode;
97 PSID DomainSid;
98 UNICODE_STRING DomainName;
99 UNICODE_STRING DnsDomainName;
100 GUID DomainGuid;
101 } SECPKG_PARAMETERS, *PSECPKG_PARAMETERS,
102 SECPKG_EVENT_DOMAIN_CHANGE, *PSECPKG_EVENT_DOMAIN_CHANGE;
104 typedef struct _SECPKG_CLIENT_INFO {
105 LUID LogonId;
106 ULONG ProcessID;
107 ULONG ThreadID;
108 BOOLEAN HasTcbPrivilege;
109 BOOLEAN Impersonating;
110 BOOLEAN Restricted;
111 } SECPKG_CLIENT_INFO,
112 *PSECPKG_CLIENT_INFO;
114 typedef struct _SECURITY_USER_DATA {
115 UNICODE_STRING UserName;
116 UNICODE_STRING LogonDomainName;
117 UNICODE_STRING LogonServer;
118 PSID pSid;
119 } SECURITY_USER_DATA, *PSECURITY_USER_DATA,
120 SecurityUserData, *PSecurityUserData;
122 typedef struct _SECPKG_GSS_INFO {
123 ULONG EncodedIdLength;
124 UCHAR EncodedId[4];
125 } SECPKG_GSS_INFO, *PSECPKG_GSS_INFO;
127 typedef struct _SECPKG_CONTEXT_THUNKS {
128 ULONG InfoLevelCount;
129 ULONG Levels[1];
130 } SECPKG_CONTEXT_THUNKS, *PSECPKG_CONTEXT_THUNKS;
132 typedef struct _SECPKG_MUTUAL_AUTH_LEVEL {
133 ULONG MutualAuthLevel;
134 } SECPKG_MUTUAL_AUTH_LEVEL, *PSECPKG_MUTUAL_AUTH_LEVEL;
136 typedef struct _SECPKG_CALL_INFO {
137 ULONG ProcessId;
138 ULONG ThreadId;
139 ULONG Attributes;
140 ULONG CallCount;
141 } SECPKG_CALL_INFO, *PSECPKG_CALL_INFO;
143 typedef struct _SECPKG_EXTENDED_INFORMATION {
144 SECPKG_EXTENDED_INFORMATION_CLASS Class;
145 union {
146 SECPKG_GSS_INFO GssInfo;
147 SECPKG_CONTEXT_THUNKS ContextThunks;
148 SECPKG_MUTUAL_AUTH_LEVEL MutualAuthLevel;
149 } Info;
150 } SECPKG_EXTENDED_INFORMATION, *PSECPKG_EXTENDED_INFORMATION;
152 typedef struct _SECPKG_TARGETINFO {
153 PSID DomainSid;
154 PCWSTR ComputerName;
155 } SECPKG_TARGETINFO, *PSECPKG_TARGETINFO;
157 typedef struct _SECPKG_POST_LOGON_USER_INFO {
158 ULONG Flags;
159 LUID LogonId;
160 LUID LinkedLogonId;
161 } SECPKG_POST_LOGON_USER_INFO, *PSECPKG_POST_LOGON_USER_INFO;
163 /* callbacks implemented by SSP/AP dlls and called by the LSA */
164 typedef VOID (NTAPI *PLSA_CALLBACK_FUNCTION)(ULONG_PTR, ULONG_PTR, PSecBuffer,
165 PSecBuffer);
167 /* misc typedefs used in the below prototypes */
168 typedef PVOID *PLSA_CLIENT_REQUEST;
169 typedef ULONG_PTR LSA_SEC_HANDLE, *PLSA_SEC_HANDLE;
170 typedef LPTHREAD_START_ROUTINE SEC_THREAD_START;
171 typedef PSECURITY_ATTRIBUTES SEC_ATTRS;
173 /* functions used by SSP/AP obtainable by dispatch tables */
174 typedef NTSTATUS (NTAPI *PLSA_REGISTER_CALLBACK)(ULONG, PLSA_CALLBACK_FUNCTION);
175 typedef NTSTATUS (NTAPI *PLSA_CREATE_LOGON_SESSION)(PLUID);
176 typedef NTSTATUS (NTAPI *PLSA_DELETE_LOGON_SESSION)(PLUID);
177 typedef NTSTATUS (NTAPI *PLSA_ADD_CREDENTIAL)(PLUID, ULONG, PLSA_STRING,
178 PLSA_STRING);
179 typedef NTSTATUS (NTAPI *PLSA_GET_CREDENTIALS)(PLUID, ULONG, PULONG, BOOLEAN,
180 PLSA_STRING, PULONG, PLSA_STRING);
181 typedef NTSTATUS (NTAPI *PLSA_DELETE_CREDENTIAL)(PLUID, ULONG, PLSA_STRING);
182 typedef PVOID (NTAPI *PLSA_ALLOCATE_LSA_HEAP)(ULONG);
183 typedef VOID (NTAPI *PLSA_FREE_LSA_HEAP)(PVOID);
184 typedef NTSTATUS (NTAPI *PLSA_ALLOCATE_CLIENT_BUFFER)(PLSA_CLIENT_REQUEST,
185 ULONG, PVOID*);
186 typedef NTSTATUS (NTAPI *PLSA_FREE_CLIENT_BUFFER)(PLSA_CLIENT_REQUEST, PVOID);
187 typedef NTSTATUS (NTAPI *PLSA_COPY_TO_CLIENT_BUFFER)(PLSA_CLIENT_REQUEST, ULONG,
188 PVOID, PVOID);
189 typedef NTSTATUS (NTAPI *PLSA_COPY_FROM_CLIENT_BUFFER)(PLSA_CLIENT_REQUEST,
190 ULONG, PVOID, PVOID);
191 typedef NTSTATUS (NTAPI *PLSA_IMPERSONATE_CLIENT)(void);
192 typedef NTSTATUS (NTAPI *PLSA_UNLOAD_PACKAGE)(void);
193 typedef NTSTATUS (NTAPI *PLSA_DUPLICATE_HANDLE)(HANDLE, PHANDLE);
194 typedef NTSTATUS (NTAPI *PLSA_SAVE_SUPPLEMENTAL_CREDENTIALS)(PLUID, ULONG,
195 PVOID, BOOLEAN);
196 typedef HANDLE (NTAPI *PLSA_CREATE_THREAD)(SEC_ATTRS, ULONG, SEC_THREAD_START,
197 PVOID, ULONG, PULONG);
198 typedef NTSTATUS (NTAPI *PLSA_GET_CLIENT_INFO)(PSECPKG_CLIENT_INFO);
199 typedef HANDLE (NTAPI *PLSA_REGISTER_NOTIFICATION)(SEC_THREAD_START, PVOID,
200 ULONG, ULONG, ULONG, ULONG, HANDLE);
201 typedef NTSTATUS (NTAPI *PLSA_CANCEL_NOTIFICATION)(HANDLE);
202 typedef NTSTATUS (NTAPI *PLSA_MAP_BUFFER)(PSecBuffer, PSecBuffer);
203 typedef NTSTATUS (NTAPI *PLSA_CREATE_TOKEN)(PLUID, PTOKEN_SOURCE,
204 SECURITY_LOGON_TYPE, SECURITY_IMPERSONATION_LEVEL, LSA_TOKEN_INFORMATION_TYPE,
205 PVOID, PTOKEN_GROUPS, PUNICODE_STRING, PUNICODE_STRING, PUNICODE_STRING,
206 PUNICODE_STRING, PHANDLE, PNTSTATUS);
207 typedef VOID (NTAPI *PLSA_AUDIT_LOGON)(NTSTATUS, NTSTATUS, PUNICODE_STRING,
208 PUNICODE_STRING, PUNICODE_STRING, OPTIONAL PSID, SECURITY_LOGON_TYPE,
209 PTOKEN_SOURCE, PLUID);
210 typedef NTSTATUS (NTAPI *PLSA_CALL_PACKAGE)(PUNICODE_STRING, PVOID, ULONG,
211 PVOID*, PULONG, PNTSTATUS);
212 typedef BOOLEAN (NTAPI *PLSA_GET_CALL_INFO)(PSECPKG_CALL_INFO);
213 typedef NTSTATUS (NTAPI *PLSA_CALL_PACKAGEEX)(PUNICODE_STRING, PVOID, PVOID,
214 ULONG, PVOID*, PULONG, PNTSTATUS);
215 typedef PVOID (NTAPI *PLSA_CREATE_SHARED_MEMORY)(ULONG, ULONG);
216 typedef PVOID (NTAPI *PLSA_ALLOCATE_SHARED_MEMORY)(PVOID, ULONG);
217 typedef VOID (NTAPI *PLSA_FREE_SHARED_MEMORY)(PVOID, PVOID);
218 typedef BOOLEAN (NTAPI *PLSA_DELETE_SHARED_MEMORY)(PVOID);
219 typedef NTSTATUS (NTAPI *PLSA_OPEN_SAM_USER)(PUNICODE_STRING, SECPKG_NAME_TYPE,
220 PUNICODE_STRING, BOOLEAN, ULONG, PVOID*);
221 typedef NTSTATUS (NTAPI *PLSA_GET_USER_CREDENTIALS)(PVOID, PVOID *, PULONG,
222 PVOID *, PULONG);
223 typedef NTSTATUS (NTAPI *PLSA_GET_USER_AUTH_DATA)(PVOID, PUCHAR *, PULONG);
224 typedef NTSTATUS (NTAPI *PLSA_CLOSE_SAM_USER)(PVOID);
225 typedef NTSTATUS (NTAPI *PLSA_CONVERT_AUTH_DATA_TO_TOKEN)(PVOID, ULONG,
226 SECURITY_IMPERSONATION_LEVEL, PTOKEN_SOURCE, SECURITY_LOGON_TYPE,
227 PUNICODE_STRING, PHANDLE, PLUID, PUNICODE_STRING, PNTSTATUS);
228 typedef NTSTATUS (NTAPI *PLSA_CLIENT_CALLBACK)(PCHAR, ULONG_PTR, ULONG_PTR,
229 PSecBuffer, PSecBuffer);
230 typedef NTSTATUS (NTAPI *PLSA_UPDATE_PRIMARY_CREDENTIALS)(PSECPKG_PRIMARY_CRED, PSECPKG_SUPPLEMENTAL_CRED_ARRAY);
231 typedef NTSTATUS (NTAPI *PLSA_GET_AUTH_DATA_FOR_USER)(PUNICODE_STRING,
232 SECPKG_NAME_TYPE, PUNICODE_STRING, PUCHAR *, PULONG, PUNICODE_STRING);
233 typedef NTSTATUS (NTAPI *PLSA_CRACK_SINGLE_NAME)(ULONG, BOOLEAN,
234 PUNICODE_STRING, PUNICODE_STRING, ULONG, PUNICODE_STRING, PUNICODE_STRING,
235 PULONG);
236 typedef NTSTATUS (NTAPI *PLSA_AUDIT_ACCOUNT_LOGON)(ULONG, BOOLEAN,
237 PUNICODE_STRING, PUNICODE_STRING, PUNICODE_STRING, NTSTATUS);
238 typedef NTSTATUS (NTAPI *PLSA_CALL_PACKAGE_PASSTHROUGH)(PUNICODE_STRING, PVOID,
239 PVOID, ULONG, PVOID*, PULONG, PNTSTATUS);
241 /* Dispatch tables of functions used by SSP/AP */
242 typedef struct SECPKG_DLL_FUNCTIONS {
243 PLSA_ALLOCATE_LSA_HEAP AllocateHeap;
244 PLSA_FREE_LSA_HEAP FreeHeap;
245 PLSA_REGISTER_CALLBACK RegisterCallback;
246 } SECPKG_DLL_FUNCTIONS,
247 *PSECPKG_DLL_FUNCTIONS;
249 typedef struct LSA_DISPATCH_TABLE {
250 PLSA_CREATE_LOGON_SESSION CreateLogonSession;
251 PLSA_DELETE_LOGON_SESSION DeleteLogonSession;
252 PLSA_ADD_CREDENTIAL AddCredential;
253 PLSA_GET_CREDENTIALS GetCredentials;
254 PLSA_DELETE_CREDENTIAL DeleteCredential;
255 PLSA_ALLOCATE_LSA_HEAP AllocateLsaHeap;
256 PLSA_FREE_LSA_HEAP FreeLsaHeap;
257 PLSA_ALLOCATE_CLIENT_BUFFER AllocateClientBuffer;
258 PLSA_FREE_CLIENT_BUFFER FreeClientBuffer;
259 PLSA_COPY_TO_CLIENT_BUFFER CopyToClientBuffer;
260 PLSA_COPY_FROM_CLIENT_BUFFER CopyFromClientBuffer;
261 } LSA_DISPATCH_TABLE,
262 *PLSA_DISPATCH_TABLE;
264 typedef struct _LSA_SECPKG_FUNCTION_TABLE {
265 PLSA_CREATE_LOGON_SESSION CreateLogonSession;
266 PLSA_DELETE_LOGON_SESSION DeleteLogonSession;
267 PLSA_ADD_CREDENTIAL AddCredential;
268 PLSA_GET_CREDENTIALS GetCredentials;
269 PLSA_DELETE_CREDENTIAL DeleteCredential;
270 PLSA_ALLOCATE_LSA_HEAP AllocateLsaHeap;
271 PLSA_FREE_LSA_HEAP FreeLsaHeap;
272 PLSA_ALLOCATE_CLIENT_BUFFER AllocateClientBuffer;
273 PLSA_FREE_CLIENT_BUFFER FreeClientBuffer;
274 PLSA_COPY_TO_CLIENT_BUFFER CopyToClientBuffer;
275 PLSA_COPY_FROM_CLIENT_BUFFER CopyFromClientBuffer;
276 PLSA_IMPERSONATE_CLIENT ImpersonateClient;
277 PLSA_UNLOAD_PACKAGE UnloadPackage;
278 PLSA_DUPLICATE_HANDLE DuplicateHandle;
279 PLSA_SAVE_SUPPLEMENTAL_CREDENTIALS SaveSupplementalCredentials;
280 PLSA_CREATE_THREAD CreateThread;
281 PLSA_GET_CLIENT_INFO GetClientInfo;
282 PLSA_REGISTER_NOTIFICATION RegisterNotification;
283 PLSA_CANCEL_NOTIFICATION CancelNotification;
284 PLSA_MAP_BUFFER MapBuffer;
285 PLSA_CREATE_TOKEN CreateToken;
286 PLSA_AUDIT_LOGON AuditLogon;
287 PLSA_CALL_PACKAGE CallPackage;
288 PLSA_FREE_LSA_HEAP FreeReturnBuffer;
289 PLSA_GET_CALL_INFO GetCallInfo;
290 PLSA_CALL_PACKAGEEX CallPackageEx;
291 PLSA_CREATE_SHARED_MEMORY CreateSharedMemory;
292 PLSA_ALLOCATE_SHARED_MEMORY AllocateSharedMemory;
293 PLSA_FREE_SHARED_MEMORY FreeSharedMemory;
294 PLSA_DELETE_SHARED_MEMORY DeleteSharedMemory;
295 PLSA_OPEN_SAM_USER OpenSamUser;
296 PLSA_GET_USER_CREDENTIALS GetUserCredentials;
297 PLSA_GET_USER_AUTH_DATA GetUserAuthData;
298 PLSA_CLOSE_SAM_USER CloseSamUser;
299 PLSA_CONVERT_AUTH_DATA_TO_TOKEN ConvertAuthDataToToken;
300 PLSA_CLIENT_CALLBACK ClientCallback;
301 PLSA_UPDATE_PRIMARY_CREDENTIALS UpdateCredentials;
302 PLSA_GET_AUTH_DATA_FOR_USER GetAuthDataForUser;
303 PLSA_CRACK_SINGLE_NAME CrackSingleName;
304 PLSA_AUDIT_ACCOUNT_LOGON AuditAccountLogon;
305 PLSA_CALL_PACKAGE_PASSTHROUGH CallPackagePassthrough;
306 } LSA_SECPKG_FUNCTION_TABLE,
307 *PLSA_SECPKG_FUNCTION_TABLE;
309 /* Functions for redirected credentials */
310 typedef NTSTATUS (NTAPI *PLSA_REDIRECTED_LOGON_INIT)(HANDLE,
311 const UNICODE_STRING *, ULONG, const LUID *);
312 typedef NTSTATUS (NTAPI *PLSA_REDIRECTED_LOGON_CALLBACK)(HANDLE, PVOID, ULONG,
313 PVOID *, ULONG *);
314 typedef VOID (NTAPI *PLSA_REDIRECTED_LOGON_CLEANUP_CALLBACK)(HANDLE);
315 typedef NTSTATUS (NTAPI *PLSA_REDIRECTED_LOGON_GET_LOGON_CREDS)(HANDLE, PBYTE *,
316 PULONG);
317 typedef NTSTATUS (NTAPI *PLSA_REDIRECTED_LOGON_GET_SUPP_CREDS)(HANDLE,
318 PSECPKG_SUPPLEMENTAL_CRED_ARRAY *);
320 typedef struct _SECPKG_REDIRECTED_LOGON_BUFFER {
321 GUID RedirectedLogonGuid;
322 HANDLE RedirectedLogonHandle;
323 PLSA_REDIRECTED_LOGON_INIT Init;
324 PLSA_REDIRECTED_LOGON_CALLBACK Callback;
325 PLSA_REDIRECTED_LOGON_CLEANUP_CALLBACK CleanupCallback;
326 PLSA_REDIRECTED_LOGON_GET_LOGON_CREDS GetLogonCreds;
327 PLSA_REDIRECTED_LOGON_GET_SUPP_CREDS GetSupplementalCreds;
328 } SECPKG_REDIRECTED_LOGON_BUFFER,
329 *PSECPKG_REDIRECTED_LOGON_BUFFER;
331 /* LSA-mode functions implemented by SSP/AP obtainable by a dispatch table */
332 typedef NTSTATUS (NTAPI *PLSA_AP_INITIALIZE_PACKAGE)(ULONG, PLSA_DISPATCH_TABLE,
333 PLSA_STRING, PLSA_STRING, PLSA_STRING *);
334 typedef NTSTATUS (NTAPI *PLSA_AP_LOGON_USER)(PLSA_CLIENT_REQUEST, SECURITY_LOGON_TYPE,
335 PVOID, PVOID, ULONG, PVOID *, PULONG, PLUID LogonId, PNTSTATUS, PLSA_TOKEN_INFORMATION_TYPE,
336 PVOID *, PLSA_UNICODE_STRING *, PLSA_UNICODE_STRING *);
337 typedef NTSTATUS (NTAPI *PLSA_AP_CALL_PACKAGE)(PLSA_CLIENT_REQUEST, PVOID, PVOID, ULONG,
338 PVOID *, PULONG, PNTSTATUS);
339 typedef VOID (NTAPI *PLSA_AP_LOGON_TERMINATED)(PLUID);
340 typedef NTSTATUS (NTAPI *PLSA_AP_CALL_PACKAGE_UNTRUSTED)(PLSA_CLIENT_REQUEST,
341 PVOID, PVOID, ULONG, PVOID *, PULONG, PNTSTATUS);
342 typedef NTSTATUS (NTAPI *PLSA_AP_CALL_PACKAGE_PASSTHROUGH)(PLSA_CLIENT_REQUEST,
343 PVOID, PVOID, ULONG, PVOID *, PULONG, PNTSTATUS);
344 typedef NTSTATUS (NTAPI *PLSA_AP_LOGON_USER_EX)(PLSA_CLIENT_REQUEST,
345 SECURITY_LOGON_TYPE, PVOID, PVOID, ULONG, PVOID *, PULONG, PLUID, PNTSTATUS,
346 PLSA_TOKEN_INFORMATION_TYPE, PVOID *, PUNICODE_STRING *, PUNICODE_STRING *,
347 PUNICODE_STRING *);
348 typedef NTSTATUS (NTAPI *PLSA_AP_LOGON_USER_EX2)(PLSA_CLIENT_REQUEST,
349 SECURITY_LOGON_TYPE, PVOID, PVOID, ULONG, PVOID *, PULONG, PLUID, PNTSTATUS,
350 PLSA_TOKEN_INFORMATION_TYPE, PVOID *, PUNICODE_STRING *, PUNICODE_STRING *,
351 PUNICODE_STRING *, PSECPKG_PRIMARY_CRED, PSECPKG_SUPPLEMENTAL_CRED_ARRAY *);
352 typedef NTSTATUS (NTAPI SpInitializeFn)(ULONG_PTR, PSECPKG_PARAMETERS,
353 PLSA_SECPKG_FUNCTION_TABLE);
354 typedef NTSTATUS (NTAPI SpShutdownFn)(void);
355 typedef NTSTATUS (NTAPI SpGetInfoFn)(PSecPkgInfoW);
356 typedef NTSTATUS (NTAPI SpAcceptCredentialsFn)(SECURITY_LOGON_TYPE,
357 PUNICODE_STRING, PSECPKG_PRIMARY_CRED, PSECPKG_SUPPLEMENTAL_CRED);
358 typedef NTSTATUS (NTAPI SpAcquireCredentialsHandleFn)(PUNICODE_STRING, ULONG,
359 PLUID, PVOID, PVOID, PVOID, PLSA_SEC_HANDLE, PTimeStamp);
360 typedef NTSTATUS (NTAPI SpQueryCredentialsAttributesFn)(LSA_SEC_HANDLE, ULONG,
361 PVOID);
362 typedef NTSTATUS (NTAPI SpFreeCredentialsHandleFn)(LSA_SEC_HANDLE);
363 typedef NTSTATUS (NTAPI SpSaveCredentialsFn)(LSA_SEC_HANDLE, PSecBuffer);
364 typedef NTSTATUS (NTAPI SpGetCredentialsFn)(LSA_SEC_HANDLE, PSecBuffer);
365 typedef NTSTATUS (NTAPI SpDeleteCredentialsFn)(LSA_SEC_HANDLE, PSecBuffer);
366 typedef NTSTATUS (NTAPI SpInitLsaModeContextFn)(LSA_SEC_HANDLE, LSA_SEC_HANDLE,
367 PUNICODE_STRING, ULONG, ULONG, PSecBufferDesc, PLSA_SEC_HANDLE, PSecBufferDesc,
368 PULONG, PTimeStamp, PBOOLEAN, PSecBuffer);
369 typedef NTSTATUS (NTAPI SpAcceptLsaModeContextFn)(LSA_SEC_HANDLE,
370 LSA_SEC_HANDLE, PSecBufferDesc, ULONG, ULONG, PLSA_SEC_HANDLE, PSecBufferDesc,
371 PULONG, PTimeStamp, PBOOLEAN, PSecBuffer);
372 typedef NTSTATUS (NTAPI SpDeleteContextFn)(LSA_SEC_HANDLE);
373 typedef NTSTATUS (NTAPI SpApplyControlTokenFn)(LSA_SEC_HANDLE, PSecBufferDesc);
374 typedef NTSTATUS (NTAPI SpGetUserInfoFn)(PLUID, ULONG, PSecurityUserData *);
375 typedef NTSTATUS (NTAPI SpGetExtendedInformationFn)(
376 SECPKG_EXTENDED_INFORMATION_CLASS, PSECPKG_EXTENDED_INFORMATION *);
377 typedef NTSTATUS (NTAPI SpQueryContextAttributesFn)(LSA_SEC_HANDLE, ULONG,
378 PVOID);
379 typedef NTSTATUS (NTAPI SpAddCredentialsFn)(LSA_SEC_HANDLE, PUNICODE_STRING,
380 PUNICODE_STRING, ULONG, PVOID, PVOID, PVOID, PTimeStamp);
381 typedef NTSTATUS (NTAPI SpSetExtendedInformationFn)(
382 SECPKG_EXTENDED_INFORMATION_CLASS, PSECPKG_EXTENDED_INFORMATION);
383 typedef NTSTATUS (NTAPI SpSetContextAttributesFn)(LSA_SEC_HANDLE, ULONG, PVOID,
384 ULONG);
385 typedef NTSTATUS (NTAPI SpSetCredentialsAttributesFn)(LSA_SEC_HANDLE, ULONG,
386 PVOID, ULONG);
387 typedef NTSTATUS (NTAPI SpChangeAccountPasswordFn)(PUNICODE_STRING,
388 PUNICODE_STRING, PUNICODE_STRING, PUNICODE_STRING, BOOLEAN, PSecBufferDesc);
389 typedef NTSTATUS (NTAPI SpQueryMetaDataFn)(LSA_SEC_HANDLE, PUNICODE_STRING,
390 ULONG, PULONG, PUCHAR *, PLSA_SEC_HANDLE);
391 typedef NTSTATUS (NTAPI SpExchangeMetaDataFn)(LSA_SEC_HANDLE, PUNICODE_STRING,
392 ULONG, ULONG, PUCHAR, PLSA_SEC_HANDLE);
393 typedef NTSTATUS (NTAPI SpGetCredUIContextFn)(LSA_SEC_HANDLE, GUID *, PULONG,
394 PUCHAR *);
395 typedef NTSTATUS (NTAPI SpUpdateCredentialsFn)(LSA_SEC_HANDLE, GUID *, ULONG,
396 PUCHAR);
397 typedef NTSTATUS (NTAPI SpValidateTargetInfoFn)(PLSA_CLIENT_REQUEST, PVOID,
398 PVOID, ULONG, PSECPKG_TARGETINFO);
399 typedef NTSTATUS (NTAPI LSA_AP_POST_LOGON_USER)(PSECPKG_POST_LOGON_USER_INFO);
400 typedef NTSTATUS (NTAPI SpGetRemoteCredGuardLogonBufferFn)(LSA_SEC_HANDLE,
401 const UNICODE_STRING *, PHANDLE, PLSA_REDIRECTED_LOGON_CALLBACK *,
402 PLSA_REDIRECTED_LOGON_CLEANUP_CALLBACK *, PULONG, PVOID *);
403 typedef NTSTATUS (NTAPI SpGetRemoteCredGuardSupplementalCredsFn)(LSA_SEC_HANDLE,
404 const UNICODE_STRING *, PHANDLE, PLSA_REDIRECTED_LOGON_CALLBACK *,
405 PLSA_REDIRECTED_LOGON_CLEANUP_CALLBACK *, PULONG, PVOID *);
407 /* User-mode functions implemented by SSP/AP obtainable by a dispatch table */
408 typedef NTSTATUS (NTAPI SpInstanceInitFn)(ULONG, PSECPKG_DLL_FUNCTIONS,
409 PVOID *);
410 typedef NTSTATUS (NTAPI SpInitUserModeContextFn)(LSA_SEC_HANDLE, PSecBuffer);
411 typedef NTSTATUS (NTAPI SpMakeSignatureFn)(LSA_SEC_HANDLE, ULONG,
412 PSecBufferDesc, ULONG);
413 typedef NTSTATUS (NTAPI SpVerifySignatureFn)(LSA_SEC_HANDLE, PSecBufferDesc,
414 ULONG, PULONG);
415 typedef NTSTATUS (NTAPI SpSealMessageFn)(LSA_SEC_HANDLE, ULONG, PSecBufferDesc,
416 ULONG);
417 typedef NTSTATUS (NTAPI SpUnsealMessageFn)(LSA_SEC_HANDLE, PSecBufferDesc,
418 ULONG, PULONG);
419 typedef NTSTATUS (NTAPI SpGetContextTokenFn)(LSA_SEC_HANDLE, PHANDLE);
420 typedef NTSTATUS (NTAPI SpCompleteAuthTokenFn)(LSA_SEC_HANDLE, PSecBufferDesc);
421 typedef NTSTATUS (NTAPI SpFormatCredentialsFn)(PSecBuffer, PSecBuffer);
422 typedef NTSTATUS (NTAPI SpMarshallSupplementalCredsFn)(ULONG, PUCHAR, PULONG,
423 PVOID *);
424 typedef NTSTATUS (NTAPI SpExportSecurityContextFn)(LSA_SEC_HANDLE, ULONG,
425 PSecBuffer, PHANDLE);
426 typedef NTSTATUS (NTAPI SpImportSecurityContextFn)(PSecBuffer, HANDLE,
427 PLSA_SEC_HANDLE);
429 #ifdef WINE_NO_UNICODE_MACROS
430 #undef SetContextAttributes
431 #endif
433 /* dispatch tables of LSA-mode functions implemented by SSP/AP */
434 typedef struct SECPKG_FUNCTION_TABLE {
435 PLSA_AP_INITIALIZE_PACKAGE InitializePackage;
436 PLSA_AP_LOGON_USER LsaLogonUser;
437 PLSA_AP_CALL_PACKAGE CallPackage;
438 PLSA_AP_LOGON_TERMINATED LogonTerminated;
439 PLSA_AP_CALL_PACKAGE_UNTRUSTED CallPackageUntrusted;
440 PLSA_AP_CALL_PACKAGE_PASSTHROUGH CallPackagePassthrough;
441 PLSA_AP_LOGON_USER_EX LogonUserEx;
442 PLSA_AP_LOGON_USER_EX2 LogonUserEx2;
443 SpInitializeFn *Initialize;
444 SpShutdownFn *Shutdown;
445 SpGetInfoFn *GetInfo;
446 SpAcceptCredentialsFn *AcceptCredentials;
447 SpAcquireCredentialsHandleFn *SpAcquireCredentialsHandle;
448 SpQueryCredentialsAttributesFn *SpQueryCredentialsAttributes;
449 SpFreeCredentialsHandleFn *FreeCredentialsHandle;
450 SpSaveCredentialsFn *SaveCredentials;
451 SpGetCredentialsFn *GetCredentials;
452 SpDeleteCredentialsFn *DeleteCredentials;
453 SpInitLsaModeContextFn *InitLsaModeContext;
454 SpAcceptLsaModeContextFn *AcceptLsaModeContext;
455 SpDeleteContextFn *DeleteContext;
456 SpApplyControlTokenFn *ApplyControlToken;
457 SpGetUserInfoFn *GetUserInfo;
458 SpGetExtendedInformationFn *GetExtendedInformation;
459 SpQueryContextAttributesFn *SpQueryContextAttributes;
460 SpAddCredentialsFn *SpAddCredentials;
461 SpSetExtendedInformationFn *SetExtendedInformation;
462 /* Packages with version SECPKG_INTERFACE_VERSION end here */
463 SpSetContextAttributesFn *SetContextAttributes;
464 /* Packages with version SECPKG_INTERFACE_VERSION_2 end here */
465 SpSetCredentialsAttributesFn *SetCredentialsAttributes;
466 /* Packages with version SECPKG_INTERFACE_VERSION_3 end here */
467 SpChangeAccountPasswordFn *ChangeAccountPassword;
468 /* Packages with version SECPKG_INTERFACE_VERSION_4 end here */
469 SpQueryMetaDataFn *QueryMetaData;
470 SpExchangeMetaDataFn *ExchangeMetaData;
471 SpGetCredUIContextFn *GetCredUIContext;
472 SpUpdateCredentialsFn *UpdateCredentials;
473 /* Packages with version SECPKG_INTERFACE_VERSION_5 end here */
474 SpValidateTargetInfoFn *ValidateTargetInfo;
475 /* Packages with version SECPKG_INTERFACE_VERSION_6 end here */
476 LSA_AP_POST_LOGON_USER* PostLogonUser;
477 /* Packages with version SECPKG_INTERFACE_VERSION_7 end here */
478 SpGetRemoteCredGuardLogonBufferFn* GetRemoteCredGuardLogonBuffer;
479 SpGetRemoteCredGuardSupplementalCredsFn* GetRemoteCredGuardSupplementalCreds;
480 /* Packages with version SECPKG_INTERFACE_VERSION_8 end here */
481 } SECPKG_FUNCTION_TABLE,
482 *PSECPKG_FUNCTION_TABLE;
484 /* dispatch tables of user-mode functions implemented by SSP/AP */
485 typedef struct SECPKG_USER_FUNCTION_TABLE {
486 SpInstanceInitFn *InstanceInit;
487 SpInitUserModeContextFn *InitUserModeContext;
488 SpMakeSignatureFn *MakeSignature;
489 SpVerifySignatureFn *VerifySignature;
490 SpSealMessageFn *SealMessage;
491 SpUnsealMessageFn *UnsealMessage;
492 SpGetContextTokenFn *GetContextToken;
493 SpQueryContextAttributesFn *SpQueryContextAttributes;
494 SpCompleteAuthTokenFn *CompleteAuthToken;
495 SpDeleteContextFn *DeleteUserModeContext;
496 SpFormatCredentialsFn *FormatCredentials;
497 SpMarshallSupplementalCredsFn *MarshallSupplementalCreds;
498 SpExportSecurityContextFn *ExportContext;
499 SpImportSecurityContextFn *ImportContext;
500 } SECPKG_USER_FUNCTION_TABLE,
501 *PSECPKG_USER_FUNCTION_TABLE;
503 /* LSA-mode entry point to SSP/APs */
504 typedef NTSTATUS (NTAPI *SpLsaModeInitializeFn)(ULONG, PULONG,
505 PSECPKG_FUNCTION_TABLE *, PULONG);
507 /* User-mode entry point to SSP/APs */
508 typedef NTSTATUS (WINAPI *SpUserModeInitializeFn)(ULONG, PULONG,
509 PSECPKG_USER_FUNCTION_TABLE *, PULONG);
511 #ifdef __cplusplus
513 #endif
514 #endif /* _NTSECPKG_H */