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
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
,
46 } LSA_TOKEN_INFORMATION_TYPE
, *PLSA_TOKEN_INFORMATION_TYPE
;
48 typedef enum _SECPKG_EXTENDED_INFORMATION_CLASS
52 SecpkgMutualAuthLevel
,
54 } SECPKG_EXTENDED_INFORMATION_CLASS
;
56 typedef enum _SECPKG_NAME_TYPE
{
63 /* struct definitions for SSP/AP */
64 typedef struct _SECPKG_PRIMARY_CRED
{
66 UNICODE_STRING DownlevelName
;
67 UNICODE_STRING DomainName
;
68 UNICODE_STRING Password
;
69 UNICODE_STRING OldPassword
;
72 UNICODE_STRING DnsDomainName
;
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
;
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
{
97 UNICODE_STRING DomainName
;
98 UNICODE_STRING DnsDomainName
;
100 } SECPKG_PARAMETERS
, *PSECPKG_PARAMETERS
,
101 SECPKG_EVENT_DOMAIN_CHANGE
, *PSECPKG_EVENT_DOMAIN_CHANGE
;
103 typedef struct _SECPKG_CLIENT_INFO
{
107 BOOLEAN HasTcbPrivilege
;
108 BOOLEAN Impersonating
;
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
;
118 } SECURITY_USER_DATA
, *PSECURITY_USER_DATA
,
119 SecurityUserData
, *PSecurityUserData
;
121 typedef struct _SECPKG_GSS_INFO
{
122 ULONG EncodedIdLength
;
124 } SECPKG_GSS_INFO
, *PSECPKG_GSS_INFO
;
126 typedef struct _SECPKG_CONTEXT_THUNKS
{
127 ULONG InfoLevelCount
;
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
{
140 } SECPKG_CALL_INFO
, *PSECPKG_CALL_INFO
;
142 typedef struct _SECPKG_EXTENDED_INFORMATION
{
143 SECPKG_EXTENDED_INFORMATION_CLASS Class
;
145 SECPKG_GSS_INFO GssInfo
;
146 SECPKG_CONTEXT_THUNKS ContextThunks
;
147 SECPKG_MUTUAL_AUTH_LEVEL MutualAuthLevel
;
149 } SECPKG_EXTENDED_INFORMATION
, *PSECPKG_EXTENDED_INFORMATION
;
151 typedef struct _SECPKG_TARGETINFO
{
154 } SECPKG_TARGETINFO
, *PSECPKG_TARGETINFO
;
156 typedef struct _SECPKG_POST_LOGON_USER_INFO
{
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
,
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
,
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
,
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
,
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
,
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
,
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
,
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
)(LPWSTR
, LPWSTR
, LPWSTR
, LPWSTR
,
312 DWORD
, DWORD
, PHANDLE
);
313 typedef NTSTATUS (NTAPI
*PLSA_AP_CALL_PACKAGE
)(PUNICODE_STRING
, PVOID
, ULONG
,
314 PVOID
*, PULONG
, PNTSTATUS
);
315 typedef VOID (NTAPI
*PLSA_AP_LOGON_TERMINATED
)(PLUID
);
316 typedef NTSTATUS (NTAPI
*PLSA_AP_CALL_PACKAGE_UNTRUSTED
)(PLSA_CLIENT_REQUEST
,
317 PVOID
, PVOID
, ULONG
, PVOID
*, PULONG
, PNTSTATUS
);
318 typedef NTSTATUS (NTAPI
*PLSA_AP_CALL_PACKAGE_PASSTHROUGH
)(PUNICODE_STRING
,
319 PVOID
, PVOID
, ULONG
, PVOID
*, PULONG
, PNTSTATUS
);
320 typedef NTSTATUS (NTAPI
*PLSA_AP_LOGON_USER_EX
)(PLSA_CLIENT_REQUEST
,
321 SECURITY_LOGON_TYPE
, PVOID
, PVOID
, ULONG
, PVOID
*, PULONG
, PLUID
, PNTSTATUS
,
322 PLSA_TOKEN_INFORMATION_TYPE
, PVOID
*, PUNICODE_STRING
*, PUNICODE_STRING
*,
324 typedef NTSTATUS (NTAPI
*PLSA_AP_LOGON_USER_EX2
)(PLSA_CLIENT_REQUEST
,
325 SECURITY_LOGON_TYPE
, PVOID
, PVOID
, ULONG
, PVOID
*, PULONG
, PLUID
, PNTSTATUS
,
326 PLSA_TOKEN_INFORMATION_TYPE
, PVOID
*, PUNICODE_STRING
*, PUNICODE_STRING
*,
327 PUNICODE_STRING
*, PSECPKG_PRIMARY_CRED
, PSECPKG_SUPPLEMENTAL_CRED_ARRAY
*);
328 typedef NTSTATUS (NTAPI SpInitializeFn
)(ULONG_PTR
, PSECPKG_PARAMETERS
,
329 PLSA_SECPKG_FUNCTION_TABLE
);
330 typedef NTSTATUS (NTAPI SpShutDownFn
)(void);
331 typedef NTSTATUS (NTAPI SpGetInfoFn
)(PSecPkgInfoW
);
332 typedef NTSTATUS (NTAPI SpAcceptCredentialsFn
)(SECURITY_LOGON_TYPE
,
333 PUNICODE_STRING
, PSECPKG_PRIMARY_CRED
, PSECPKG_SUPPLEMENTAL_CRED
);
334 typedef NTSTATUS (NTAPI SpAcquireCredentialsHandleFn
)(PUNICODE_STRING
, ULONG
,
335 PLUID
, PVOID
, PVOID
, PVOID
, PLSA_SEC_HANDLE
, PTimeStamp
);
336 typedef NTSTATUS (NTAPI SpQueryCredentialsAttributesFn
)(LSA_SEC_HANDLE
, ULONG
,
338 typedef NTSTATUS (NTAPI SpFreeCredentialsHandleFn
)(LSA_SEC_HANDLE
);
339 typedef NTSTATUS (NTAPI SpSaveCredentialsFn
)(LSA_SEC_HANDLE
, PSecBuffer
);
340 typedef NTSTATUS (NTAPI SpGetCredentialsFn
)(LSA_SEC_HANDLE
, PSecBuffer
);
341 typedef NTSTATUS (NTAPI SpDeleteCredentialsFn
)(LSA_SEC_HANDLE
, PSecBuffer
);
342 typedef NTSTATUS (NTAPI SpInitLsaModeContextFn
)(LSA_SEC_HANDLE
, LSA_SEC_HANDLE
,
343 PUNICODE_STRING
, ULONG
, ULONG
, PSecBufferDesc
, PLSA_SEC_HANDLE
, PSecBufferDesc
,
344 PULONG
, PTimeStamp
, PBOOLEAN
, PSecBuffer
);
345 typedef NTSTATUS (NTAPI SpAcceptLsaModeContextFn
)(LSA_SEC_HANDLE
,
346 LSA_SEC_HANDLE
, PSecBufferDesc
, ULONG
, ULONG
, PLSA_SEC_HANDLE
, PSecBufferDesc
,
347 PULONG
, PTimeStamp
, PBOOLEAN
, PSecBuffer
);
348 typedef NTSTATUS (NTAPI SpDeleteContextFn
)(LSA_SEC_HANDLE
);
349 typedef NTSTATUS (NTAPI SpApplyControlTokenFn
)(LSA_SEC_HANDLE
, PSecBufferDesc
);
350 typedef NTSTATUS (NTAPI SpGetUserInfoFn
)(PLUID
, ULONG
, PSecurityUserData
*);
351 typedef NTSTATUS (NTAPI SpGetExtendedInformationFn
)(
352 SECPKG_EXTENDED_INFORMATION_CLASS
, PSECPKG_EXTENDED_INFORMATION
*);
353 typedef NTSTATUS (NTAPI SpQueryContextAttributesFn
)(LSA_SEC_HANDLE
, ULONG
,
355 typedef NTSTATUS (NTAPI SpAddCredentialsFn
)(LSA_SEC_HANDLE
, PUNICODE_STRING
,
356 PUNICODE_STRING
, ULONG
, PVOID
, PVOID
, PVOID
, PTimeStamp
);
357 typedef NTSTATUS (NTAPI SpSetExtendedInformationFn
)(
358 SECPKG_EXTENDED_INFORMATION_CLASS
, PSECPKG_EXTENDED_INFORMATION
);
359 typedef NTSTATUS (NTAPI SpSetContextAttributesFn
)(LSA_SEC_HANDLE
, ULONG
, PVOID
,
361 typedef NTSTATUS (NTAPI SpSetCredentialsAttributesFn
)(LSA_SEC_HANDLE
, ULONG
,
363 typedef NTSTATUS (NTAPI SpChangeAccountPasswordFn
)(PUNICODE_STRING
,
364 PUNICODE_STRING
, PUNICODE_STRING
, PUNICODE_STRING
, BOOLEAN
, PSecBufferDesc
);
365 typedef NTSTATUS (NTAPI SpQueryMetaDataFn
)(LSA_SEC_HANDLE
, PUNICODE_STRING
,
366 ULONG
, PULONG
, PUCHAR
*, PLSA_SEC_HANDLE
);
367 typedef NTSTATUS (NTAPI SpExchangeMetaDataFn
)(LSA_SEC_HANDLE
, PUNICODE_STRING
,
368 ULONG
, ULONG
, PUCHAR
, PLSA_SEC_HANDLE
);
369 typedef NTSTATUS (NTAPI SpGetCredUIContextFn
)(LSA_SEC_HANDLE
, GUID
*, PULONG
,
371 typedef NTSTATUS (NTAPI SpUpdateCredentialsFn
)(LSA_SEC_HANDLE
, GUID
*, ULONG
,
373 typedef NTSTATUS (NTAPI SpValidateTargetInfoFn
)(PLSA_CLIENT_REQUEST
, PVOID
,
374 PVOID
, ULONG
, PSECPKG_TARGETINFO
);
375 typedef NTSTATUS (NTAPI LSA_AP_POST_LOGON_USER
)(PSECPKG_POST_LOGON_USER_INFO
);
377 /* User-mode functions implemented by SSP/AP obtainable by a dispatch table */
378 typedef NTSTATUS (NTAPI SpInstanceInitFn
)(ULONG
, PSECPKG_DLL_FUNCTIONS
,
380 typedef NTSTATUS (NTAPI SpInitUserModeContextFn
)(LSA_SEC_HANDLE
, PSecBuffer
);
381 typedef NTSTATUS (NTAPI SpMakeSignatureFn
)(LSA_SEC_HANDLE
, ULONG
,
382 PSecBufferDesc
, ULONG
);
383 typedef NTSTATUS (NTAPI SpVerifySignatureFn
)(LSA_SEC_HANDLE
, PSecBufferDesc
,
385 typedef NTSTATUS (NTAPI SpSealMessageFn
)(LSA_SEC_HANDLE
, ULONG
, PSecBufferDesc
,
387 typedef NTSTATUS (NTAPI SpUnsealMessageFn
)(LSA_SEC_HANDLE
, PSecBufferDesc
,
389 typedef NTSTATUS (NTAPI SpGetContextTokenFn
)(LSA_SEC_HANDLE
, PHANDLE
);
390 typedef NTSTATUS (NTAPI SpCompleteAuthTokenFn
)(LSA_SEC_HANDLE
, PSecBufferDesc
);
391 typedef NTSTATUS (NTAPI SpFormatCredentialsFn
)(PSecBuffer
, PSecBuffer
);
392 typedef NTSTATUS (NTAPI SpMarshallSupplementalCredsFn
)(ULONG
, PUCHAR
, PULONG
,
394 typedef NTSTATUS (NTAPI SpExportSecurityContextFn
)(LSA_SEC_HANDLE
, ULONG
,
395 PSecBuffer
, PHANDLE
);
396 typedef NTSTATUS (NTAPI SpImportSecurityContextFn
)(PSecBuffer
, HANDLE
,
399 #ifdef WINE_NO_UNICODE_MACROS
400 #undef SetContextAttributes
403 /* dispatch tables of LSA-mode functions implemented by SSP/AP */
404 typedef struct SECPKG_FUNCTION_TABLE
{
405 PLSA_AP_INITIALIZE_PACKAGE InitializePackage
;
406 PLSA_AP_LOGON_USER LsaLogonUser
;
407 PLSA_AP_CALL_PACKAGE CallPackage
;
408 PLSA_AP_LOGON_TERMINATED LogonTerminated
;
409 PLSA_AP_CALL_PACKAGE_UNTRUSTED CallPackageUntrusted
;
410 PLSA_AP_CALL_PACKAGE_PASSTHROUGH CallPackagePassthrough
;
411 PLSA_AP_LOGON_USER_EX LogonUserEx
;
412 PLSA_AP_LOGON_USER_EX2 LogonUserEx2
;
413 SpInitializeFn
*Initialize
;
414 SpShutDownFn
*Shutdown
;
415 SpGetInfoFn
*GetInfo
;
416 SpAcceptCredentialsFn
*AcceptCredentials
;
417 SpAcquireCredentialsHandleFn
*SpAcquireCredentialsHandle
;
418 SpQueryCredentialsAttributesFn
*SpQueryCredentialsAttributes
;
419 SpFreeCredentialsHandleFn
*FreeCredentialsHandle
;
420 SpSaveCredentialsFn
*SaveCredentials
;
421 SpGetCredentialsFn
*GetCredentials
;
422 SpDeleteCredentialsFn
*DeleteCredentials
;
423 SpInitLsaModeContextFn
*InitLsaModeContext
;
424 SpAcceptLsaModeContextFn
*AcceptLsaModeContext
;
425 SpDeleteContextFn
*DeleteContext
;
426 SpApplyControlTokenFn
*ApplyControlToken
;
427 SpGetUserInfoFn
*GetUserInfo
;
428 SpGetExtendedInformationFn
*GetExtendedInformation
;
429 SpQueryContextAttributesFn
*SpQueryContextAttributes
;
430 SpAddCredentialsFn
*SpAddCredentials
;
431 SpSetExtendedInformationFn
*SetExtendedInformation
;
432 /* Packages with version SECPKG_INTERFACE_VERSION end here */
433 SpSetContextAttributesFn
*SetContextAttributes
;
434 /* Packages with version SECPKG_INTERFACE_VERSION_2 end here */
435 SpSetCredentialsAttributesFn
*SetCredentialsAttributes
;
436 /* Packages with version SECPKG_INTERFACE_VERSION_3 end here */
437 SpChangeAccountPasswordFn
*ChangeAccountPassword
;
438 /* Packages with version SECPKG_INTERFACE_VERSION_4 end here */
439 SpQueryMetaDataFn
*QueryMetaData
;
440 SpExchangeMetaDataFn
*ExchangeMetaData
;
441 SpGetCredUIContextFn
*GetCredUIContext
;
442 SpUpdateCredentialsFn
*UpdateCredentials
;
443 /* Packages with version SECPKG_INTERFACE_VERSION_5 end here */
444 SpValidateTargetInfoFn
*ValidateTargetInfo
;
445 /* Packages with version SECPKG_INTERFACE_VERSION_6 end here */
446 LSA_AP_POST_LOGON_USER
* PostLogonUser
;
447 /* Packages with version SECPKG_INTERFACE_VERSION_7 end here */
448 } SECPKG_FUNCTION_TABLE
,
449 *PSECPKG_FUNCTION_TABLE
;
451 /* dispatch tables of user-mode functions implemented by SSP/AP */
452 typedef struct SECPKG_USER_FUNCTION_TABLE
{
453 SpInstanceInitFn
*InstanceInit
;
454 SpInitUserModeContextFn
*InitUserModeContext
;
455 SpMakeSignatureFn
*MakeSignature
;
456 SpVerifySignatureFn
*VerifySignature
;
457 SpSealMessageFn
*SealMessage
;
458 SpUnsealMessageFn
*UnsealMessage
;
459 SpGetContextTokenFn
*GetContextToken
;
460 SpQueryContextAttributesFn
*SpQueryContextAttributes
;
461 SpCompleteAuthTokenFn
*CompleteAuthToken
;
462 SpDeleteContextFn
*DeleteUserModeContext
;
463 SpFormatCredentialsFn
*FormatCredentials
;
464 SpMarshallSupplementalCredsFn
*MarshallSupplementalCreds
;
465 SpExportSecurityContextFn
*ExportContext
;
466 SpImportSecurityContextFn
*ImportContext
;
467 } SECPKG_USER_FUNCTION_TABLE
,
468 *PSECPKG_USER_FUNCTION_TABLE
;
470 /* LSA-mode entry point to SSP/APs */
471 typedef NTSTATUS (NTAPI
*SpLsaModeInitializeFn
)(ULONG
, PULONG
,
472 PSECPKG_FUNCTION_TABLE
*, PULONG
);
474 /* User-mode entry point to SSP/APs */
475 typedef NTSTATUS (WINAPI
*SpUserModeInitializeFn
)(ULONG
, PULONG
,
476 PSECPKG_USER_FUNCTION_TABLE
*, PULONG
);
481 #endif /* _NTSECPKG_H */