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 /* enum definitions for Secure Service Provider/Authentication Packages */
34 typedef enum _LSA_TOKEN_INFORMATION_TYPE
{
35 LsaTokenInformationNull
,
37 } LSA_TOKEN_INFORMATION_TYPE
, *PLSA_TOKEN_INFORMATION_TYPE
;
39 typedef enum _SECPKG_EXTENDED_INFORMATION_CLASS
43 SecpkgMutualAuthLevel
,
45 } SECPKG_EXTENDED_INFORMATION_CLASS
;
47 typedef enum _SECPKG_NAME_TYPE
{
54 /* struct definitions for SSP/AP */
55 typedef struct _SECPKG_PRIMARY_CRED
{
57 UNICODE_STRING DownlevelName
;
58 UNICODE_STRING DomainName
;
59 UNICODE_STRING Password
;
60 UNICODE_STRING OldPassword
;
63 UNICODE_STRING DnsDomainName
;
65 UNICODE_STRING LogonServer
;
66 UNICODE_STRING Spare1
;
67 UNICODE_STRING Spare2
;
68 UNICODE_STRING Spare3
;
69 UNICODE_STRING Spare4
;
70 } SECPKG_PRIMARY_CRED
, *PSECPKG_PRIMARY_CRED
;
72 typedef struct _SECPKG_SUPPLEMENTAL_CRED
{
73 UNICODE_STRING PackageName
;
76 } SECPKG_SUPPLEMENTAL_CRED
, *PSECPKG_SUPPLEMENTAL_CRED
;
78 typedef struct _SECPKG_SUPPLEMENTAL_CRED_ARRAY
{
79 ULONG CredentialCount
;
80 SECPKG_SUPPLEMENTAL_CRED Credentials
[1];
81 } SECPKG_SUPPLEMENTAL_CRED_ARRAY
, *PSECPKG_SUPPLEMENTAL_CRED_ARRAY
;
83 typedef struct _SECPKG_PARAMETERS
{
88 UNICODE_STRING DomainName
;
89 UNICODE_STRING DnsDomainName
;
91 } SECPKG_PARAMETERS
, *PSECPKG_PARAMETERS
,
92 SECPKG_EVENT_DOMAIN_CHANGE
, *PSECPKG_EVENT_DOMAIN_CHANGE
;
94 typedef struct _SECPKG_CLIENT_INFO
{
98 BOOLEAN HasTcbPrivilege
;
99 BOOLEAN Impersonating
;
101 } SECPKG_CLIENT_INFO
,
102 *PSECPKG_CLIENT_INFO
;
104 typedef struct _SECURITY_USER_DATA
{
105 UNICODE_STRING UserName
;
106 UNICODE_STRING LogonDomainName
;
107 UNICODE_STRING LogonServer
;
109 } SECURITY_USER_DATA
, *PSECURITY_USER_DATA
,
110 SecurityUserData
, *PSecurityUserData
;
112 typedef struct _SECPKG_GSS_INFO
{
113 ULONG EncodedIdLength
;
115 } SECPKG_GSS_INFO
, *PSECPKG_GSS_INFO
;
117 typedef struct _SECPKG_CONTEXT_THUNKS
{
118 ULONG InfoLevelCount
;
120 } SECPKG_CONTEXT_THUNKS
, *PSECPKG_CONTEXT_THUNKS
;
122 typedef struct _SECPKG_MUTUAL_AUTH_LEVEL
{
123 ULONG MutualAuthLevel
;
124 } SECPKG_MUTUAL_AUTH_LEVEL
, *PSECPKG_MUTUAL_AUTH_LEVEL
;
126 typedef struct _SECPKG_CALL_INFO
{
131 } SECPKG_CALL_INFO
, *PSECPKG_CALL_INFO
;
133 typedef struct _SECPKG_EXTENDED_INFORMATION
{
134 SECPKG_EXTENDED_INFORMATION_CLASS Class
;
136 SECPKG_GSS_INFO GssInfo
;
137 SECPKG_CONTEXT_THUNKS ContextThunks
;
138 SECPKG_MUTUAL_AUTH_LEVEL MutualAuthLevel
;
140 } SECPKG_EXTENDED_INFORMATION
, *PSECPKG_EXTENDED_INFORMATION
;
142 /* callbacks implemented by SSP/AP dlls and called by the LSA */
143 typedef VOID (NTAPI
*PLSA_CALLBACK_FUNCTION
)(ULONG_PTR
, ULONG_PTR
, PSecBuffer
,
146 /* misc typedefs used in the below prototypes */
147 typedef PVOID
*PLSA_CLIENT_REQUEST
;
148 typedef ULONG LSA_SEC_HANDLE
, *PLSA_SEC_HANDLE
;
149 typedef LPTHREAD_START_ROUTINE SEC_THREAD_START
;
150 typedef PSECURITY_ATTRIBUTES SEC_ATTRS
;
152 /* functions used by SSP/AP obtainable by dispatch tables */
153 typedef NTSTATUS (NTAPI
*PLSA_REGISTER_CALLBACK
)(ULONG
, PLSA_CALLBACK_FUNCTION
);
154 typedef NTSTATUS (NTAPI
*PLSA_CREATE_LOGON_SESSION
)(PLUID
);
155 typedef NTSTATUS (NTAPI
*PLSA_DELETE_LOGON_SESSION
)(PLUID
);
156 typedef NTSTATUS (NTAPI
*PLSA_ADD_CREDENTIAL
)(PLUID
, ULONG
, PLSA_STRING
,
158 typedef NTSTATUS (NTAPI
*PLSA_GET_CREDENTIALS
)(PLUID
, ULONG
, PULONG
, BOOLEAN
,
159 PLSA_STRING
, PULONG
, PLSA_STRING
);
160 typedef NTSTATUS (NTAPI
*PLSA_DELETE_CREDENTIAL
)(PLUID
, ULONG
, PLSA_STRING
);
161 typedef PVOID (NTAPI
*PLSA_ALLOCATE_LSA_HEAP
)(ULONG
);
162 typedef VOID (NTAPI
*PLSA_FREE_LSA_HEAP
)(PVOID
);
163 typedef NTSTATUS (NTAPI
*PLSA_ALLOCATE_CLIENT_BUFFER
)(PLSA_CLIENT_REQUEST
,
165 typedef NTSTATUS (NTAPI
*PLSA_FREE_CLIENT_BUFFER
)(PLSA_CLIENT_REQUEST
, PVOID
);
166 typedef NTSTATUS (NTAPI
*PLSA_COPY_TO_CLIENT_BUFFER
)(PLSA_CLIENT_REQUEST
, ULONG
,
168 typedef NTSTATUS (NTAPI
*PLSA_COPY_FROM_CLIENT_BUFFER
)(PLSA_CLIENT_REQUEST
,
169 ULONG
, PVOID
, PVOID
);
170 typedef NTSTATUS (NTAPI
*PLSA_IMPERSONATE_CLIENT
)(void);
171 typedef NTSTATUS (NTAPI
*PLSA_UNLOAD_PACKAGE
)(void);
172 typedef NTSTATUS (NTAPI
*PLSA_DUPLICATE_HANDLE
)(HANDLE
, PHANDLE
);
173 typedef NTSTATUS (NTAPI
*PLSA_SAVE_SUPPLEMENTAL_CREDENTIALS
)(PLUID
, ULONG
,
175 typedef HANDLE (NTAPI
*PLSA_CREATE_THREAD
)(SEC_ATTRS
, ULONG
, SEC_THREAD_START
,
176 PVOID
, ULONG
, PULONG
);
177 typedef NTSTATUS (NTAPI
*PLSA_GET_CLIENT_INFO
)(PSECPKG_CLIENT_INFO
);
178 typedef HANDLE (NTAPI
*PLSA_REGISTER_NOTIFICATION
)(SEC_THREAD_START
, PVOID
,
179 ULONG
, ULONG
, ULONG
, ULONG
, HANDLE
);
180 typedef NTSTATUS (NTAPI
*PLSA_CANCEL_NOTIFICATION
)(HANDLE
);
181 typedef NTSTATUS (NTAPI
*PLSA_MAP_BUFFER
)(PSecBuffer
, PSecBuffer
);
182 typedef NTSTATUS (NTAPI
*PLSA_CREATE_TOKEN
)(PLUID
, PTOKEN_SOURCE
,
183 SECURITY_LOGON_TYPE
, SECURITY_IMPERSONATION_LEVEL
, LSA_TOKEN_INFORMATION_TYPE
,
184 PVOID
, PTOKEN_GROUPS
, PUNICODE_STRING
, PUNICODE_STRING
, PUNICODE_STRING
,
185 PUNICODE_STRING
, PHANDLE
, PNTSTATUS
);
186 typedef VOID (NTAPI
*PLSA_AUDIT_LOGON
)(NTSTATUS
, NTSTATUS
, PUNICODE_STRING
,
187 PUNICODE_STRING
, PUNICODE_STRING
, OPTIONAL PSID
, SECURITY_LOGON_TYPE
,
188 PTOKEN_SOURCE
, PLUID
);
189 typedef NTSTATUS (NTAPI
*PLSA_CALL_PACKAGE
)(PUNICODE_STRING
, PVOID
, ULONG
,
190 PVOID
*, PULONG
, PNTSTATUS
);
191 typedef BOOLEAN (NTAPI
*PLSA_GET_CALL_INFO
)(PSECPKG_CALL_INFO
);
192 typedef NTSTATUS (NTAPI
*PLSA_CALL_PACKAGEEX
)(PUNICODE_STRING
, PVOID
, PVOID
,
193 ULONG
, PVOID
*, PULONG
, PNTSTATUS
);
194 typedef PVOID (NTAPI
*PLSA_CREATE_SHARED_MEMORY
)(ULONG
, ULONG
);
195 typedef PVOID (NTAPI
*PLSA_ALLOCATE_SHARED_MEMORY
)(PVOID
, ULONG
);
196 typedef VOID (NTAPI
*PLSA_FREE_SHARED_MEMORY
)(PVOID
, PVOID
);
197 typedef BOOLEAN (NTAPI
*PLSA_DELETE_SHARED_MEMORY
)(PVOID
);
198 typedef NTSTATUS (NTAPI
*PLSA_OPEN_SAM_USER
)(PUNICODE_STRING
, SECPKG_NAME_TYPE
,
199 PUNICODE_STRING
, BOOLEAN
, ULONG
, PVOID
*);
200 typedef NTSTATUS (NTAPI
*PLSA_GET_USER_CREDENTIALS
)(PVOID
, PVOID
*, PULONG
,
202 typedef NTSTATUS (NTAPI
*PLSA_GET_USER_AUTH_DATA
)(PVOID
, PUCHAR
*, PULONG
);
203 typedef NTSTATUS (NTAPI
*PLSA_CLOSE_SAM_USER
)(PVOID
);
204 typedef NTSTATUS (NTAPI
*PLSA_CONVERT_AUTH_DATA_TO_TOKEN
)(PVOID
, ULONG
,
205 SECURITY_IMPERSONATION_LEVEL
, PTOKEN_SOURCE
, SECURITY_LOGON_TYPE
,
206 PUNICODE_STRING
, PHANDLE
, PLUID
, PUNICODE_STRING
, PNTSTATUS
);
207 typedef NTSTATUS (NTAPI
*PLSA_CLIENT_CALLBACK
)(PCHAR
, ULONG_PTR
, ULONG_PTR
,
208 PSecBuffer
, PSecBuffer
);
209 typedef NTSTATUS (NTAPI
*PLSA_UPDATE_PRIMARY_CREDENTIALS
)(PSECPKG_PRIMARY_CRED
, PSECPKG_SUPPLEMENTAL_CRED_ARRAY
);
210 typedef NTSTATUS (NTAPI
*PLSA_GET_AUTH_DATA_FOR_USER
)(PUNICODE_STRING
,
211 SECPKG_NAME_TYPE
, PUNICODE_STRING
, PUCHAR
*, PULONG
, PUNICODE_STRING
);
212 typedef NTSTATUS (NTAPI
*PLSA_CRACK_SINGLE_NAME
)(ULONG
, BOOLEAN
,
213 PUNICODE_STRING
, PUNICODE_STRING
, ULONG
, PUNICODE_STRING
, PUNICODE_STRING
,
215 typedef NTSTATUS (NTAPI
*PLSA_AUDIT_ACCOUNT_LOGON
)(ULONG
, BOOLEAN
,
216 PUNICODE_STRING
, PUNICODE_STRING
, PUNICODE_STRING
, NTSTATUS
);
217 typedef NTSTATUS (NTAPI
*PLSA_CALL_PACKAGE_PASSTHROUGH
)(PUNICODE_STRING
, PVOID
,
218 PVOID
, ULONG
, PVOID
*, PULONG
, PNTSTATUS
);
220 /* Dispatch tables of functions used by SSP/AP */
221 typedef struct SECPKG_DLL_FUNCTIONS
{
222 PLSA_ALLOCATE_LSA_HEAP AllocateHeap
;
223 PLSA_FREE_LSA_HEAP FreeHeap
;
224 PLSA_REGISTER_CALLBACK RegisterCallback
;
225 } SECPKG_DLL_FUNCTIONS
,
226 *PSECPKG_DLL_FUNCTIONS
;
228 typedef struct LSA_DISPATCH_TABLE
{
229 PLSA_CREATE_LOGON_SESSION CreateLogonSession
;
230 PLSA_DELETE_LOGON_SESSION DeleteLogonSession
;
231 PLSA_ADD_CREDENTIAL AddCredential
;
232 PLSA_GET_CREDENTIALS GetCredentials
;
233 PLSA_DELETE_CREDENTIAL DeleteCredential
;
234 PLSA_ALLOCATE_LSA_HEAP AllocateLsaHeap
;
235 PLSA_FREE_LSA_HEAP FreeLsaHeap
;
236 PLSA_ALLOCATE_CLIENT_BUFFER AllocateClientBuffer
;
237 PLSA_FREE_CLIENT_BUFFER FreeClientBuffer
;
238 PLSA_COPY_TO_CLIENT_BUFFER CopyToClientBuffer
;
239 PLSA_COPY_FROM_CLIENT_BUFFER CopyFromClientBuffer
;
240 } LSA_DISPATCH_TABLE
,
241 *PLSA_DISPATCH_TABLE
;
243 typedef struct _LSA_SECPKG_FUNCTION_TABLE
{
244 PLSA_CREATE_LOGON_SESSION CreateLogonSession
;
245 PLSA_DELETE_LOGON_SESSION DeleteLogonSession
;
246 PLSA_ADD_CREDENTIAL AddCredential
;
247 PLSA_GET_CREDENTIALS GetCredentials
;
248 PLSA_DELETE_CREDENTIAL DeleteCredential
;
249 PLSA_ALLOCATE_LSA_HEAP AllocateLsaHeap
;
250 PLSA_FREE_LSA_HEAP FreeLsaHeap
;
251 PLSA_ALLOCATE_CLIENT_BUFFER AllocateClientBuffer
;
252 PLSA_FREE_CLIENT_BUFFER FreeClientBuffer
;
253 PLSA_COPY_TO_CLIENT_BUFFER CopyToClientBuffer
;
254 PLSA_COPY_FROM_CLIENT_BUFFER CopyFromClientBuffer
;
255 PLSA_IMPERSONATE_CLIENT ImpersonateClient
;
256 PLSA_UNLOAD_PACKAGE UnloadPackage
;
257 PLSA_DUPLICATE_HANDLE DuplicateHandle
;
258 PLSA_SAVE_SUPPLEMENTAL_CREDENTIALS SaveSupplementalCredentials
;
259 PLSA_CREATE_THREAD CreateThread
;
260 PLSA_GET_CLIENT_INFO GetClientInfo
;
261 PLSA_REGISTER_NOTIFICATION RegisterNotification
;
262 PLSA_CANCEL_NOTIFICATION CancelNotification
;
263 PLSA_MAP_BUFFER MapBuffer
;
264 PLSA_CREATE_TOKEN CreateToken
;
265 PLSA_AUDIT_LOGON AuditLogon
;
266 PLSA_CALL_PACKAGE CallPackage
;
267 PLSA_FREE_LSA_HEAP FreeReturnBuffer
;
268 PLSA_GET_CALL_INFO GetCallInfo
;
269 PLSA_CALL_PACKAGEEX CallPackageEx
;
270 PLSA_CREATE_SHARED_MEMORY CreateSharedMemory
;
271 PLSA_ALLOCATE_SHARED_MEMORY AllocateSharedMemory
;
272 PLSA_FREE_SHARED_MEMORY FreeSharedMemory
;
273 PLSA_DELETE_SHARED_MEMORY DeleteSharedMemory
;
274 PLSA_OPEN_SAM_USER OpenSamUser
;
275 PLSA_GET_USER_CREDENTIALS GetUserCredentials
;
276 PLSA_GET_USER_AUTH_DATA GetUserAuthData
;
277 PLSA_CLOSE_SAM_USER CloseSamUser
;
278 PLSA_CONVERT_AUTH_DATA_TO_TOKEN ConvertAuthDataToToken
;
279 PLSA_CLIENT_CALLBACK ClientCallback
;
280 PLSA_UPDATE_PRIMARY_CREDENTIALS UpdateCredentials
;
281 PLSA_GET_AUTH_DATA_FOR_USER GetAuthDataForUser
;
282 PLSA_CRACK_SINGLE_NAME CrackSingleName
;
283 PLSA_AUDIT_ACCOUNT_LOGON AuditAccountLogon
;
284 PLSA_CALL_PACKAGE_PASSTHROUGH CallPackagePassthrough
;
285 } LSA_SECPKG_FUNCTION_TABLE
,
286 *PLSA_SECPKG_FUNCTION_TABLE
;
288 /* LSA-mode functions implemented by SSP/AP obtainable by a dispatch table */
289 typedef NTSTATUS (NTAPI
*PLSA_AP_INITIALIZE_PACKAGE
)(ULONG
, PLSA_DISPATCH_TABLE
,
290 PLSA_STRING
, PLSA_STRING
, PLSA_STRING
*);
291 typedef NTSTATUS (NTAPI
*PLSA_AP_LOGON_USER
)(LPWSTR
, LPWSTR
, LPWSTR
, LPWSTR
,
292 DWORD
, DWORD
, PHANDLE
);
293 typedef NTSTATUS (NTAPI
*PLSA_AP_CALL_PACKAGE
)(PUNICODE_STRING
, PVOID
, ULONG
,
294 PVOID
*, PULONG
, PNTSTATUS
);
295 typedef VOID (NTAPI
*PLSA_AP_LOGON_TERMINATED
)(PLUID
);
296 typedef NTSTATUS (NTAPI
*PLSA_AP_CALL_PACKAGE_UNTRUSTED
)(PLSA_CLIENT_REQUEST
,
297 PVOID
, PVOID
, ULONG
, PVOID
*, PULONG
, PNTSTATUS
);
298 typedef NTSTATUS (NTAPI
*PLSA_AP_CALL_PACKAGE_PASSTHROUGH
)(PUNICODE_STRING
,
299 PVOID
, PVOID
, ULONG
, PVOID
*, PULONG
, PNTSTATUS
);
300 typedef NTSTATUS (NTAPI
*PLSA_AP_LOGON_USER_EX
)(PLSA_CLIENT_REQUEST
,
301 SECURITY_LOGON_TYPE
, PVOID
, PVOID
, ULONG
, PVOID
*, PULONG
, PLUID
, PNTSTATUS
,
302 PLSA_TOKEN_INFORMATION_TYPE
, PVOID
*, PUNICODE_STRING
*, PUNICODE_STRING
*,
304 typedef NTSTATUS (NTAPI
*PLSA_AP_LOGON_USER_EX2
)(PLSA_CLIENT_REQUEST
,
305 SECURITY_LOGON_TYPE
, PVOID
, PVOID
, ULONG
, PVOID
*, PULONG
, PLUID
, PNTSTATUS
,
306 PLSA_TOKEN_INFORMATION_TYPE
, PVOID
*, PUNICODE_STRING
*, PUNICODE_STRING
*,
307 PUNICODE_STRING
*, PSECPKG_PRIMARY_CRED
, PSECPKG_SUPPLEMENTAL_CRED_ARRAY
*);
308 typedef NTSTATUS (SpInitializeFn
)(ULONG_PTR
, PSECPKG_PARAMETERS
,
309 PLSA_SECPKG_FUNCTION_TABLE
);
310 typedef NTSTATUS (NTAPI SpShutDownFn
)(void);
311 typedef NTSTATUS (NTAPI SpGetInfoFn
)(PSecPkgInfoW
);
312 typedef NTSTATUS (NTAPI SpAcceptCredentialsFn
)(SECURITY_LOGON_TYPE
,
313 PUNICODE_STRING
, PSECPKG_PRIMARY_CRED
, PSECPKG_SUPPLEMENTAL_CRED
);
314 typedef NTSTATUS (NTAPI SpAcquireCredentialsHandleFn
)(PUNICODE_STRING
, ULONG
,
315 PLUID
, PVOID
, PVOID
, PVOID
, PLSA_SEC_HANDLE
, PTimeStamp
);
316 typedef NTSTATUS (NTAPI SpQueryCredentialsAttributesFn
)(LSA_SEC_HANDLE
, ULONG
,
318 typedef NTSTATUS (NTAPI SpFreeCredentialsHandleFn
)(LSA_SEC_HANDLE
);
319 typedef NTSTATUS (NTAPI SpSaveCredentialsFn
)(LSA_SEC_HANDLE
, PSecBuffer
);
320 typedef NTSTATUS (NTAPI SpGetCredentialsFn
)(LSA_SEC_HANDLE
, PSecBuffer
);
321 typedef NTSTATUS (NTAPI SpDeleteCredentialsFn
)(LSA_SEC_HANDLE
, PSecBuffer
);
322 typedef NTSTATUS (NTAPI SpInitLsaModeContextFn
)(LSA_SEC_HANDLE
, LSA_SEC_HANDLE
,
323 PUNICODE_STRING
, ULONG
, ULONG
, PSecBufferDesc
, PLSA_SEC_HANDLE
, PSecBufferDesc
,
324 PULONG
, PTimeStamp
, PBOOLEAN
, PSecBuffer
);
325 typedef NTSTATUS (NTAPI SpAcceptLsaModeContextFn
)(LSA_SEC_HANDLE
,
326 LSA_SEC_HANDLE
, PSecBufferDesc
, ULONG
, ULONG
, PLSA_SEC_HANDLE
, PSecBufferDesc
,
327 PULONG
, PTimeStamp
, PBOOLEAN
, PSecBuffer
);
328 typedef NTSTATUS (NTAPI SpDeleteContextFn
)(LSA_SEC_HANDLE
);
329 typedef NTSTATUS (NTAPI SpApplyControlTokenFn
)(LSA_SEC_HANDLE
, PSecBufferDesc
);
330 typedef NTSTATUS (NTAPI SpGetUserInfoFn
)(PLUID
, ULONG
, PSecurityUserData
*);
331 typedef NTSTATUS (NTAPI SpGetExtendedInformationFn
)(
332 SECPKG_EXTENDED_INFORMATION_CLASS
, PSECPKG_EXTENDED_INFORMATION
*);
333 typedef NTSTATUS (NTAPI SpQueryContextAttributesFn
)(LSA_SEC_HANDLE
, ULONG
,
335 typedef NTSTATUS (NTAPI SpAddCredentialsFn
)(LSA_SEC_HANDLE
, PUNICODE_STRING
,
336 PUNICODE_STRING
, ULONG
, PVOID
, PVOID
, PVOID
, PTimeStamp
);
337 typedef NTSTATUS (NTAPI SpSetExtendedInformationFn
)(
338 SECPKG_EXTENDED_INFORMATION_CLASS
, PSECPKG_EXTENDED_INFORMATION
);
340 /* User-mode functions implemented by SSP/AP obtainable by a dispatch table */
341 typedef NTSTATUS (NTAPI SpInstanceInitFn
)(ULONG
, PSECPKG_DLL_FUNCTIONS
,
343 typedef NTSTATUS (NTAPI SpInitUserModeContextFn
)(LSA_SEC_HANDLE
, PSecBuffer
);
344 typedef NTSTATUS (NTAPI SpMakeSignatureFn
)(LSA_SEC_HANDLE
, ULONG
,
345 PSecBufferDesc
, ULONG
);
346 typedef NTSTATUS (NTAPI SpVerifySignatureFn
)(LSA_SEC_HANDLE
, PSecBufferDesc
,
348 typedef NTSTATUS (NTAPI SpSealMessageFn
)(LSA_SEC_HANDLE
, ULONG
, PSecBufferDesc
,
350 typedef NTSTATUS (NTAPI SpUnsealMessageFn
)(LSA_SEC_HANDLE
, PSecBufferDesc
,
352 typedef NTSTATUS (NTAPI SpGetContextTokenFn
)(LSA_SEC_HANDLE
, PHANDLE
);
353 typedef NTSTATUS (NTAPI SpCompleteAuthTokenFn
)(LSA_SEC_HANDLE
, PSecBufferDesc
);
354 typedef NTSTATUS (NTAPI SpFormatCredentialsFn
)(PSecBuffer
, PSecBuffer
);
355 typedef NTSTATUS (NTAPI SpMarshallSupplementalCredsFn
)(ULONG
, PUCHAR
, PULONG
,
357 typedef NTSTATUS (NTAPI SpExportSecurityContextFn
)(LSA_SEC_HANDLE
, ULONG
,
358 PSecBuffer
, PHANDLE
);
359 typedef NTSTATUS (NTAPI SpImportSecurityContextFn
)(PSecBuffer
, HANDLE
,
362 /* dispatch tables of LSA-mode functions implemented by SSP/AP */
363 typedef struct SECPKG_FUNCTION_TABLE
{
364 PLSA_AP_INITIALIZE_PACKAGE InitializePackage
;
365 PLSA_AP_LOGON_USER LsaLogonUser
;
366 PLSA_AP_CALL_PACKAGE CallPackage
;
367 PLSA_AP_LOGON_TERMINATED LogonTerminated
;
368 PLSA_AP_CALL_PACKAGE_UNTRUSTED CallPackageUntrusted
;
369 PLSA_AP_CALL_PACKAGE_PASSTHROUGH CallPackagePassthrough
;
370 PLSA_AP_LOGON_USER_EX LogonUserEx
;
371 PLSA_AP_LOGON_USER_EX2 LogonUserEx2
;
372 SpInitializeFn
*Initialize
;
373 SpShutDownFn
*Shutdown
;
374 SpGetInfoFn
*GetInfo
;
375 SpAcceptCredentialsFn
*AcceptCredentials
;
376 SpAcquireCredentialsHandleFn
*SpAcquireCredentialsHandle
;
377 SpQueryCredentialsAttributesFn
*SpQueryCredentialsAttributes
;
378 SpFreeCredentialsHandleFn
*FreeCredentialsHandle
;
379 SpSaveCredentialsFn
*SaveCredentials
;
380 SpGetCredentialsFn
*GetCredentials
;
381 SpDeleteCredentialsFn
*DeleteCredentials
;
382 SpInitLsaModeContextFn
*InitLsaModeContext
;
383 SpAcceptLsaModeContextFn
*AcceptLsaModeContext
;
384 SpDeleteContextFn
*DeleteContext
;
385 SpApplyControlTokenFn
*ApplyControlToken
;
386 SpGetUserInfoFn
*GetUserInfo
;
387 SpGetExtendedInformationFn
*GetExtendedInformation
;
388 SpQueryContextAttributesFn
*SpQueryContextAttributes
;
389 SpAddCredentialsFn
*SpAddCredentials
;
390 SpSetExtendedInformationFn
*SetExtendedInformation
;
391 } SECPKG_FUNCTION_TABLE
,
392 *PSECPKG_FUNCTION_TABLE
;
394 /* dispatch tables of user-mode functions implemented by SSP/AP */
395 typedef struct SECPKG_USER_FUNCTION_TABLE
{
396 SpInstanceInitFn
*InstanceInit
;
397 SpInitUserModeContextFn
*InitUserModeContext
;
398 SpMakeSignatureFn
*MakeSignature
;
399 SpVerifySignatureFn
*VerifySignature
;
400 SpSealMessageFn
*SealMessage
;
401 SpUnsealMessageFn
*UnsealMessage
;
402 SpGetContextTokenFn
*GetContextToken
;
403 SpQueryContextAttributesFn
*SpQueryContextAttributes
;
404 SpCompleteAuthTokenFn
*CompleteAuthToken
;
405 SpDeleteContextFn
*DeleteUserModeContext
;
406 SpFormatCredentialsFn
*FormatCredentials
;
407 SpMarshallSupplementalCredsFn
*MarshallSupplementalCreds
;
408 SpExportSecurityContextFn
*ExportContext
;
409 SpImportSecurityContextFn
*ImportContext
;
410 } SECPKG_USER_FUNCTION_TABLE
,
411 *PSECPKG_USER_FUNCTION_TABLE
;
413 /* LSA-mode entry point to SSP/APs */
414 typedef NTSTATUS (NTAPI
*SpLsaModeInitializeFn
)(ULONG
, PULONG
,
415 PSECPKG_FUNCTION_TABLE
*, PULONG
);
417 /* User-mode entry point to SSP/APs */
418 typedef NTSTATUS (WINAPI
*SpUserModeInitializeFn
)(ULONG
, PULONG
,
419 PSECPKG_USER_FUNCTION_TABLE
*, PULONG
);
424 #endif /* _NTSECPKG_H */