1 /***********************************************************************\ 2 * ntsecpkg.d * 3 * * 4 * Windows API header module * 5 * * 6 * Translated from MinGW Windows headers * 7 * by Ellery Newcomer * 8 * * 9 * Placed into public domain * 10 \***********************************************************************/ 11 module win32.ntsecpkg; 12 version(Windows): 13 14 import win32.windef, win32.ntsecapi, win32.security, win32.ntdef, win32.sspi; 15 import win32.winnt: GUID; 16 import win32.winbase; 17 18 extern(Windows): 19 20 enum :ULONG{ 21 ISC_REQ_DELEGATE = 1, 22 ISC_REQ_MUTUAL_AUTH = 2, 23 ISC_REQ_REPLAY_DETECT = 4, 24 ISC_REQ_SEQUENCE_DETECT = 8, 25 ISC_REQ_CONFIDENTIALITY = 16, 26 ISC_REQ_USE_SESSION_KEY = 32, 27 ISC_REQ_PROMPT_FOR_CREDS = 64, 28 ISC_REQ_USE_SUPPLIED_CREDS = 128, 29 ISC_REQ_ALLOCATE_MEMORY = 256, 30 ISC_REQ_USE_DCE_STYLE = 512, 31 ISC_REQ_DATAGRAM = 1024, 32 ISC_REQ_CONNECTION = 2048, 33 ISC_REQ_EXTENDED_ERROR = 16384, 34 ISC_REQ_STREAM = 32768, 35 ISC_REQ_INTEGRITY = 65536, 36 ISC_REQ_MANUAL_CRED_VALIDATION = 524288, 37 ISC_REQ_HTTP = 268435456, 38 } 39 40 enum ISC_RET_EXTENDED_ERROR = 16384; 41 42 enum :ULONG{ 43 ASC_REQ_DELEGATE = 1, 44 ASC_REQ_MUTUAL_AUTH = 2, 45 ASC_REQ_REPLAY_DETECT = 4, 46 ASC_REQ_SEQUENCE_DETECT = 8, 47 ASC_REQ_CONFIDENTIALITY = 16, 48 ASC_REQ_USE_SESSION_KEY = 32, 49 ASC_REQ_ALLOCATE_MEMORY = 256, 50 ASC_REQ_USE_DCE_STYLE = 512, 51 ASC_REQ_DATAGRAM = 1024, 52 ASC_REQ_CONNECTION = 2048, 53 ASC_REQ_EXTENDED_ERROR = 32768, 54 ASC_REQ_STREAM = 65536, 55 ASC_REQ_INTEGRITY = 131072, 56 } 57 58 enum SECURITY_NATIVE_DREP = 16; 59 enum SECURITY_NETWORK_DREP = 0; 60 61 enum :ULONG{ 62 SECPKG_STATE_ENCRYPTION_PERMITTED = 0x01, 63 SECPKG_STATE_STRONG_ENCRYPTION_PERMITTED = 0x02, 64 SECPKG_STATE_DOMAIN_CONTROLLER = 0x04, 65 SECPKG_STATE_WORKSTATION = 0x08, 66 SECPKG_STATE_STANDALONE = 0x10, 67 } 68 69 /* enum definitions for Secure Service Provider/Authentication Packages */ 70 enum LSA_TOKEN_INFORMATION_TYPE { 71 LsaTokenInformationNull, 72 LsaTokenInformationV1 73 } 74 alias LSA_TOKEN_INFORMATION_TYPE* PLSA_TOKEN_INFORMATION_TYPE; 75 enum SECPKG_EXTENDED_INFORMATION_CLASS 76 { 77 SecpkgGssInfo = 1, 78 SecpkgContextThunks, 79 SecpkgMutualAuthLevel, 80 SecpkgMaxInfo 81 } 82 enum SECPKG_NAME_TYPE { 83 SecNameSamCompatible, 84 SecNameAlternateId, 85 SecNameFlat, 86 SecNameDN 87 } 88 89 /* struct definitions for SSP/AP */ 90 struct SECPKG_PRIMARY_CRED { 91 LUID LogonId; 92 UNICODE_STRING DownlevelName; 93 UNICODE_STRING DomainName; 94 UNICODE_STRING Password; 95 UNICODE_STRING OldPassword; 96 PSID UserSid; 97 ULONG Flags; 98 UNICODE_STRING DnsDomainName; 99 UNICODE_STRING Upn; 100 UNICODE_STRING LogonServer; 101 UNICODE_STRING Spare1; 102 UNICODE_STRING Spare2; 103 UNICODE_STRING Spare3; 104 UNICODE_STRING Spare4; 105 } 106 alias SECPKG_PRIMARY_CRED* PSECPKG_PRIMARY_CRED; 107 struct SECPKG_SUPPLEMENTAL_CRED { 108 UNICODE_STRING PackageName; 109 ULONG CredentialSize; 110 PUCHAR Credentials; 111 } 112 alias SECPKG_SUPPLEMENTAL_CRED* PSECPKG_SUPPLEMENTAL_CRED; 113 struct SECPKG_SUPPLEMENTAL_CRED_ARRAY { 114 ULONG CredentialCount; 115 SECPKG_SUPPLEMENTAL_CRED[1] Credentials; 116 } 117 alias SECPKG_SUPPLEMENTAL_CRED_ARRAY* PSECPKG_SUPPLEMENTAL_CRED_ARRAY; 118 struct SECPKG_PARAMETERS { 119 ULONG Version; 120 ULONG MachineState; 121 ULONG SetupMode; 122 PSID DomainSid; 123 UNICODE_STRING DomainName; 124 UNICODE_STRING DnsDomainName; 125 GUID DomainGuid; 126 } 127 alias SECPKG_PARAMETERS* PSECPKG_PARAMETERS,PSECPKG_EVENT_DOMAIN_CHANGE; 128 alias SECPKG_PARAMETERS SECPKG_EVENT_DOMAIN_CHANGE; 129 struct SECPKG_CLIENT_INFO { 130 LUID LogonId; 131 ULONG ProcessID; 132 ULONG ThreadID; 133 BOOLEAN HasTcbPrivilege; 134 BOOLEAN Impersonating; 135 BOOLEAN Restricted; 136 } 137 alias SECPKG_CLIENT_INFO* PSECPKG_CLIENT_INFO; 138 struct SECURITY_USER_DATA { 139 SECURITY_STRING UserName; 140 SECURITY_STRING LogonDomainName; 141 SECURITY_STRING LogonServer; 142 PSID pSid; 143 } 144 alias SECURITY_USER_DATA* PSECURITY_USER_DATA,PSecurityUserData; 145 alias SECURITY_USER_DATA SecurityUserData; 146 struct SECPKG_GSS_INFO { 147 ULONG EncodedIdLength; 148 UCHAR[4] EncodedId; 149 } 150 alias SECPKG_GSS_INFO* PSECPKG_GSS_INFO; 151 struct SECPKG_CONTEXT_THUNKS { 152 ULONG InfoLevelCount; 153 ULONG[1] Levels; 154 } 155 alias SECPKG_CONTEXT_THUNKS* PSECPKG_CONTEXT_THUNKS; 156 struct SECPKG_MUTUAL_AUTH_LEVEL { 157 ULONG MutualAuthLevel; 158 } 159 alias SECPKG_MUTUAL_AUTH_LEVEL* PSECPKG_MUTUAL_AUTH_LEVEL; 160 struct SECPKG_CALL_INFO { 161 ULONG ProcessId; 162 ULONG ThreadId; 163 ULONG Attributes; 164 ULONG CallCount; 165 } 166 alias SECPKG_CALL_INFO* PSECPKG_CALL_INFO; 167 struct SECPKG_EXTENDED_INFORMATION { 168 SECPKG_EXTENDED_INFORMATION_CLASS Class; 169 union _Info{ 170 SECPKG_GSS_INFO GssInfo; 171 SECPKG_CONTEXT_THUNKS ContextThunks; 172 SECPKG_MUTUAL_AUTH_LEVEL MutualAuthLevel; 173 } 174 _Info Info; 175 } 176 alias SECPKG_EXTENDED_INFORMATION* PSECPKG_EXTENDED_INFORMATION; 177 178 /* callbacks implemented by SSP/AP dlls and called by the LSA */ 179 alias void function(ULONG_PTR, ULONG_PTR, PSecBuffer, 180 PSecBuffer) PLSA_CALLBACK_FUNCTION; 181 182 /* misc typedefs used in the below prototypes */ 183 alias PVOID* PLSA_CLIENT_REQUEST; 184 alias ULONG LSA_SEC_HANDLE; 185 alias ULONG* PLSA_SEC_HANDLE; 186 alias LPTHREAD_START_ROUTINE SEC_THREAD_START; 187 alias PSECURITY_ATTRIBUTES SEC_ATTRS; 188 189 /* functions used by SSP/AP obtainable by dispatch tables */ 190 alias NTSTATUS function(ULONG, PLSA_CALLBACK_FUNCTION) PLSA_REGISTER_CALLBACK; 191 alias NTSTATUS function(PLUID) PLSA_CREATE_LOGON_SESSION; 192 alias NTSTATUS function(PLUID) PLSA_DELETE_LOGON_SESSION; 193 alias NTSTATUS function(PLUID, ULONG, PLSA_STRING, 194 PLSA_STRING) PLSA_ADD_CREDENTIAL; 195 alias NTSTATUS function(PLUID, ULONG, PULONG, BOOLEAN, 196 PLSA_STRING, PULONG, PLSA_STRING) PLSA_GET_CREDENTIALS; 197 alias NTSTATUS function(PLUID, ULONG, PLSA_STRING) PLSA_DELETE_CREDENTIAL; 198 alias PVOID function(ULONG) PLSA_ALLOCATE_LSA_HEAP; 199 alias void function(PVOID) PLSA_FREE_LSA_HEAP; 200 alias NTSTATUS function(PLSA_CLIENT_REQUEST, 201 ULONG, PVOID*) PLSA_ALLOCATE_CLIENT_BUFFER; 202 alias NTSTATUS function(PLSA_CLIENT_REQUEST, PVOID) PLSA_FREE_CLIENT_BUFFER; 203 alias NTSTATUS function(PLSA_CLIENT_REQUEST, ULONG, 204 PVOID, PVOID) PLSA_COPY_TO_CLIENT_BUFFER; 205 alias NTSTATUS function(PLSA_CLIENT_REQUEST, 206 ULONG, PVOID, PVOID) PLSA_COPY_FROM_CLIENT_BUFFER; 207 alias NTSTATUS function() PLSA_IMPERSONATE_CLIENT; 208 alias NTSTATUS function() PLSA_UNLOAD_PACKAGE; 209 alias NTSTATUS function(HANDLE, PHANDLE) PLSA_DUPLICATE_HANDLE; 210 alias NTSTATUS function(PLUID, ULONG, 211 PVOID, BOOLEAN) PLSA_SAVE_SUPPLEMENTAL_CREDENTIALS; 212 alias HANDLE function(SEC_ATTRS, ULONG, SEC_THREAD_START, 213 PVOID, ULONG, PULONG) PLSA_CREATE_THREAD; 214 alias NTSTATUS function(PSECPKG_CLIENT_INFO) PLSA_GET_CLIENT_INFO; 215 alias HANDLE function(SEC_THREAD_START, PVOID, 216 ULONG, ULONG, ULONG, ULONG, HANDLE) PLSA_REGISTER_NOTIFICATION; 217 alias NTSTATUS function(HANDLE) PLSA_CANCEL_NOTIFICATION; 218 alias NTSTATUS function(PSecBuffer, PSecBuffer) PLSA_MAP_BUFFER; 219 alias NTSTATUS function(PLUID, PTOKEN_SOURCE, 220 SECURITY_LOGON_TYPE, SECURITY_IMPERSONATION_LEVEL, LSA_TOKEN_INFORMATION_TYPE, 221 PVOID, PTOKEN_GROUPS, PUNICODE_STRING, PUNICODE_STRING, PUNICODE_STRING, 222 PUNICODE_STRING, PHANDLE, PNTSTATUS) PLSA_CREATE_TOKEN; 223 alias void function(NTSTATUS, NTSTATUS, PUNICODE_STRING, 224 PUNICODE_STRING, PUNICODE_STRING, PSID, SECURITY_LOGON_TYPE, 225 PTOKEN_SOURCE, PLUID) PLSA_AUDIT_LOGON; 226 alias NTSTATUS function(PUNICODE_STRING, PVOID, ULONG, 227 PVOID*, PULONG, PNTSTATUS) PLSA_CALL_PACKAGE; 228 alias BOOLEAN function(PSECPKG_CALL_INFO) PLSA_GET_CALL_INFO; 229 alias NTSTATUS function(PUNICODE_STRING, PVOID, PVOID, 230 ULONG, PVOID*, PULONG, PNTSTATUS) PLSA_CALL_PACKAGEEX; 231 alias PVOID function(ULONG, ULONG) PLSA_CREATE_SHARED_MEMORY; 232 alias PVOID function(PVOID, ULONG) PLSA_ALLOCATE_SHARED_MEMORY; 233 alias void function(PVOID, PVOID) PLSA_FREE_SHARED_MEMORY; 234 alias BOOLEAN function(PVOID) PLSA_DELETE_SHARED_MEMORY; 235 alias NTSTATUS function(PSECURITY_STRING, SECPKG_NAME_TYPE, 236 PSECURITY_STRING, BOOLEAN, ULONG, PVOID*) PLSA_OPEN_SAM_USER; 237 alias NTSTATUS function(PVOID, PVOID *, PULONG, 238 PVOID *, PULONG) PLSA_GET_USER_CREDENTIALS; 239 alias NTSTATUS function(PVOID, PUCHAR *, PULONG) PLSA_GET_USER_AUTH_DATA; 240 alias NTSTATUS function(PVOID) PLSA_CLOSE_SAM_USER; 241 alias NTSTATUS function(PVOID, ULONG, 242 SECURITY_IMPERSONATION_LEVEL, PTOKEN_SOURCE, SECURITY_LOGON_TYPE, 243 PUNICODE_STRING, PHANDLE, PLUID, PUNICODE_STRING, PNTSTATUS) PLSA_CONVERT_AUTH_DATA_TO_TOKEN; 244 alias NTSTATUS function(PCHAR, ULONG_PTR, ULONG_PTR, 245 PSecBuffer, PSecBuffer) PLSA_CLIENT_CALLBACK; 246 alias NTSTATUS function(PSECPKG_PRIMARY_CRED, PSECPKG_SUPPLEMENTAL_CRED_ARRAY) PLSA_UPDATE_PRIMARY_CREDENTIALS; 247 alias NTSTATUS function(PSECURITY_STRING, 248 SECPKG_NAME_TYPE, PSECURITY_STRING, PUCHAR *, PULONG, PUNICODE_STRING) PLSA_GET_AUTH_DATA_FOR_USER; 249 alias NTSTATUS function(ULONG, BOOLEAN, 250 PUNICODE_STRING, PUNICODE_STRING, ULONG, PUNICODE_STRING, PUNICODE_STRING, 251 PULONG) PLSA_CRACK_SINGLE_NAME; 252 alias NTSTATUS function(ULONG, BOOLEAN, 253 PUNICODE_STRING, PUNICODE_STRING, PUNICODE_STRING, NTSTATUS) PLSA_AUDIT_ACCOUNT_LOGON; 254 alias NTSTATUS function(PUNICODE_STRING, PVOID, 255 PVOID, ULONG, PVOID*, PULONG, PNTSTATUS) PLSA_CALL_PACKAGE_PASSTHROUGH; 256 257 /* Dispatch tables of functions used by SSP/AP */ 258 struct SECPKG_DLL_FUNCTIONS { 259 PLSA_ALLOCATE_LSA_HEAP AllocateHeap; 260 PLSA_FREE_LSA_HEAP FreeHeap; 261 PLSA_REGISTER_CALLBACK RegisterCallback; 262 } 263 alias SECPKG_DLL_FUNCTIONS* PSECPKG_DLL_FUNCTIONS; 264 struct LSA_DISPATCH_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 } 277 alias LSA_DISPATCH_TABLE* PLSA_DISPATCH_TABLE; 278 struct LSA_SECPKG_FUNCTION_TABLE { 279 PLSA_CREATE_LOGON_SESSION CreateLogonSession; 280 PLSA_DELETE_LOGON_SESSION DeleteLogonSession; 281 PLSA_ADD_CREDENTIAL AddCredential; 282 PLSA_GET_CREDENTIALS GetCredentials; 283 PLSA_DELETE_CREDENTIAL DeleteCredential; 284 PLSA_ALLOCATE_LSA_HEAP AllocateLsaHeap; 285 PLSA_FREE_LSA_HEAP FreeLsaHeap; 286 PLSA_ALLOCATE_CLIENT_BUFFER AllocateClientBuffer; 287 PLSA_FREE_CLIENT_BUFFER FreeClientBuffer; 288 PLSA_COPY_TO_CLIENT_BUFFER CopyToClientBuffer; 289 PLSA_COPY_FROM_CLIENT_BUFFER CopyFromClientBuffer; 290 PLSA_IMPERSONATE_CLIENT ImpersonateClient; 291 PLSA_UNLOAD_PACKAGE UnloadPackage; 292 PLSA_DUPLICATE_HANDLE DuplicateHandle; 293 PLSA_SAVE_SUPPLEMENTAL_CREDENTIALS SaveSupplementalCredentials; 294 PLSA_CREATE_THREAD CreateThread; 295 PLSA_GET_CLIENT_INFO GetClientInfo; 296 PLSA_REGISTER_NOTIFICATION RegisterNotification; 297 PLSA_CANCEL_NOTIFICATION CancelNotification; 298 PLSA_MAP_BUFFER MapBuffer; 299 PLSA_CREATE_TOKEN CreateToken; 300 PLSA_AUDIT_LOGON AuditLogon; 301 PLSA_CALL_PACKAGE CallPackage; 302 PLSA_FREE_LSA_HEAP FreeReturnBuffer; 303 PLSA_GET_CALL_INFO GetCallInfo; 304 PLSA_CALL_PACKAGEEX CallPackageEx; 305 PLSA_CREATE_SHARED_MEMORY CreateSharedMemory; 306 PLSA_ALLOCATE_SHARED_MEMORY AllocateSharedMemory; 307 PLSA_FREE_SHARED_MEMORY FreeSharedMemory; 308 PLSA_DELETE_SHARED_MEMORY DeleteSharedMemory; 309 PLSA_OPEN_SAM_USER OpenSamUser; 310 PLSA_GET_USER_CREDENTIALS GetUserCredentials; 311 PLSA_GET_USER_AUTH_DATA GetUserAuthData; 312 PLSA_CLOSE_SAM_USER CloseSamUser; 313 PLSA_CONVERT_AUTH_DATA_TO_TOKEN ConvertAuthDataToToken; 314 PLSA_CLIENT_CALLBACK ClientCallback; 315 PLSA_UPDATE_PRIMARY_CREDENTIALS UpdateCredentials; 316 PLSA_GET_AUTH_DATA_FOR_USER GetAuthDataForUser; 317 PLSA_CRACK_SINGLE_NAME CrackSingleName; 318 PLSA_AUDIT_ACCOUNT_LOGON AuditAccountLogon; 319 PLSA_CALL_PACKAGE_PASSTHROUGH CallPackagePassthrough; 320 } 321 alias LSA_SECPKG_FUNCTION_TABLE* PLSA_SECPKG_FUNCTION_TABLE; 322 323 /* functions implemented by SSP/AP obtainable by dispatch tables */ 324 alias NTSTATUS function(ULONG, PLSA_DISPATCH_TABLE, 325 PLSA_STRING, PLSA_STRING, PLSA_STRING *) PLSA_AP_INITIALIZE_PACKAGE; 326 alias NTSTATUS function(LPWSTR, LPWSTR, LPWSTR, LPWSTR, 327 DWORD, DWORD, PHANDLE) PLSA_AP_LOGON_USER; 328 alias NTSTATUS function(PUNICODE_STRING, PVOID, ULONG, 329 PVOID *, PULONG, PNTSTATUS) PLSA_AP_CALL_PACKAGE; 330 alias void function(PLUID) PLSA_AP_LOGON_TERMINATED; 331 alias NTSTATUS function(PLSA_CLIENT_REQUEST, 332 PVOID, PVOID, ULONG, PVOID *, PULONG, PNTSTATUS) PLSA_AP_CALL_PACKAGE_UNTRUSTED; 333 alias NTSTATUS function(PUNICODE_STRING, 334 PVOID, PVOID, ULONG, PVOID *, PULONG, PNTSTATUS) PLSA_AP_CALL_PACKAGE_PASSTHROUGH; 335 alias NTSTATUS function(PLSA_CLIENT_REQUEST, 336 SECURITY_LOGON_TYPE, PVOID, PVOID, ULONG, PVOID *, PULONG, PLUID, PNTSTATUS, 337 PLSA_TOKEN_INFORMATION_TYPE, PVOID *, PUNICODE_STRING *, PUNICODE_STRING *, 338 PUNICODE_STRING *) PLSA_AP_LOGON_USER_EX; 339 alias NTSTATUS function(PLSA_CLIENT_REQUEST, 340 SECURITY_LOGON_TYPE, PVOID, PVOID, ULONG, PVOID *, PULONG, PLUID, PNTSTATUS, 341 PLSA_TOKEN_INFORMATION_TYPE, PVOID *, PUNICODE_STRING *, PUNICODE_STRING *, 342 PUNICODE_STRING *, PSECPKG_PRIMARY_CRED, PSECPKG_SUPPLEMENTAL_CRED_ARRAY *) PLSA_AP_LOGON_USER_EX2; 343 alias NTSTATUS function(ULONG_PTR, PSECPKG_PARAMETERS, 344 PLSA_SECPKG_FUNCTION_TABLE) SpInitializeFn; 345 alias NTSTATUS function() SpShutDownFn; 346 alias NTSTATUS function(PSecPkgInfoW) SpGetInfoFn; 347 alias NTSTATUS function(SECURITY_LOGON_TYPE, 348 PUNICODE_STRING, PSECPKG_PRIMARY_CRED, PSECPKG_SUPPLEMENTAL_CRED) SpAcceptCredentialsFn; 349 alias NTSTATUS function(PUNICODE_STRING, ULONG, 350 PLUID, PVOID, PVOID, PVOID, PLSA_SEC_HANDLE, PTimeStamp) SpAcquireCredentialsHandleFn; 351 alias NTSTATUS function(LSA_SEC_HANDLE, ULONG, PVOID) SpQueryCredentialsAttributesFn; 352 alias NTSTATUS function(LSA_SEC_HANDLE) SpFreeCredentialsHandleFn; 353 alias NTSTATUS function(LSA_SEC_HANDLE, PSecBuffer) SpSaveCredentialsFn; 354 alias NTSTATUS function(LSA_SEC_HANDLE, PSecBuffer) SpGetCredentialsFn; 355 alias NTSTATUS function(LSA_SEC_HANDLE, PSecBuffer) SpDeleteCredentialsFn; 356 alias NTSTATUS function(LSA_SEC_HANDLE, LSA_SEC_HANDLE, 357 PUNICODE_STRING, ULONG, ULONG, PSecBufferDesc, PLSA_SEC_HANDLE, PSecBufferDesc, 358 PULONG, PTimeStamp, PBOOLEAN, PSecBuffer) SpInitLsaModeContextFn; 359 alias NTSTATUS function(LSA_SEC_HANDLE, 360 LSA_SEC_HANDLE, PSecBufferDesc, ULONG, ULONG, PLSA_SEC_HANDLE, PSecBufferDesc, 361 PULONG, PTimeStamp, PBOOLEAN, PSecBuffer) SpAcceptLsaModeContextFn; 362 alias NTSTATUS function(LSA_SEC_HANDLE) SpDeleteContextFn; 363 alias NTSTATUS function(LSA_SEC_HANDLE, PSecBufferDesc) SpApplyControlTokenFn; 364 alias NTSTATUS function(PLUID, ULONG, PSecurityUserData *) SpGetUserInfoFn; 365 alias NTSTATUS function(SECPKG_EXTENDED_INFORMATION_CLASS, PSECPKG_EXTENDED_INFORMATION *) SpGetExtendedInformationFn; 366 alias NTSTATUS function(LSA_SEC_HANDLE, ULONG, PVOID) SpQueryContextAttributesFn; 367 alias NTSTATUS function(LSA_SEC_HANDLE, PUNICODE_STRING, 368 PUNICODE_STRING, ULONG, PVOID, PVOID, PVOID, PTimeStamp) SpAddCredentialsFn; 369 alias NTSTATUS function( 370 SECPKG_EXTENDED_INFORMATION_CLASS, PSECPKG_EXTENDED_INFORMATION) SpSetExtendedInformationFn; 371 alias NTSTATUS function(ULONG, PSECPKG_DLL_FUNCTIONS, 372 PVOID *) SpInstanceInitFn; 373 alias NTSTATUS function(LSA_SEC_HANDLE, PSecBuffer) SpInitUserModeContextFn; 374 alias NTSTATUS function(LSA_SEC_HANDLE, ULONG, 375 PSecBufferDesc, ULONG) SpMakeSignatureFn; 376 alias NTSTATUS function(LSA_SEC_HANDLE, PSecBufferDesc, 377 ULONG, PULONG) SpVerifySignatureFn; 378 alias NTSTATUS function(LSA_SEC_HANDLE, ULONG, PSecBufferDesc, 379 ULONG) SpSealMessageFn; 380 alias NTSTATUS function(LSA_SEC_HANDLE, PSecBufferDesc, 381 ULONG, PULONG) SpUnsealMessageFn; 382 alias NTSTATUS function(LSA_SEC_HANDLE, PHANDLE) SpGetContextTokenFn; 383 alias NTSTATUS function(LSA_SEC_HANDLE, PSecBufferDesc) SpCompleteAuthTokenFn; 384 alias NTSTATUS function(PSecBuffer, PSecBuffer) SpFormatCredentialsFn; 385 alias NTSTATUS function(ULONG, PUCHAR, PULONG, 386 PVOID *) SpMarshallSupplementalCredsFn; 387 alias NTSTATUS function(LSA_SEC_HANDLE, ULONG, 388 PSecBuffer, PHANDLE) SpExportSecurityContextFn; 389 alias NTSTATUS function(PSecBuffer, HANDLE, 390 PLSA_SEC_HANDLE) SpImportSecurityContextFn; 391 392 /* Dispatch tables of functions implemented by SSP/AP */ 393 struct SECPKG_FUNCTION_TABLE { 394 PLSA_AP_INITIALIZE_PACKAGE InitializePackage; 395 PLSA_AP_LOGON_USER LogonUser; 396 PLSA_AP_CALL_PACKAGE CallPackage; 397 PLSA_AP_LOGON_TERMINATED LogonTerminated; 398 PLSA_AP_CALL_PACKAGE_UNTRUSTED CallPackageUntrusted; 399 PLSA_AP_CALL_PACKAGE_PASSTHROUGH CallPackagePassthrough; 400 PLSA_AP_LOGON_USER_EX LogonUserEx; 401 PLSA_AP_LOGON_USER_EX2 LogonUserEx2; 402 SpInitializeFn *Initialize; 403 SpShutDownFn *Shutdown; 404 SpGetInfoFn *GetInfo; 405 SpAcceptCredentialsFn *AcceptCredentials; 406 SpAcquireCredentialsHandleFn *AcquireCredentialsHandle; 407 SpQueryCredentialsAttributesFn *QueryCredentialsAttributes; 408 SpFreeCredentialsHandleFn *FreeCredentialsHandle; 409 SpSaveCredentialsFn *SaveCredentials; 410 SpGetCredentialsFn *GetCredentials; 411 SpDeleteCredentialsFn *DeleteCredentials; 412 SpInitLsaModeContextFn *InitLsaModeContext; 413 SpAcceptLsaModeContextFn *AcceptLsaModeContext; 414 SpDeleteContextFn *DeleteContext; 415 SpApplyControlTokenFn *ApplyControlToken; 416 SpGetUserInfoFn *GetUserInfo; 417 SpGetExtendedInformationFn *GetExtendedInformation; 418 SpQueryContextAttributesFn *QueryContextAttributes; 419 SpAddCredentialsFn *AddCredentials; 420 SpSetExtendedInformationFn *SetExtendedInformation; 421 } 422 alias SECPKG_FUNCTION_TABLE* PSECPKG_FUNCTION_TABLE; 423 424 struct SECPKG_USER_FUNCTION_TABLE { 425 SpInstanceInitFn *InstanceInit; 426 SpInitUserModeContextFn *InitUserModeContext; 427 SpMakeSignatureFn *MakeSignature; 428 SpVerifySignatureFn *VerifySignature; 429 SpSealMessageFn *SealMessage; 430 SpUnsealMessageFn *UnsealMessage; 431 SpGetContextTokenFn *GetContextToken; 432 SpQueryContextAttributesFn *QueryContextAttributes; 433 SpCompleteAuthTokenFn *CompleteAuthToken; 434 SpDeleteContextFn *DeleteUserModeContext; 435 SpFormatCredentialsFn *FormatCredentials; 436 SpMarshallSupplementalCredsFn *MarshallSupplementalCreds; 437 SpExportSecurityContextFn *ExportContext; 438 SpImportSecurityContextFn *ImportContext; 439 } 440 alias SECPKG_USER_FUNCTION_TABLE* PSECPKG_USER_FUNCTION_TABLE; 441 442 /* Entry points to SSP/AP */ 443 alias NTSTATUS function(ULONG, PULONG, 444 PSECPKG_FUNCTION_TABLE *, PULONG) SpLsaModeInitializeFn; 445 alias NTSTATUS function(ULONG, PULONG, 446 PSECPKG_USER_FUNCTION_TABLE *, PULONG) SpUserModeInitializeFn; 447