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
38 /* enum definitions for Secure Service Provider/Authentication Packages */
39 typedef enum _LSA_TOKEN_INFORMATION_TYPE
{
40 LsaTokenInformationNull
,
42 } LSA_TOKEN_INFORMATION_TYPE
, *PLSA_TOKEN_INFORMATION_TYPE
;
44 typedef enum _SECPKG_EXTENDED_INFORMATION_CLASS
48 SecpkgMutualAuthLevel
,
50 } SECPKG_EXTENDED_INFORMATION_CLASS
;
52 typedef enum _SECPKG_NAME_TYPE
{
59 /* struct definitions for SSP/AP */
60 typedef struct _SECPKG_PRIMARY_CRED
{
62 UNICODE_STRING DownlevelName
;
63 UNICODE_STRING DomainName
;
64 UNICODE_STRING Password
;
65 UNICODE_STRING OldPassword
;
68 UNICODE_STRING DnsDomainName
;
70 UNICODE_STRING LogonServer
;
71 UNICODE_STRING Spare1
;
72 UNICODE_STRING Spare2
;
73 UNICODE_STRING Spare3
;
74 UNICODE_STRING Spare4
;
75 } SECPKG_PRIMARY_CRED
, *PSECPKG_PRIMARY_CRED
;
77 typedef struct _SECPKG_SUPPLEMENTAL_CRED
{
78 UNICODE_STRING PackageName
;
81 } SECPKG_SUPPLEMENTAL_CRED
, *PSECPKG_SUPPLEMENTAL_CRED
;
83 typedef struct _SECPKG_SUPPLEMENTAL_CRED_ARRAY
{
84 ULONG CredentialCount
;
85 SECPKG_SUPPLEMENTAL_CRED Credentials
[1];
86 } SECPKG_SUPPLEMENTAL_CRED_ARRAY
, *PSECPKG_SUPPLEMENTAL_CRED_ARRAY
;
88 typedef struct _SECPKG_PARAMETERS
{
93 UNICODE_STRING DomainName
;
94 UNICODE_STRING DnsDomainName
;
96 } SECPKG_PARAMETERS
, *PSECPKG_PARAMETERS
,
97 SECPKG_EVENT_DOMAIN_CHANGE
, *PSECPKG_EVENT_DOMAIN_CHANGE
;
99 typedef struct _SECPKG_CLIENT_INFO
{
103 BOOLEAN HasTcbPrivilege
;
104 BOOLEAN Impersonating
;
106 } SECPKG_CLIENT_INFO
,
107 *PSECPKG_CLIENT_INFO
;
109 typedef struct _SECURITY_USER_DATA
{
110 UNICODE_STRING UserName
;
111 UNICODE_STRING LogonDomainName
;
112 UNICODE_STRING LogonServer
;
114 } SECURITY_USER_DATA
, *PSECURITY_USER_DATA
,
115 SecurityUserData
, *PSecurityUserData
;
117 typedef struct _SECPKG_GSS_INFO
{
118 ULONG EncodedIdLength
;
120 } SECPKG_GSS_INFO
, *PSECPKG_GSS_INFO
;
122 typedef struct _SECPKG_CONTEXT_THUNKS
{
123 ULONG InfoLevelCount
;
125 } SECPKG_CONTEXT_THUNKS
, *PSECPKG_CONTEXT_THUNKS
;
127 typedef struct _SECPKG_MUTUAL_AUTH_LEVEL
{
128 ULONG MutualAuthLevel
;
129 } SECPKG_MUTUAL_AUTH_LEVEL
, *PSECPKG_MUTUAL_AUTH_LEVEL
;
131 typedef struct _SECPKG_CALL_INFO
{
136 } SECPKG_CALL_INFO
, *PSECPKG_CALL_INFO
;
138 typedef struct _SECPKG_EXTENDED_INFORMATION
{
139 SECPKG_EXTENDED_INFORMATION_CLASS Class
;
141 SECPKG_GSS_INFO GssInfo
;
142 SECPKG_CONTEXT_THUNKS ContextThunks
;
143 SECPKG_MUTUAL_AUTH_LEVEL MutualAuthLevel
;
145 } SECPKG_EXTENDED_INFORMATION
, *PSECPKG_EXTENDED_INFORMATION
;
147 /* callbacks implemented by SSP/AP dlls and called by the LSA */
148 typedef VOID (NTAPI
*PLSA_CALLBACK_FUNCTION
)(ULONG_PTR
, ULONG_PTR
, PSecBuffer
,
151 /* misc typedefs used in the below prototypes */
152 typedef PVOID
*PLSA_CLIENT_REQUEST
;
153 typedef ULONG LSA_SEC_HANDLE
, *PLSA_SEC_HANDLE
;
154 typedef LPTHREAD_START_ROUTINE SEC_THREAD_START
;
155 typedef PSECURITY_ATTRIBUTES SEC_ATTRS
;
157 /* functions used by SSP/AP obtainable by dispatch tables */
158 typedef NTSTATUS (NTAPI
*PLSA_REGISTER_CALLBACK
)(ULONG
, PLSA_CALLBACK_FUNCTION
);
159 typedef NTSTATUS (NTAPI
*PLSA_CREATE_LOGON_SESSION
)(PLUID
);
160 typedef NTSTATUS (NTAPI
*PLSA_DELETE_LOGON_SESSION
)(PLUID
);
161 typedef NTSTATUS (NTAPI
*PLSA_ADD_CREDENTIAL
)(PLUID
, ULONG
, PLSA_STRING
,
163 typedef NTSTATUS (NTAPI
*PLSA_GET_CREDENTIALS
)(PLUID
, ULONG
, PULONG
, BOOLEAN
,
164 PLSA_STRING
, PULONG
, PLSA_STRING
);
165 typedef NTSTATUS (NTAPI
*PLSA_DELETE_CREDENTIAL
)(PLUID
, ULONG
, PLSA_STRING
);
166 typedef PVOID (NTAPI
*PLSA_ALLOCATE_LSA_HEAP
)(ULONG
);
167 typedef VOID (NTAPI
*PLSA_FREE_LSA_HEAP
)(PVOID
);
168 typedef NTSTATUS (NTAPI
*PLSA_ALLOCATE_CLIENT_BUFFER
)(PLSA_CLIENT_REQUEST
,
170 typedef NTSTATUS (NTAPI
*PLSA_FREE_CLIENT_BUFFER
)(PLSA_CLIENT_REQUEST
, PVOID
);
171 typedef NTSTATUS (NTAPI
*PLSA_COPY_TO_CLIENT_BUFFER
)(PLSA_CLIENT_REQUEST
, ULONG
,
173 typedef NTSTATUS (NTAPI
*PLSA_COPY_FROM_CLIENT_BUFFER
)(PLSA_CLIENT_REQUEST
,
174 ULONG
, PVOID
, PVOID
);
175 typedef NTSTATUS (NTAPI
*PLSA_IMPERSONATE_CLIENT
)(void);
176 typedef NTSTATUS (NTAPI
*PLSA_UNLOAD_PACKAGE
)(void);
177 typedef NTSTATUS (NTAPI
*PLSA_DUPLICATE_HANDLE
)(HANDLE
, PHANDLE
);
178 typedef NTSTATUS (NTAPI
*PLSA_SAVE_SUPPLEMENTAL_CREDENTIALS
)(PLUID
, ULONG
,
180 typedef HANDLE (NTAPI
*PLSA_CREATE_THREAD
)(SEC_ATTRS
, ULONG
, SEC_THREAD_START
,
181 PVOID
, ULONG
, PULONG
);
182 typedef NTSTATUS (NTAPI
*PLSA_GET_CLIENT_INFO
)(PSECPKG_CLIENT_INFO
);
183 typedef HANDLE (NTAPI
*PLSA_REGISTER_NOTIFICATION
)(SEC_THREAD_START
, PVOID
,
184 ULONG
, ULONG
, ULONG
, ULONG
, HANDLE
);
185 typedef NTSTATUS (NTAPI
*PLSA_CANCEL_NOTIFICATION
)(HANDLE
);
186 typedef NTSTATUS (NTAPI
*PLSA_MAP_BUFFER
)(PSecBuffer
, PSecBuffer
);
187 typedef NTSTATUS (NTAPI
*PLSA_CREATE_TOKEN
)(PLUID
, PTOKEN_SOURCE
,
188 SECURITY_LOGON_TYPE
, SECURITY_IMPERSONATION_LEVEL
, LSA_TOKEN_INFORMATION_TYPE
,
189 PVOID
, PTOKEN_GROUPS
, PUNICODE_STRING
, PUNICODE_STRING
, PUNICODE_STRING
,
190 PUNICODE_STRING
, PHANDLE
, PNTSTATUS
);
191 typedef VOID (NTAPI
*PLSA_AUDIT_LOGON
)(NTSTATUS
, NTSTATUS
, PUNICODE_STRING
,
192 PUNICODE_STRING
, PUNICODE_STRING
, OPTIONAL PSID
, SECURITY_LOGON_TYPE
,
193 PTOKEN_SOURCE
, PLUID
);
194 typedef NTSTATUS (NTAPI
*PLSA_CALL_PACKAGE
)(PUNICODE_STRING
, PVOID
, ULONG
,
195 PVOID
*, PULONG
, PNTSTATUS
);
196 typedef BOOLEAN (NTAPI
*PLSA_GET_CALL_INFO
)(PSECPKG_CALL_INFO
);
197 typedef NTSTATUS (NTAPI
*PLSA_CALL_PACKAGEEX
)(PUNICODE_STRING
, PVOID
, PVOID
,
198 ULONG
, PVOID
*, PULONG
, PNTSTATUS
);
199 typedef PVOID (NTAPI
*PLSA_CREATE_SHARED_MEMORY
)(ULONG
, ULONG
);
200 typedef PVOID (NTAPI
*PLSA_ALLOCATE_SHARED_MEMORY
)(PVOID
, ULONG
);
201 typedef VOID (NTAPI
*PLSA_FREE_SHARED_MEMORY
)(PVOID
, PVOID
);
202 typedef BOOLEAN (NTAPI
*PLSA_DELETE_SHARED_MEMORY
)(PVOID
);
203 typedef NTSTATUS (NTAPI
*PLSA_OPEN_SAM_USER
)(PUNICODE_STRING
, SECPKG_NAME_TYPE
,
204 PUNICODE_STRING
, BOOLEAN
, ULONG
, PVOID
*);
205 typedef NTSTATUS (NTAPI
*PLSA_GET_USER_CREDENTIALS
)(PVOID
, PVOID
*, PULONG
,
207 typedef NTSTATUS (NTAPI
*PLSA_GET_USER_AUTH_DATA
)(PVOID
, PUCHAR
*, PULONG
);
208 typedef NTSTATUS (NTAPI
*PLSA_CLOSE_SAM_USER
)(PVOID
);
209 typedef NTSTATUS (NTAPI
*PLSA_CONVERT_AUTH_DATA_TO_TOKEN
)(PVOID
, ULONG
,
210 SECURITY_IMPERSONATION_LEVEL
, PTOKEN_SOURCE
, SECURITY_LOGON_TYPE
,
211 PUNICODE_STRING
, PHANDLE
, PLUID
, PUNICODE_STRING
, PNTSTATUS
);
212 typedef NTSTATUS (NTAPI
*PLSA_CLIENT_CALLBACK
)(PCHAR
, ULONG_PTR
, ULONG_PTR
,
213 PSecBuffer
, PSecBuffer
);
214 typedef NTSTATUS (NTAPI
*PLSA_UPDATE_PRIMARY_CREDENTIALS
)(PSECPKG_PRIMARY_CRED
, PSECPKG_SUPPLEMENTAL_CRED_ARRAY
);
215 typedef NTSTATUS (NTAPI
*PLSA_GET_AUTH_DATA_FOR_USER
)(PUNICODE_STRING
,
216 SECPKG_NAME_TYPE
, PUNICODE_STRING
, PUCHAR
*, PULONG
, PUNICODE_STRING
);
217 typedef NTSTATUS (NTAPI
*PLSA_CRACK_SINGLE_NAME
)(ULONG
, BOOLEAN
,
218 PUNICODE_STRING
, PUNICODE_STRING
, ULONG
, PUNICODE_STRING
, PUNICODE_STRING
,
220 typedef NTSTATUS (NTAPI
*PLSA_AUDIT_ACCOUNT_LOGON
)(ULONG
, BOOLEAN
,
221 PUNICODE_STRING
, PUNICODE_STRING
, PUNICODE_STRING
, NTSTATUS
);
222 typedef NTSTATUS (NTAPI
*PLSA_CALL_PACKAGE_PASSTHROUGH
)(PUNICODE_STRING
, PVOID
,
223 PVOID
, ULONG
, PVOID
*, PULONG
, PNTSTATUS
);
225 /* Dispatch tables of functions used by SSP/AP */
226 typedef struct SECPKG_DLL_FUNCTIONS
{
227 PLSA_ALLOCATE_LSA_HEAP AllocateHeap
;
228 PLSA_FREE_LSA_HEAP FreeHeap
;
229 PLSA_REGISTER_CALLBACK RegisterCallback
;
230 } SECPKG_DLL_FUNCTIONS
,
231 *PSECPKG_DLL_FUNCTIONS
;
233 typedef struct LSA_DISPATCH_TABLE
{
234 PLSA_CREATE_LOGON_SESSION CreateLogonSession
;
235 PLSA_DELETE_LOGON_SESSION DeleteLogonSession
;
236 PLSA_ADD_CREDENTIAL AddCredential
;
237 PLSA_GET_CREDENTIALS GetCredentials
;
238 PLSA_DELETE_CREDENTIAL DeleteCredential
;
239 PLSA_ALLOCATE_LSA_HEAP AllocateLsaHeap
;
240 PLSA_FREE_LSA_HEAP FreeLsaHeap
;
241 PLSA_ALLOCATE_CLIENT_BUFFER AllocateClientBuffer
;
242 PLSA_FREE_CLIENT_BUFFER FreeClientBuffer
;
243 PLSA_COPY_TO_CLIENT_BUFFER CopyToClientBuffer
;
244 PLSA_COPY_FROM_CLIENT_BUFFER CopyFromClientBuffer
;
245 } LSA_DISPATCH_TABLE
,
246 *PLSA_DISPATCH_TABLE
;
248 typedef struct _LSA_SECPKG_FUNCTION_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 PLSA_IMPERSONATE_CLIENT ImpersonateClient
;
261 PLSA_UNLOAD_PACKAGE UnloadPackage
;
262 PLSA_DUPLICATE_HANDLE DuplicateHandle
;
263 PLSA_SAVE_SUPPLEMENTAL_CREDENTIALS SaveSupplementalCredentials
;
264 PLSA_CREATE_THREAD CreateThread
;
265 PLSA_GET_CLIENT_INFO GetClientInfo
;
266 PLSA_REGISTER_NOTIFICATION RegisterNotification
;
267 PLSA_CANCEL_NOTIFICATION CancelNotification
;
268 PLSA_MAP_BUFFER MapBuffer
;
269 PLSA_CREATE_TOKEN CreateToken
;
270 PLSA_AUDIT_LOGON AuditLogon
;
271 PLSA_CALL_PACKAGE CallPackage
;
272 PLSA_FREE_LSA_HEAP FreeReturnBuffer
;
273 PLSA_GET_CALL_INFO GetCallInfo
;
274 PLSA_CALL_PACKAGEEX CallPackageEx
;
275 PLSA_CREATE_SHARED_MEMORY CreateSharedMemory
;
276 PLSA_ALLOCATE_SHARED_MEMORY AllocateSharedMemory
;
277 PLSA_FREE_SHARED_MEMORY FreeSharedMemory
;
278 PLSA_DELETE_SHARED_MEMORY DeleteSharedMemory
;
279 PLSA_OPEN_SAM_USER OpenSamUser
;
280 PLSA_GET_USER_CREDENTIALS GetUserCredentials
;
281 PLSA_GET_USER_AUTH_DATA GetUserAuthData
;
282 PLSA_CLOSE_SAM_USER CloseSamUser
;
283 PLSA_CONVERT_AUTH_DATA_TO_TOKEN ConvertAuthDataToToken
;
284 PLSA_CLIENT_CALLBACK ClientCallback
;
285 PLSA_UPDATE_PRIMARY_CREDENTIALS UpdateCredentials
;
286 PLSA_GET_AUTH_DATA_FOR_USER GetAuthDataForUser
;
287 PLSA_CRACK_SINGLE_NAME CrackSingleName
;
288 PLSA_AUDIT_ACCOUNT_LOGON AuditAccountLogon
;
289 PLSA_CALL_PACKAGE_PASSTHROUGH CallPackagePassthrough
;
290 } LSA_SECPKG_FUNCTION_TABLE
,
291 *PLSA_SECPKG_FUNCTION_TABLE
;
293 /* LSA-mode functions implemented by SSP/AP obtainable by a dispatch table */
294 typedef NTSTATUS (NTAPI
*PLSA_AP_INITIALIZE_PACKAGE
)(ULONG
, PLSA_DISPATCH_TABLE
,
295 PLSA_STRING
, PLSA_STRING
, PLSA_STRING
*);
296 typedef NTSTATUS (NTAPI
*PLSA_AP_LOGON_USER
)(LPWSTR
, LPWSTR
, LPWSTR
, LPWSTR
,
297 DWORD
, DWORD
, PHANDLE
);
298 typedef NTSTATUS (NTAPI
*PLSA_AP_CALL_PACKAGE
)(PUNICODE_STRING
, PVOID
, ULONG
,
299 PVOID
*, PULONG
, PNTSTATUS
);
300 typedef VOID (NTAPI
*PLSA_AP_LOGON_TERMINATED
)(PLUID
);
301 typedef NTSTATUS (NTAPI
*PLSA_AP_CALL_PACKAGE_UNTRUSTED
)(PLSA_CLIENT_REQUEST
,
302 PVOID
, PVOID
, ULONG
, PVOID
*, PULONG
, PNTSTATUS
);
303 typedef NTSTATUS (NTAPI
*PLSA_AP_CALL_PACKAGE_PASSTHROUGH
)(PUNICODE_STRING
,
304 PVOID
, PVOID
, ULONG
, PVOID
*, PULONG
, PNTSTATUS
);
305 typedef NTSTATUS (NTAPI
*PLSA_AP_LOGON_USER_EX
)(PLSA_CLIENT_REQUEST
,
306 SECURITY_LOGON_TYPE
, PVOID
, PVOID
, ULONG
, PVOID
*, PULONG
, PLUID
, PNTSTATUS
,
307 PLSA_TOKEN_INFORMATION_TYPE
, PVOID
*, PUNICODE_STRING
*, PUNICODE_STRING
*,
309 typedef NTSTATUS (NTAPI
*PLSA_AP_LOGON_USER_EX2
)(PLSA_CLIENT_REQUEST
,
310 SECURITY_LOGON_TYPE
, PVOID
, PVOID
, ULONG
, PVOID
*, PULONG
, PLUID
, PNTSTATUS
,
311 PLSA_TOKEN_INFORMATION_TYPE
, PVOID
*, PUNICODE_STRING
*, PUNICODE_STRING
*,
312 PUNICODE_STRING
*, PSECPKG_PRIMARY_CRED
, PSECPKG_SUPPLEMENTAL_CRED_ARRAY
*);
313 typedef NTSTATUS (SpInitializeFn
)(ULONG_PTR
, PSECPKG_PARAMETERS
,
314 PLSA_SECPKG_FUNCTION_TABLE
);
315 typedef NTSTATUS (NTAPI SpShutDownFn
)(void);
316 typedef NTSTATUS (NTAPI SpGetInfoFn
)(PSecPkgInfoW
);
317 typedef NTSTATUS (NTAPI SpAcceptCredentialsFn
)(SECURITY_LOGON_TYPE
,
318 PUNICODE_STRING
, PSECPKG_PRIMARY_CRED
, PSECPKG_SUPPLEMENTAL_CRED
);
319 typedef NTSTATUS (NTAPI SpAcquireCredentialsHandleFn
)(PUNICODE_STRING
, ULONG
,
320 PLUID
, PVOID
, PVOID
, PVOID
, PLSA_SEC_HANDLE
, PTimeStamp
);
321 typedef NTSTATUS (NTAPI SpQueryCredentialsAttributesFn
)(LSA_SEC_HANDLE
, ULONG
,
323 typedef NTSTATUS (NTAPI SpFreeCredentialsHandleFn
)(LSA_SEC_HANDLE
);
324 typedef NTSTATUS (NTAPI SpSaveCredentialsFn
)(LSA_SEC_HANDLE
, PSecBuffer
);
325 typedef NTSTATUS (NTAPI SpGetCredentialsFn
)(LSA_SEC_HANDLE
, PSecBuffer
);
326 typedef NTSTATUS (NTAPI SpDeleteCredentialsFn
)(LSA_SEC_HANDLE
, PSecBuffer
);
327 typedef NTSTATUS (NTAPI SpInitLsaModeContextFn
)(LSA_SEC_HANDLE
, LSA_SEC_HANDLE
,
328 PUNICODE_STRING
, ULONG
, ULONG
, PSecBufferDesc
, PLSA_SEC_HANDLE
, PSecBufferDesc
,
329 PULONG
, PTimeStamp
, PBOOLEAN
, PSecBuffer
);
330 typedef NTSTATUS (NTAPI SpAcceptLsaModeContextFn
)(LSA_SEC_HANDLE
,
331 LSA_SEC_HANDLE
, PSecBufferDesc
, ULONG
, ULONG
, PLSA_SEC_HANDLE
, PSecBufferDesc
,
332 PULONG
, PTimeStamp
, PBOOLEAN
, PSecBuffer
);
333 typedef NTSTATUS (NTAPI SpDeleteContextFn
)(LSA_SEC_HANDLE
);
334 typedef NTSTATUS (NTAPI SpApplyControlTokenFn
)(LSA_SEC_HANDLE
, PSecBufferDesc
);
335 typedef NTSTATUS (NTAPI SpGetUserInfoFn
)(PLUID
, ULONG
, PSecurityUserData
*);
336 typedef NTSTATUS (NTAPI SpGetExtendedInformationFn
)(
337 SECPKG_EXTENDED_INFORMATION_CLASS
, PSECPKG_EXTENDED_INFORMATION
*);
338 typedef NTSTATUS (NTAPI SpQueryContextAttributesFn
)(LSA_SEC_HANDLE
, ULONG
,
340 typedef NTSTATUS (NTAPI SpAddCredentialsFn
)(LSA_SEC_HANDLE
, PUNICODE_STRING
,
341 PUNICODE_STRING
, ULONG
, PVOID
, PVOID
, PVOID
, PTimeStamp
);
342 typedef NTSTATUS (NTAPI SpSetExtendedInformationFn
)(
343 SECPKG_EXTENDED_INFORMATION_CLASS
, PSECPKG_EXTENDED_INFORMATION
);
344 typedef NTSTATUS (NTAPI SpSetContextAttributesFn
)(LSA_SEC_HANDLE
, ULONG
, PVOID
,
346 typedef NTSTATUS (NTAPI SpSetCredentialsAttributesFn
)(LSA_SEC_HANDLE
, ULONG
,
349 /* User-mode functions implemented by SSP/AP obtainable by a dispatch table */
350 typedef NTSTATUS (NTAPI SpInstanceInitFn
)(ULONG
, PSECPKG_DLL_FUNCTIONS
,
352 typedef NTSTATUS (NTAPI SpInitUserModeContextFn
)(LSA_SEC_HANDLE
, PSecBuffer
);
353 typedef NTSTATUS (NTAPI SpMakeSignatureFn
)(LSA_SEC_HANDLE
, ULONG
,
354 PSecBufferDesc
, ULONG
);
355 typedef NTSTATUS (NTAPI SpVerifySignatureFn
)(LSA_SEC_HANDLE
, PSecBufferDesc
,
357 typedef NTSTATUS (NTAPI SpSealMessageFn
)(LSA_SEC_HANDLE
, ULONG
, PSecBufferDesc
,
359 typedef NTSTATUS (NTAPI SpUnsealMessageFn
)(LSA_SEC_HANDLE
, PSecBufferDesc
,
361 typedef NTSTATUS (NTAPI SpGetContextTokenFn
)(LSA_SEC_HANDLE
, PHANDLE
);
362 typedef NTSTATUS (NTAPI SpCompleteAuthTokenFn
)(LSA_SEC_HANDLE
, PSecBufferDesc
);
363 typedef NTSTATUS (NTAPI SpFormatCredentialsFn
)(PSecBuffer
, PSecBuffer
);
364 typedef NTSTATUS (NTAPI SpMarshallSupplementalCredsFn
)(ULONG
, PUCHAR
, PULONG
,
366 typedef NTSTATUS (NTAPI SpExportSecurityContextFn
)(LSA_SEC_HANDLE
, ULONG
,
367 PSecBuffer
, PHANDLE
);
368 typedef NTSTATUS (NTAPI SpImportSecurityContextFn
)(PSecBuffer
, HANDLE
,
371 /* dispatch tables of LSA-mode functions implemented by SSP/AP */
372 typedef struct SECPKG_FUNCTION_TABLE
{
373 PLSA_AP_INITIALIZE_PACKAGE InitializePackage
;
374 PLSA_AP_LOGON_USER LsaLogonUser
;
375 PLSA_AP_CALL_PACKAGE CallPackage
;
376 PLSA_AP_LOGON_TERMINATED LogonTerminated
;
377 PLSA_AP_CALL_PACKAGE_UNTRUSTED CallPackageUntrusted
;
378 PLSA_AP_CALL_PACKAGE_PASSTHROUGH CallPackagePassthrough
;
379 PLSA_AP_LOGON_USER_EX LogonUserEx
;
380 PLSA_AP_LOGON_USER_EX2 LogonUserEx2
;
381 SpInitializeFn
*Initialize
;
382 SpShutDownFn
*Shutdown
;
383 SpGetInfoFn
*GetInfo
;
384 SpAcceptCredentialsFn
*AcceptCredentials
;
385 SpAcquireCredentialsHandleFn
*SpAcquireCredentialsHandle
;
386 SpQueryCredentialsAttributesFn
*SpQueryCredentialsAttributes
;
387 SpFreeCredentialsHandleFn
*FreeCredentialsHandle
;
388 SpSaveCredentialsFn
*SaveCredentials
;
389 SpGetCredentialsFn
*GetCredentials
;
390 SpDeleteCredentialsFn
*DeleteCredentials
;
391 SpInitLsaModeContextFn
*InitLsaModeContext
;
392 SpAcceptLsaModeContextFn
*AcceptLsaModeContext
;
393 SpDeleteContextFn
*DeleteContext
;
394 SpApplyControlTokenFn
*ApplyControlToken
;
395 SpGetUserInfoFn
*GetUserInfo
;
396 SpGetExtendedInformationFn
*GetExtendedInformation
;
397 SpQueryContextAttributesFn
*SpQueryContextAttributes
;
398 SpAddCredentialsFn
*SpAddCredentials
;
399 SpSetExtendedInformationFn
*SetExtendedInformation
;
400 /* Packages with version SECPKG_INTERFACE_VERSION end here */
401 SpSetContextAttributesFn
*SpSetContextAttributes
;
402 /* Packages with version SECPKG_INTERFACE_VERSION_2 end here */
403 SpSetCredentialsAttributesFn
*SetCredentialsAttributes
;
404 /* Packages with version SECPKG_INTERFACE_VERSION_3 end here */
405 } SECPKG_FUNCTION_TABLE
,
406 *PSECPKG_FUNCTION_TABLE
;
408 /* Helper macros to find the size of SECPKG_FUNCTION_TABLE */
409 #define SECPKG_FUNCTION_TABLE_SIZE_1 offsetof(SECPKG_FUNCTION_TABLE, \
410 SpSetContextAttributes)
411 #define SECPKG_FUNCTION_TABLE_SIZE_2 offsetof(SECPKG_FUNCTION_TABLE, \
412 SetCredentialsAttributes)
413 #define SECPKG_FUNCTION_TABLE_SIZE_3 sizeof(SECPKG_FUNCTION_TABLE)
415 /* dispatch tables of user-mode functions implemented by SSP/AP */
416 typedef struct SECPKG_USER_FUNCTION_TABLE
{
417 SpInstanceInitFn
*InstanceInit
;
418 SpInitUserModeContextFn
*InitUserModeContext
;
419 SpMakeSignatureFn
*MakeSignature
;
420 SpVerifySignatureFn
*VerifySignature
;
421 SpSealMessageFn
*SealMessage
;
422 SpUnsealMessageFn
*UnsealMessage
;
423 SpGetContextTokenFn
*GetContextToken
;
424 SpQueryContextAttributesFn
*SpQueryContextAttributes
;
425 SpCompleteAuthTokenFn
*CompleteAuthToken
;
426 SpDeleteContextFn
*DeleteUserModeContext
;
427 SpFormatCredentialsFn
*FormatCredentials
;
428 SpMarshallSupplementalCredsFn
*MarshallSupplementalCreds
;
429 SpExportSecurityContextFn
*ExportContext
;
430 SpImportSecurityContextFn
*ImportContext
;
431 } SECPKG_USER_FUNCTION_TABLE
,
432 *PSECPKG_USER_FUNCTION_TABLE
;
434 /* LSA-mode entry point to SSP/APs */
435 typedef NTSTATUS (NTAPI
*SpLsaModeInitializeFn
)(ULONG
, PULONG
,
436 PSECPKG_FUNCTION_TABLE
*, PULONG
);
438 /* User-mode entry point to SSP/APs */
439 typedef NTSTATUS (WINAPI
*SpUserModeInitializeFn
)(ULONG
, PULONG
,
440 PSECPKG_USER_FUNCTION_TABLE
*, PULONG
);
445 #endif /* _NTSECPKG_H */