dinput: Avoid deadlock when CS are acquired in different order.
[wine.git] / include / ntsecpkg.h
blob08373a2635d4e4a58aeb4f91beb78a90cd0983e0
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
42 /* enum definitions for Secure Service Provider/Authentication Packages */
43 typedef enum _LSA_TOKEN_INFORMATION_TYPE {
44 LsaTokenInformationNull,
45 LsaTokenInformationV1
46 } LSA_TOKEN_INFORMATION_TYPE, *PLSA_TOKEN_INFORMATION_TYPE;
48 typedef enum _SECPKG_EXTENDED_INFORMATION_CLASS
50 SecpkgGssInfo = 1,
51 SecpkgContextThunks,
52 SecpkgMutualAuthLevel,
53 SecpkgMaxInfo
54 } SECPKG_EXTENDED_INFORMATION_CLASS;
56 typedef enum _SECPKG_NAME_TYPE {
57 SecNameSamCompatible,
58 SecNameAlternateId,
59 SecNameFlat,
60 SecNameDN
61 } SECPKG_NAME_TYPE;
63 /* struct definitions for SSP/AP */
64 typedef struct _SECPKG_PRIMARY_CRED {
65 LUID LogonId;
66 UNICODE_STRING DownlevelName;
67 UNICODE_STRING DomainName;
68 UNICODE_STRING Password;
69 UNICODE_STRING OldPassword;
70 PSID UserSid;
71 ULONG Flags;
72 UNICODE_STRING DnsDomainName;
73 UNICODE_STRING Upn;
74 UNICODE_STRING LogonServer;
75 UNICODE_STRING Spare1;
76 UNICODE_STRING Spare2;
77 UNICODE_STRING Spare3;
78 UNICODE_STRING Spare4;
79 } SECPKG_PRIMARY_CRED, *PSECPKG_PRIMARY_CRED;
81 typedef struct _SECPKG_SUPPLEMENTAL_CRED {
82 UNICODE_STRING PackageName;
83 ULONG CredentialSize;
84 PUCHAR Credentials;
85 } SECPKG_SUPPLEMENTAL_CRED, *PSECPKG_SUPPLEMENTAL_CRED;
87 typedef struct _SECPKG_SUPPLEMENTAL_CRED_ARRAY {
88 ULONG CredentialCount;
89 SECPKG_SUPPLEMENTAL_CRED Credentials[1];
90 } SECPKG_SUPPLEMENTAL_CRED_ARRAY, *PSECPKG_SUPPLEMENTAL_CRED_ARRAY;
92 typedef struct _SECPKG_PARAMETERS {
93 ULONG Version;
94 ULONG MachineState;
95 ULONG SetupMode;
96 PSID DomainSid;
97 UNICODE_STRING DomainName;
98 UNICODE_STRING DnsDomainName;
99 GUID DomainGuid;
100 } SECPKG_PARAMETERS, *PSECPKG_PARAMETERS,
101 SECPKG_EVENT_DOMAIN_CHANGE, *PSECPKG_EVENT_DOMAIN_CHANGE;
103 typedef struct _SECPKG_CLIENT_INFO {
104 LUID LogonId;
105 ULONG ProcessID;
106 ULONG ThreadID;
107 BOOLEAN HasTcbPrivilege;
108 BOOLEAN Impersonating;
109 BOOLEAN Restricted;
110 } SECPKG_CLIENT_INFO,
111 *PSECPKG_CLIENT_INFO;
113 typedef struct _SECURITY_USER_DATA {
114 UNICODE_STRING UserName;
115 UNICODE_STRING LogonDomainName;
116 UNICODE_STRING LogonServer;
117 PSID pSid;
118 } SECURITY_USER_DATA, *PSECURITY_USER_DATA,
119 SecurityUserData, *PSecurityUserData;
121 typedef struct _SECPKG_GSS_INFO {
122 ULONG EncodedIdLength;
123 UCHAR EncodedId[4];
124 } SECPKG_GSS_INFO, *PSECPKG_GSS_INFO;
126 typedef struct _SECPKG_CONTEXT_THUNKS {
127 ULONG InfoLevelCount;
128 ULONG Levels[1];
129 } SECPKG_CONTEXT_THUNKS, *PSECPKG_CONTEXT_THUNKS;
131 typedef struct _SECPKG_MUTUAL_AUTH_LEVEL {
132 ULONG MutualAuthLevel;
133 } SECPKG_MUTUAL_AUTH_LEVEL, *PSECPKG_MUTUAL_AUTH_LEVEL;
135 typedef struct _SECPKG_CALL_INFO {
136 ULONG ProcessId;
137 ULONG ThreadId;
138 ULONG Attributes;
139 ULONG CallCount;
140 } SECPKG_CALL_INFO, *PSECPKG_CALL_INFO;
142 typedef struct _SECPKG_EXTENDED_INFORMATION {
143 SECPKG_EXTENDED_INFORMATION_CLASS Class;
144 union {
145 SECPKG_GSS_INFO GssInfo;
146 SECPKG_CONTEXT_THUNKS ContextThunks;
147 SECPKG_MUTUAL_AUTH_LEVEL MutualAuthLevel;
148 } Info;
149 } SECPKG_EXTENDED_INFORMATION, *PSECPKG_EXTENDED_INFORMATION;
151 typedef struct _SECPKG_TARGETINFO {
152 PSID DomainSid;
153 PCWSTR ComputerName;
154 } SECPKG_TARGETINFO, *PSECPKG_TARGETINFO;
156 typedef struct _SECPKG_POST_LOGON_USER_INFO {
157 ULONG Flags;
158 LUID LogonId;
159 LUID LinkedLogonId;
160 } SECPKG_POST_LOGON_USER_INFO, *PSECPKG_POST_LOGON_USER_INFO;
162 /* callbacks implemented by SSP/AP dlls and called by the LSA */
163 typedef VOID (NTAPI *PLSA_CALLBACK_FUNCTION)(ULONG_PTR, ULONG_PTR, PSecBuffer,
164 PSecBuffer);
166 /* misc typedefs used in the below prototypes */
167 typedef PVOID *PLSA_CLIENT_REQUEST;
168 typedef ULONG_PTR LSA_SEC_HANDLE, *PLSA_SEC_HANDLE;
169 typedef LPTHREAD_START_ROUTINE SEC_THREAD_START;
170 typedef PSECURITY_ATTRIBUTES SEC_ATTRS;
172 /* functions used by SSP/AP obtainable by dispatch tables */
173 typedef NTSTATUS (NTAPI *PLSA_REGISTER_CALLBACK)(ULONG, PLSA_CALLBACK_FUNCTION);
174 typedef NTSTATUS (NTAPI *PLSA_CREATE_LOGON_SESSION)(PLUID);
175 typedef NTSTATUS (NTAPI *PLSA_DELETE_LOGON_SESSION)(PLUID);
176 typedef NTSTATUS (NTAPI *PLSA_ADD_CREDENTIAL)(PLUID, ULONG, PLSA_STRING,
177 PLSA_STRING);
178 typedef NTSTATUS (NTAPI *PLSA_GET_CREDENTIALS)(PLUID, ULONG, PULONG, BOOLEAN,
179 PLSA_STRING, PULONG, PLSA_STRING);
180 typedef NTSTATUS (NTAPI *PLSA_DELETE_CREDENTIAL)(PLUID, ULONG, PLSA_STRING);
181 typedef PVOID (NTAPI *PLSA_ALLOCATE_LSA_HEAP)(ULONG);
182 typedef VOID (NTAPI *PLSA_FREE_LSA_HEAP)(PVOID);
183 typedef NTSTATUS (NTAPI *PLSA_ALLOCATE_CLIENT_BUFFER)(PLSA_CLIENT_REQUEST,
184 ULONG, PVOID*);
185 typedef NTSTATUS (NTAPI *PLSA_FREE_CLIENT_BUFFER)(PLSA_CLIENT_REQUEST, PVOID);
186 typedef NTSTATUS (NTAPI *PLSA_COPY_TO_CLIENT_BUFFER)(PLSA_CLIENT_REQUEST, ULONG,
187 PVOID, PVOID);
188 typedef NTSTATUS (NTAPI *PLSA_COPY_FROM_CLIENT_BUFFER)(PLSA_CLIENT_REQUEST,
189 ULONG, PVOID, PVOID);
190 typedef NTSTATUS (NTAPI *PLSA_IMPERSONATE_CLIENT)(void);
191 typedef NTSTATUS (NTAPI *PLSA_UNLOAD_PACKAGE)(void);
192 typedef NTSTATUS (NTAPI *PLSA_DUPLICATE_HANDLE)(HANDLE, PHANDLE);
193 typedef NTSTATUS (NTAPI *PLSA_SAVE_SUPPLEMENTAL_CREDENTIALS)(PLUID, ULONG,
194 PVOID, BOOLEAN);
195 typedef HANDLE (NTAPI *PLSA_CREATE_THREAD)(SEC_ATTRS, ULONG, SEC_THREAD_START,
196 PVOID, ULONG, PULONG);
197 typedef NTSTATUS (NTAPI *PLSA_GET_CLIENT_INFO)(PSECPKG_CLIENT_INFO);
198 typedef HANDLE (NTAPI *PLSA_REGISTER_NOTIFICATION)(SEC_THREAD_START, PVOID,
199 ULONG, ULONG, ULONG, ULONG, HANDLE);
200 typedef NTSTATUS (NTAPI *PLSA_CANCEL_NOTIFICATION)(HANDLE);
201 typedef NTSTATUS (NTAPI *PLSA_MAP_BUFFER)(PSecBuffer, PSecBuffer);
202 typedef NTSTATUS (NTAPI *PLSA_CREATE_TOKEN)(PLUID, PTOKEN_SOURCE,
203 SECURITY_LOGON_TYPE, SECURITY_IMPERSONATION_LEVEL, LSA_TOKEN_INFORMATION_TYPE,
204 PVOID, PTOKEN_GROUPS, PUNICODE_STRING, PUNICODE_STRING, PUNICODE_STRING,
205 PUNICODE_STRING, PHANDLE, PNTSTATUS);
206 typedef VOID (NTAPI *PLSA_AUDIT_LOGON)(NTSTATUS, NTSTATUS, PUNICODE_STRING,
207 PUNICODE_STRING, PUNICODE_STRING, OPTIONAL PSID, SECURITY_LOGON_TYPE,
208 PTOKEN_SOURCE, PLUID);
209 typedef NTSTATUS (NTAPI *PLSA_CALL_PACKAGE)(PUNICODE_STRING, PVOID, ULONG,
210 PVOID*, PULONG, PNTSTATUS);
211 typedef BOOLEAN (NTAPI *PLSA_GET_CALL_INFO)(PSECPKG_CALL_INFO);
212 typedef NTSTATUS (NTAPI *PLSA_CALL_PACKAGEEX)(PUNICODE_STRING, PVOID, PVOID,
213 ULONG, PVOID*, PULONG, PNTSTATUS);
214 typedef PVOID (NTAPI *PLSA_CREATE_SHARED_MEMORY)(ULONG, ULONG);
215 typedef PVOID (NTAPI *PLSA_ALLOCATE_SHARED_MEMORY)(PVOID, ULONG);
216 typedef VOID (NTAPI *PLSA_FREE_SHARED_MEMORY)(PVOID, PVOID);
217 typedef BOOLEAN (NTAPI *PLSA_DELETE_SHARED_MEMORY)(PVOID);
218 typedef NTSTATUS (NTAPI *PLSA_OPEN_SAM_USER)(PUNICODE_STRING, SECPKG_NAME_TYPE,
219 PUNICODE_STRING, BOOLEAN, ULONG, PVOID*);
220 typedef NTSTATUS (NTAPI *PLSA_GET_USER_CREDENTIALS)(PVOID, PVOID *, PULONG,
221 PVOID *, PULONG);
222 typedef NTSTATUS (NTAPI *PLSA_GET_USER_AUTH_DATA)(PVOID, PUCHAR *, PULONG);
223 typedef NTSTATUS (NTAPI *PLSA_CLOSE_SAM_USER)(PVOID);
224 typedef NTSTATUS (NTAPI *PLSA_CONVERT_AUTH_DATA_TO_TOKEN)(PVOID, ULONG,
225 SECURITY_IMPERSONATION_LEVEL, PTOKEN_SOURCE, SECURITY_LOGON_TYPE,
226 PUNICODE_STRING, PHANDLE, PLUID, PUNICODE_STRING, PNTSTATUS);
227 typedef NTSTATUS (NTAPI *PLSA_CLIENT_CALLBACK)(PCHAR, ULONG_PTR, ULONG_PTR,
228 PSecBuffer, PSecBuffer);
229 typedef NTSTATUS (NTAPI *PLSA_UPDATE_PRIMARY_CREDENTIALS)(PSECPKG_PRIMARY_CRED, PSECPKG_SUPPLEMENTAL_CRED_ARRAY);
230 typedef NTSTATUS (NTAPI *PLSA_GET_AUTH_DATA_FOR_USER)(PUNICODE_STRING,
231 SECPKG_NAME_TYPE, PUNICODE_STRING, PUCHAR *, PULONG, PUNICODE_STRING);
232 typedef NTSTATUS (NTAPI *PLSA_CRACK_SINGLE_NAME)(ULONG, BOOLEAN,
233 PUNICODE_STRING, PUNICODE_STRING, ULONG, PUNICODE_STRING, PUNICODE_STRING,
234 PULONG);
235 typedef NTSTATUS (NTAPI *PLSA_AUDIT_ACCOUNT_LOGON)(ULONG, BOOLEAN,
236 PUNICODE_STRING, PUNICODE_STRING, PUNICODE_STRING, NTSTATUS);
237 typedef NTSTATUS (NTAPI *PLSA_CALL_PACKAGE_PASSTHROUGH)(PUNICODE_STRING, PVOID,
238 PVOID, ULONG, PVOID*, PULONG, PNTSTATUS);
240 /* Dispatch tables of functions used by SSP/AP */
241 typedef struct SECPKG_DLL_FUNCTIONS {
242 PLSA_ALLOCATE_LSA_HEAP AllocateHeap;
243 PLSA_FREE_LSA_HEAP FreeHeap;
244 PLSA_REGISTER_CALLBACK RegisterCallback;
245 } SECPKG_DLL_FUNCTIONS,
246 *PSECPKG_DLL_FUNCTIONS;
248 typedef struct LSA_DISPATCH_TABLE {
249 PLSA_CREATE_LOGON_SESSION CreateLogonSession;
250 PLSA_DELETE_LOGON_SESSION DeleteLogonSession;
251 PLSA_ADD_CREDENTIAL AddCredential;
252 PLSA_GET_CREDENTIALS GetCredentials;
253 PLSA_DELETE_CREDENTIAL DeleteCredential;
254 PLSA_ALLOCATE_LSA_HEAP AllocateLsaHeap;
255 PLSA_FREE_LSA_HEAP FreeLsaHeap;
256 PLSA_ALLOCATE_CLIENT_BUFFER AllocateClientBuffer;
257 PLSA_FREE_CLIENT_BUFFER FreeClientBuffer;
258 PLSA_COPY_TO_CLIENT_BUFFER CopyToClientBuffer;
259 PLSA_COPY_FROM_CLIENT_BUFFER CopyFromClientBuffer;
260 } LSA_DISPATCH_TABLE,
261 *PLSA_DISPATCH_TABLE;
263 typedef struct _LSA_SECPKG_FUNCTION_TABLE {
264 PLSA_CREATE_LOGON_SESSION CreateLogonSession;
265 PLSA_DELETE_LOGON_SESSION DeleteLogonSession;
266 PLSA_ADD_CREDENTIAL AddCredential;
267 PLSA_GET_CREDENTIALS GetCredentials;
268 PLSA_DELETE_CREDENTIAL DeleteCredential;
269 PLSA_ALLOCATE_LSA_HEAP AllocateLsaHeap;
270 PLSA_FREE_LSA_HEAP FreeLsaHeap;
271 PLSA_ALLOCATE_CLIENT_BUFFER AllocateClientBuffer;
272 PLSA_FREE_CLIENT_BUFFER FreeClientBuffer;
273 PLSA_COPY_TO_CLIENT_BUFFER CopyToClientBuffer;
274 PLSA_COPY_FROM_CLIENT_BUFFER CopyFromClientBuffer;
275 PLSA_IMPERSONATE_CLIENT ImpersonateClient;
276 PLSA_UNLOAD_PACKAGE UnloadPackage;
277 PLSA_DUPLICATE_HANDLE DuplicateHandle;
278 PLSA_SAVE_SUPPLEMENTAL_CREDENTIALS SaveSupplementalCredentials;
279 PLSA_CREATE_THREAD CreateThread;
280 PLSA_GET_CLIENT_INFO GetClientInfo;
281 PLSA_REGISTER_NOTIFICATION RegisterNotification;
282 PLSA_CANCEL_NOTIFICATION CancelNotification;
283 PLSA_MAP_BUFFER MapBuffer;
284 PLSA_CREATE_TOKEN CreateToken;
285 PLSA_AUDIT_LOGON AuditLogon;
286 PLSA_CALL_PACKAGE CallPackage;
287 PLSA_FREE_LSA_HEAP FreeReturnBuffer;
288 PLSA_GET_CALL_INFO GetCallInfo;
289 PLSA_CALL_PACKAGEEX CallPackageEx;
290 PLSA_CREATE_SHARED_MEMORY CreateSharedMemory;
291 PLSA_ALLOCATE_SHARED_MEMORY AllocateSharedMemory;
292 PLSA_FREE_SHARED_MEMORY FreeSharedMemory;
293 PLSA_DELETE_SHARED_MEMORY DeleteSharedMemory;
294 PLSA_OPEN_SAM_USER OpenSamUser;
295 PLSA_GET_USER_CREDENTIALS GetUserCredentials;
296 PLSA_GET_USER_AUTH_DATA GetUserAuthData;
297 PLSA_CLOSE_SAM_USER CloseSamUser;
298 PLSA_CONVERT_AUTH_DATA_TO_TOKEN ConvertAuthDataToToken;
299 PLSA_CLIENT_CALLBACK ClientCallback;
300 PLSA_UPDATE_PRIMARY_CREDENTIALS UpdateCredentials;
301 PLSA_GET_AUTH_DATA_FOR_USER GetAuthDataForUser;
302 PLSA_CRACK_SINGLE_NAME CrackSingleName;
303 PLSA_AUDIT_ACCOUNT_LOGON AuditAccountLogon;
304 PLSA_CALL_PACKAGE_PASSTHROUGH CallPackagePassthrough;
305 } LSA_SECPKG_FUNCTION_TABLE,
306 *PLSA_SECPKG_FUNCTION_TABLE;
308 /* LSA-mode functions implemented by SSP/AP obtainable by a dispatch table */
309 typedef NTSTATUS (NTAPI *PLSA_AP_INITIALIZE_PACKAGE)(ULONG, PLSA_DISPATCH_TABLE,
310 PLSA_STRING, PLSA_STRING, PLSA_STRING *);
311 typedef NTSTATUS (NTAPI *PLSA_AP_LOGON_USER)(PLSA_CLIENT_REQUEST, SECURITY_LOGON_TYPE,
312 PVOID, PVOID, ULONG, PVOID *, PULONG, PLUID LogonId, PNTSTATUS, PLSA_TOKEN_INFORMATION_TYPE,
313 PVOID *, PLSA_UNICODE_STRING *, PLSA_UNICODE_STRING *);
314 typedef NTSTATUS (NTAPI *PLSA_AP_CALL_PACKAGE)(PLSA_CLIENT_REQUEST, PVOID, PVOID, ULONG,
315 PVOID *, PULONG, PNTSTATUS);
316 typedef VOID (NTAPI *PLSA_AP_LOGON_TERMINATED)(PLUID);
317 typedef NTSTATUS (NTAPI *PLSA_AP_CALL_PACKAGE_UNTRUSTED)(PLSA_CLIENT_REQUEST,
318 PVOID, PVOID, ULONG, PVOID *, PULONG, PNTSTATUS);
319 typedef NTSTATUS (NTAPI *PLSA_AP_CALL_PACKAGE_PASSTHROUGH)(PLSA_CLIENT_REQUEST,
320 PVOID, PVOID, ULONG, PVOID *, PULONG, PNTSTATUS);
321 typedef NTSTATUS (NTAPI *PLSA_AP_LOGON_USER_EX)(PLSA_CLIENT_REQUEST,
322 SECURITY_LOGON_TYPE, PVOID, PVOID, ULONG, PVOID *, PULONG, PLUID, PNTSTATUS,
323 PLSA_TOKEN_INFORMATION_TYPE, PVOID *, PUNICODE_STRING *, PUNICODE_STRING *,
324 PUNICODE_STRING *);
325 typedef NTSTATUS (NTAPI *PLSA_AP_LOGON_USER_EX2)(PLSA_CLIENT_REQUEST,
326 SECURITY_LOGON_TYPE, PVOID, PVOID, ULONG, PVOID *, PULONG, PLUID, PNTSTATUS,
327 PLSA_TOKEN_INFORMATION_TYPE, PVOID *, PUNICODE_STRING *, PUNICODE_STRING *,
328 PUNICODE_STRING *, PSECPKG_PRIMARY_CRED, PSECPKG_SUPPLEMENTAL_CRED_ARRAY *);
329 typedef NTSTATUS (NTAPI SpInitializeFn)(ULONG_PTR, PSECPKG_PARAMETERS,
330 PLSA_SECPKG_FUNCTION_TABLE);
331 typedef NTSTATUS (NTAPI SpShutdownFn)(void);
332 typedef NTSTATUS (NTAPI SpGetInfoFn)(PSecPkgInfoW);
333 typedef NTSTATUS (NTAPI SpAcceptCredentialsFn)(SECURITY_LOGON_TYPE,
334 PUNICODE_STRING, PSECPKG_PRIMARY_CRED, PSECPKG_SUPPLEMENTAL_CRED);
335 typedef NTSTATUS (NTAPI SpAcquireCredentialsHandleFn)(PUNICODE_STRING, ULONG,
336 PLUID, PVOID, PVOID, PVOID, PLSA_SEC_HANDLE, PTimeStamp);
337 typedef NTSTATUS (NTAPI SpQueryCredentialsAttributesFn)(LSA_SEC_HANDLE, ULONG,
338 PVOID);
339 typedef NTSTATUS (NTAPI SpFreeCredentialsHandleFn)(LSA_SEC_HANDLE);
340 typedef NTSTATUS (NTAPI SpSaveCredentialsFn)(LSA_SEC_HANDLE, PSecBuffer);
341 typedef NTSTATUS (NTAPI SpGetCredentialsFn)(LSA_SEC_HANDLE, PSecBuffer);
342 typedef NTSTATUS (NTAPI SpDeleteCredentialsFn)(LSA_SEC_HANDLE, PSecBuffer);
343 typedef NTSTATUS (NTAPI SpInitLsaModeContextFn)(LSA_SEC_HANDLE, LSA_SEC_HANDLE,
344 PUNICODE_STRING, ULONG, ULONG, PSecBufferDesc, PLSA_SEC_HANDLE, PSecBufferDesc,
345 PULONG, PTimeStamp, PBOOLEAN, PSecBuffer);
346 typedef NTSTATUS (NTAPI SpAcceptLsaModeContextFn)(LSA_SEC_HANDLE,
347 LSA_SEC_HANDLE, PSecBufferDesc, ULONG, ULONG, PLSA_SEC_HANDLE, PSecBufferDesc,
348 PULONG, PTimeStamp, PBOOLEAN, PSecBuffer);
349 typedef NTSTATUS (NTAPI SpDeleteContextFn)(LSA_SEC_HANDLE);
350 typedef NTSTATUS (NTAPI SpApplyControlTokenFn)(LSA_SEC_HANDLE, PSecBufferDesc);
351 typedef NTSTATUS (NTAPI SpGetUserInfoFn)(PLUID, ULONG, PSecurityUserData *);
352 typedef NTSTATUS (NTAPI SpGetExtendedInformationFn)(
353 SECPKG_EXTENDED_INFORMATION_CLASS, PSECPKG_EXTENDED_INFORMATION *);
354 typedef NTSTATUS (NTAPI SpQueryContextAttributesFn)(LSA_SEC_HANDLE, ULONG,
355 PVOID);
356 typedef NTSTATUS (NTAPI SpAddCredentialsFn)(LSA_SEC_HANDLE, PUNICODE_STRING,
357 PUNICODE_STRING, ULONG, PVOID, PVOID, PVOID, PTimeStamp);
358 typedef NTSTATUS (NTAPI SpSetExtendedInformationFn)(
359 SECPKG_EXTENDED_INFORMATION_CLASS, PSECPKG_EXTENDED_INFORMATION);
360 typedef NTSTATUS (NTAPI SpSetContextAttributesFn)(LSA_SEC_HANDLE, ULONG, PVOID,
361 ULONG);
362 typedef NTSTATUS (NTAPI SpSetCredentialsAttributesFn)(LSA_SEC_HANDLE, ULONG,
363 PVOID, ULONG);
364 typedef NTSTATUS (NTAPI SpChangeAccountPasswordFn)(PUNICODE_STRING,
365 PUNICODE_STRING, PUNICODE_STRING, PUNICODE_STRING, BOOLEAN, PSecBufferDesc);
366 typedef NTSTATUS (NTAPI SpQueryMetaDataFn)(LSA_SEC_HANDLE, PUNICODE_STRING,
367 ULONG, PULONG, PUCHAR *, PLSA_SEC_HANDLE);
368 typedef NTSTATUS (NTAPI SpExchangeMetaDataFn)(LSA_SEC_HANDLE, PUNICODE_STRING,
369 ULONG, ULONG, PUCHAR, PLSA_SEC_HANDLE);
370 typedef NTSTATUS (NTAPI SpGetCredUIContextFn)(LSA_SEC_HANDLE, GUID *, PULONG,
371 PUCHAR *);
372 typedef NTSTATUS (NTAPI SpUpdateCredentialsFn)(LSA_SEC_HANDLE, GUID *, ULONG,
373 PUCHAR);
374 typedef NTSTATUS (NTAPI SpValidateTargetInfoFn)(PLSA_CLIENT_REQUEST, PVOID,
375 PVOID, ULONG, PSECPKG_TARGETINFO);
376 typedef NTSTATUS (NTAPI LSA_AP_POST_LOGON_USER)(PSECPKG_POST_LOGON_USER_INFO);
378 /* User-mode functions implemented by SSP/AP obtainable by a dispatch table */
379 typedef NTSTATUS (NTAPI SpInstanceInitFn)(ULONG, PSECPKG_DLL_FUNCTIONS,
380 PVOID *);
381 typedef NTSTATUS (NTAPI SpInitUserModeContextFn)(LSA_SEC_HANDLE, PSecBuffer);
382 typedef NTSTATUS (NTAPI SpMakeSignatureFn)(LSA_SEC_HANDLE, ULONG,
383 PSecBufferDesc, ULONG);
384 typedef NTSTATUS (NTAPI SpVerifySignatureFn)(LSA_SEC_HANDLE, PSecBufferDesc,
385 ULONG, PULONG);
386 typedef NTSTATUS (NTAPI SpSealMessageFn)(LSA_SEC_HANDLE, ULONG, PSecBufferDesc,
387 ULONG);
388 typedef NTSTATUS (NTAPI SpUnsealMessageFn)(LSA_SEC_HANDLE, PSecBufferDesc,
389 ULONG, PULONG);
390 typedef NTSTATUS (NTAPI SpGetContextTokenFn)(LSA_SEC_HANDLE, PHANDLE);
391 typedef NTSTATUS (NTAPI SpCompleteAuthTokenFn)(LSA_SEC_HANDLE, PSecBufferDesc);
392 typedef NTSTATUS (NTAPI SpFormatCredentialsFn)(PSecBuffer, PSecBuffer);
393 typedef NTSTATUS (NTAPI SpMarshallSupplementalCredsFn)(ULONG, PUCHAR, PULONG,
394 PVOID *);
395 typedef NTSTATUS (NTAPI SpExportSecurityContextFn)(LSA_SEC_HANDLE, ULONG,
396 PSecBuffer, PHANDLE);
397 typedef NTSTATUS (NTAPI SpImportSecurityContextFn)(PSecBuffer, HANDLE,
398 PLSA_SEC_HANDLE);
400 #ifdef WINE_NO_UNICODE_MACROS
401 #undef SetContextAttributes
402 #endif
404 /* dispatch tables of LSA-mode functions implemented by SSP/AP */
405 typedef struct SECPKG_FUNCTION_TABLE {
406 PLSA_AP_INITIALIZE_PACKAGE InitializePackage;
407 PLSA_AP_LOGON_USER LsaLogonUser;
408 PLSA_AP_CALL_PACKAGE CallPackage;
409 PLSA_AP_LOGON_TERMINATED LogonTerminated;
410 PLSA_AP_CALL_PACKAGE_UNTRUSTED CallPackageUntrusted;
411 PLSA_AP_CALL_PACKAGE_PASSTHROUGH CallPackagePassthrough;
412 PLSA_AP_LOGON_USER_EX LogonUserEx;
413 PLSA_AP_LOGON_USER_EX2 LogonUserEx2;
414 SpInitializeFn *Initialize;
415 SpShutdownFn *Shutdown;
416 SpGetInfoFn *GetInfo;
417 SpAcceptCredentialsFn *AcceptCredentials;
418 SpAcquireCredentialsHandleFn *SpAcquireCredentialsHandle;
419 SpQueryCredentialsAttributesFn *SpQueryCredentialsAttributes;
420 SpFreeCredentialsHandleFn *FreeCredentialsHandle;
421 SpSaveCredentialsFn *SaveCredentials;
422 SpGetCredentialsFn *GetCredentials;
423 SpDeleteCredentialsFn *DeleteCredentials;
424 SpInitLsaModeContextFn *InitLsaModeContext;
425 SpAcceptLsaModeContextFn *AcceptLsaModeContext;
426 SpDeleteContextFn *DeleteContext;
427 SpApplyControlTokenFn *ApplyControlToken;
428 SpGetUserInfoFn *GetUserInfo;
429 SpGetExtendedInformationFn *GetExtendedInformation;
430 SpQueryContextAttributesFn *SpQueryContextAttributes;
431 SpAddCredentialsFn *SpAddCredentials;
432 SpSetExtendedInformationFn *SetExtendedInformation;
433 /* Packages with version SECPKG_INTERFACE_VERSION end here */
434 SpSetContextAttributesFn *SetContextAttributes;
435 /* Packages with version SECPKG_INTERFACE_VERSION_2 end here */
436 SpSetCredentialsAttributesFn *SetCredentialsAttributes;
437 /* Packages with version SECPKG_INTERFACE_VERSION_3 end here */
438 SpChangeAccountPasswordFn *ChangeAccountPassword;
439 /* Packages with version SECPKG_INTERFACE_VERSION_4 end here */
440 SpQueryMetaDataFn *QueryMetaData;
441 SpExchangeMetaDataFn *ExchangeMetaData;
442 SpGetCredUIContextFn *GetCredUIContext;
443 SpUpdateCredentialsFn *UpdateCredentials;
444 /* Packages with version SECPKG_INTERFACE_VERSION_5 end here */
445 SpValidateTargetInfoFn *ValidateTargetInfo;
446 /* Packages with version SECPKG_INTERFACE_VERSION_6 end here */
447 LSA_AP_POST_LOGON_USER* PostLogonUser;
448 /* Packages with version SECPKG_INTERFACE_VERSION_7 end here */
449 } SECPKG_FUNCTION_TABLE,
450 *PSECPKG_FUNCTION_TABLE;
452 /* dispatch tables of user-mode functions implemented by SSP/AP */
453 typedef struct SECPKG_USER_FUNCTION_TABLE {
454 SpInstanceInitFn *InstanceInit;
455 SpInitUserModeContextFn *InitUserModeContext;
456 SpMakeSignatureFn *MakeSignature;
457 SpVerifySignatureFn *VerifySignature;
458 SpSealMessageFn *SealMessage;
459 SpUnsealMessageFn *UnsealMessage;
460 SpGetContextTokenFn *GetContextToken;
461 SpQueryContextAttributesFn *SpQueryContextAttributes;
462 SpCompleteAuthTokenFn *CompleteAuthToken;
463 SpDeleteContextFn *DeleteUserModeContext;
464 SpFormatCredentialsFn *FormatCredentials;
465 SpMarshallSupplementalCredsFn *MarshallSupplementalCreds;
466 SpExportSecurityContextFn *ExportContext;
467 SpImportSecurityContextFn *ImportContext;
468 } SECPKG_USER_FUNCTION_TABLE,
469 *PSECPKG_USER_FUNCTION_TABLE;
471 /* LSA-mode entry point to SSP/APs */
472 typedef NTSTATUS (NTAPI *SpLsaModeInitializeFn)(ULONG, PULONG,
473 PSECPKG_FUNCTION_TABLE *, PULONG);
475 /* User-mode entry point to SSP/APs */
476 typedef NTSTATUS (WINAPI *SpUserModeInitializeFn)(ULONG, PULONG,
477 PSECPKG_USER_FUNCTION_TABLE *, PULONG);
479 #ifdef __cplusplus
481 #endif
482 #endif /* _NTSECPKG_H */