JwaNtSecApi.pas
资源名称:win32api.zip [点击查看]
上传用户:davidchvip
上传日期:2009-07-28
资源大小:1749k
文件大小:146k
源码类别:
Windows编程
开发平台:
Delphi
- MSV1_0_DONT_TRY_GUEST_ACCOUNT = $10;
- {$EXTERNALSYM MSV1_0_DONT_TRY_GUEST_ACCOUNT}
- MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT = $20;
- {$EXTERNALSYM MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT}
- MSV1_0_RETURN_PASSWORD_EXPIRY = $40;
- {$EXTERNALSYM MSV1_0_RETURN_PASSWORD_EXPIRY}
- // this next flag says that CaseInsensitiveChallengeResponse
- // (aka LmResponse) contains a client challenge in the first 8 bytes
- MSV1_0_USE_CLIENT_CHALLENGE = $80;
- {$EXTERNALSYM MSV1_0_USE_CLIENT_CHALLENGE}
- MSV1_0_TRY_GUEST_ACCOUNT_ONLY = $100;
- {$EXTERNALSYM MSV1_0_TRY_GUEST_ACCOUNT_ONLY}
- MSV1_0_RETURN_PROFILE_PATH = $200;
- {$EXTERNALSYM MSV1_0_RETURN_PROFILE_PATH}
- MSV1_0_TRY_SPECIFIED_DOMAIN_ONLY = $400;
- {$EXTERNALSYM MSV1_0_TRY_SPECIFIED_DOMAIN_ONLY}
- MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT = $800;
- {$EXTERNALSYM MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT}
- MSV1_0_DISABLE_PERSONAL_FALLBACK = $00001000;
- {$EXTERNALSYM MSV1_0_DISABLE_PERSONAL_FALLBACK}
- MSV1_0_ALLOW_FORCE_GUEST = $00002000;
- {$EXTERNALSYM MSV1_0_ALLOW_FORCE_GUEST}
- MSV1_0_CLEARTEXT_PASSWORD_SUPPLIED = $00004000;
- {$EXTERNALSYM MSV1_0_CLEARTEXT_PASSWORD_SUPPLIED}
- MSV1_0_SUBAUTHENTICATION_DLL_EX = $00100000;
- {$EXTERNALSYM MSV1_0_SUBAUTHENTICATION_DLL_EX}
- //
- // The high order byte is a value indicating the SubAuthentication DLL.
- // Zero indicates no SubAuthentication DLL.
- //
- MSV1_0_SUBAUTHENTICATION_DLL = DWORD($FF000000);
- {$EXTERNALSYM MSV1_0_SUBAUTHENTICATION_DLL}
- MSV1_0_SUBAUTHENTICATION_DLL_SHIFT = 24;
- {$EXTERNALSYM MSV1_0_SUBAUTHENTICATION_DLL_SHIFT}
- MSV1_0_MNS_LOGON = $01000000;
- {$EXTERNALSYM MSV1_0_MNS_LOGON}
- //
- // This is the list of subauthentication dlls used in MS
- //
- MSV1_0_SUBAUTHENTICATION_DLL_RAS = 2;
- {$EXTERNALSYM MSV1_0_SUBAUTHENTICATION_DLL_RAS}
- MSV1_0_SUBAUTHENTICATION_DLL_IIS = 132;
- {$EXTERNALSYM MSV1_0_SUBAUTHENTICATION_DLL_IIS}
- type
- PMSV1_0_LM20_LOGON = ^MSV1_0_LM20_LOGON;
- {$EXTERNALSYM PMSV1_0_LM20_LOGON}
- _MSV1_0_LM20_LOGON = record
- MessageType: MSV1_0_LOGON_SUBMIT_TYPE;
- LogonDomainName: UNICODE_STRING;
- UserName: UNICODE_STRING;
- Workstation: UNICODE_STRING;
- ChallengeToClient: array [0..MSV1_0_CHALLENGE_LENGTH - 1] of UCHAR;
- CaseSensitiveChallengeResponse: STRING;
- CaseInsensitiveChallengeResponse: STRING;
- ParameterControl: ULONG;
- end;
- {$EXTERNALSYM _MSV1_0_LM20_LOGON}
- MSV1_0_LM20_LOGON = _MSV1_0_LM20_LOGON;
- {$EXTERNALSYM MSV1_0_LM20_LOGON}
- TMsv10Lm20Logon = MSV1_0_LM20_LOGON;
- PMsv10Lm20Logon = PMSV1_0_LM20_LOGON;
- //
- // NT 5.0 SubAuth dlls can use this struct
- //
- PMSV1_0_SUBAUTH_LOGON = ^MSV1_0_SUBAUTH_LOGON;
- {$EXTERNALSYM PMSV1_0_SUBAUTH_LOGON}
- _MSV1_0_SUBAUTH_LOGON = record
- MessageType: MSV1_0_LOGON_SUBMIT_TYPE;
- LogonDomainName: UNICODE_STRING;
- UserName: UNICODE_STRING;
- Workstation: UNICODE_STRING;
- ChallengeToClient: array [0..MSV1_0_CHALLENGE_LENGTH - 1] of UCHAR;
- AuthenticationInfo1: STRING;
- AuthenticationInfo2: STRING;
- ParameterControl: ULONG;
- SubAuthPackageId: ULONG;
- end;
- {$EXTERNALSYM _MSV1_0_SUBAUTH_LOGON}
- MSV1_0_SUBAUTH_LOGON = _MSV1_0_SUBAUTH_LOGON;
- {$EXTERNALSYM MSV1_0_SUBAUTH_LOGON}
- TMsv10SubauthLogon = MSV1_0_SUBAUTH_LOGON;
- PMsv10SubauthLogon = PMSV1_0_SUBAUTH_LOGON;
- //
- // Values for UserFlags.
- //
- const
- LOGON_GUEST = $01;
- {$EXTERNALSYM LOGON_GUEST}
- LOGON_NOENCRYPTION = $02;
- {$EXTERNALSYM LOGON_NOENCRYPTION}
- LOGON_CACHED_ACCOUNT = $04;
- {$EXTERNALSYM LOGON_CACHED_ACCOUNT}
- LOGON_USED_LM_PASSWORD = $08;
- {$EXTERNALSYM LOGON_USED_LM_PASSWORD}
- LOGON_EXTRA_SIDS = $20;
- {$EXTERNALSYM LOGON_EXTRA_SIDS}
- LOGON_SUBAUTH_SESSION_KEY = $40;
- {$EXTERNALSYM LOGON_SUBAUTH_SESSION_KEY}
- LOGON_SERVER_TRUST_ACCOUNT = $80;
- {$EXTERNALSYM LOGON_SERVER_TRUST_ACCOUNT}
- LOGON_NTLMV2_ENABLED = $100; // says DC understands NTLMv2
- {$EXTERNALSYM LOGON_NTLMV2_ENABLED}
- LOGON_RESOURCE_GROUPS = $200;
- {$EXTERNALSYM LOGON_RESOURCE_GROUPS}
- LOGON_PROFILE_PATH_RETURNED = $400;
- {$EXTERNALSYM LOGON_PROFILE_PATH_RETURNED}
- //
- // The high order byte is reserved for return by SubAuthentication DLLs.
- //
- MSV1_0_SUBAUTHENTICATION_FLAGS = DWORD($FF000000);
- {$EXTERNALSYM MSV1_0_SUBAUTHENTICATION_FLAGS}
- // Values returned by the MSV1_0_MNS_LOGON SubAuthentication DLL
- LOGON_GRACE_LOGON = $01000000;
- {$EXTERNALSYM LOGON_GRACE_LOGON}
- type
- PMSV1_0_LM20_LOGON_PROFILE = ^MSV1_0_LM20_LOGON_PROFILE;
- {$EXTERNALSYM PMSV1_0_LM20_LOGON_PROFILE}
- _MSV1_0_LM20_LOGON_PROFILE = record
- MessageType: MSV1_0_PROFILE_BUFFER_TYPE;
- KickOffTime: LARGE_INTEGER;
- LogoffTime: LARGE_INTEGER;
- UserFlags: ULONG;
- UserSessionKey: array [0..MSV1_0_USER_SESSION_KEY_LENGTH - 1] of UCHAR;
- LogonDomainName: UNICODE_STRING;
- LanmanSessionKey: array [0..MSV1_0_LANMAN_SESSION_KEY_LENGTH - 1] of UCHAR;
- LogonServer: UNICODE_STRING;
- UserParameters: UNICODE_STRING;
- end;
- {$EXTERNALSYM _MSV1_0_LM20_LOGON_PROFILE}
- MSV1_0_LM20_LOGON_PROFILE = _MSV1_0_LM20_LOGON_PROFILE;
- {$EXTERNALSYM MSV1_0_LM20_LOGON_PROFILE}
- TMsv10Lm20LogonProfile = MSV1_0_LM20_LOGON_PROFILE;
- PMsv10Lm20LogonProfile = PMSV1_0_LM20_LOGON_PROFILE;
- //
- // Supplemental credentials structure used for passing credentials into
- // MSV1_0 from other packages
- //
- const
- MSV1_0_OWF_PASSWORD_LENGTH = 16;
- {$EXTERNALSYM MSV1_0_OWF_PASSWORD_LENGTH}
- MSV1_0_CRED_LM_PRESENT = $1;
- {$EXTERNALSYM MSV1_0_CRED_LM_PRESENT}
- MSV1_0_CRED_NT_PRESENT = $2;
- {$EXTERNALSYM MSV1_0_CRED_NT_PRESENT}
- MSV1_0_CRED_VERSION = 0;
- {$EXTERNALSYM MSV1_0_CRED_VERSION}
- type
- PMSV1_0_SUPPLEMENTAL_CREDENTIAL = ^MSV1_0_SUPPLEMENTAL_CREDENTIAL;
- {$EXTERNALSYM PMSV1_0_SUPPLEMENTAL_CREDENTIAL}
- _MSV1_0_SUPPLEMENTAL_CREDENTIAL = record
- Version: ULONG;
- Flags: ULONG;
- LmPassword: array [0..MSV1_0_OWF_PASSWORD_LENGTH - 1] of UCHAR;
- NtPassword: array [0..MSV1_0_OWF_PASSWORD_LENGTH - 1] of UCHAR;
- end;
- {$EXTERNALSYM _MSV1_0_SUPPLEMENTAL_CREDENTIAL}
- MSV1_0_SUPPLEMENTAL_CREDENTIAL = _MSV1_0_SUPPLEMENTAL_CREDENTIAL;
- {$EXTERNALSYM MSV1_0_SUPPLEMENTAL_CREDENTIAL}
- TMsv10SupplementalCredential = MSV1_0_SUPPLEMENTAL_CREDENTIAL;
- PMsv10SupplementalCredential = PMSV1_0_SUPPLEMENTAL_CREDENTIAL;
- //
- // NTLM3 definitions.
- //
- const
- MSV1_0_NTLM3_RESPONSE_LENGTH = 16;
- {$EXTERNALSYM MSV1_0_NTLM3_RESPONSE_LENGTH}
- MSV1_0_NTLM3_OWF_LENGTH = 16;
- {$EXTERNALSYM MSV1_0_NTLM3_OWF_LENGTH}
- //
- // this is the longest amount of time we'll allow challenge response
- // pairs to be used. Note that this also has to allow for worst case clock skew
- //
- MSV1_0_MAX_NTLM3_LIFE = 129600; // 36 hours (in seconds)
- {$EXTERNALSYM MSV1_0_MAX_NTLM3_LIFE}
- MSV1_0_MAX_AVL_SIZE = 64000;
- {$EXTERNALSYM MSV1_0_MAX_AVL_SIZE}
- //
- // MsvAvFlags bit values
- //
- MSV1_0_AV_FLAG_FORCE_GUEST = $00000001;
- {$EXTERNALSYM MSV1_0_AV_FLAG_FORCE_GUEST}
- // this is an MSV1_0 private data structure, defining the layout of an NTLM3 response, as sent by a
- // client in the NtChallengeResponse field of the NETLOGON_NETWORK_INFO structure. If can be differentiated
- // from an old style NT response by its length. This is crude, but it needs to pass through servers and
- // the servers' DCs that do not understand NTLM3 but that are willing to pass longer responses.
- type
- PMSV1_0_NTLM3_RESPONSE = ^MSV1_0_NTLM3_RESPONSE;
- {$EXTERNALSYM PMSV1_0_NTLM3_RESPONSE}
- _MSV1_0_NTLM3_RESPONSE = record
- Response: array [0..MSV1_0_NTLM3_RESPONSE_LENGTH - 1] of UCHAR; // hash of OWF of password with all the following fields
- RespType: UCHAR; // id number of response; current is 1
- HiRespType: UCHAR; // highest id number understood by client
- Flags: USHORT; // reserved; must be sent as zero at this version
- MsgWord: ULONG; // 32 bit message from client to server (for use by auth protocol)
- TimeStamp: ULONGLONG; // time stamp when client generated response -- NT system time, quad part
- ChallengeFromClient: array [0..MSV1_0_CHALLENGE_LENGTH - 1] of UCHAR;
- AvPairsOff: ULONG; // offset to start of AvPairs (to allow future expansion)
- Buffer: array [0..0] of UCHAR; // start of buffer with AV pairs (or future stuff -- so use the offset)
- end;
- {$EXTERNALSYM _MSV1_0_NTLM3_RESPONSE}
- MSV1_0_NTLM3_RESPONSE = _MSV1_0_NTLM3_RESPONSE;
- {$EXTERNALSYM MSV1_0_NTLM3_RESPONSE}
- TMsv10Ntlm3Response = MSV1_0_NTLM3_RESPONSE;
- PMsv10Ntlm3Response = PMSV1_0_NTLM3_RESPONSE;
- const
- MSV1_0_NTLM3_INPUT_LENGTH = (SizeOf(MSV1_0_NTLM3_RESPONSE) - MSV1_0_NTLM3_RESPONSE_LENGTH);
- {$EXTERNALSYM MSV1_0_NTLM3_INPUT_LENGTH}
- type
- MSV1_0_AVID = (
- MsvAvEOL, // end of list
- MsvAvNbComputerName, // server's computer name -- NetBIOS
- MsvAvNbDomainName, // server's domain name -- NetBIOS
- MsvAvDnsComputerName, // server's computer name -- DNS
- MsvAvDnsDomainName, // server's domain name -- DNS
- MsvAvDnsTreeName, // server's tree name -- DNS
- MsvAvFlags); // server's extended flags -- DWORD mask
- {$EXTERNALSYM MSV1_0_AVID}
- PMSV1_0_AV_PAIR = ^MSV1_0_AV_PAIR;
- {$EXTERNALSYM PMSV1_0_AV_PAIR}
- _MSV1_0_AV_PAIR = record
- AvId: USHORT;
- AvLen: USHORT;
- // Data is treated as byte array following structure
- end;
- {$EXTERNALSYM _MSV1_0_AV_PAIR}
- MSV1_0_AV_PAIR = _MSV1_0_AV_PAIR;
- {$EXTERNALSYM MSV1_0_AV_PAIR}
- TMsv10AvPair = MSV1_0_AV_PAIR;
- PMsv10AvPair = PMSV1_0_AV_PAIR;
- ///////////////////////////////////////////////////////////////////////////////
- // //
- // CALL PACKAGE Related Data Structures //
- // //
- ///////////////////////////////////////////////////////////////////////////////
- //
- // MSV1.0 LsaCallAuthenticationPackage() submission and response
- // message types.
- //
- _MSV1_0_PROTOCOL_MESSAGE_TYPE = (
- MsV1_0Lm20ChallengeRequest, // Both submission and response
- MsV1_0Lm20GetChallengeResponse, // Both submission and response
- MsV1_0EnumerateUsers, // Both submission and response
- MsV1_0GetUserInfo, // Both submission and response
- MsV1_0ReLogonUsers, // Submission only
- MsV1_0ChangePassword, // Both submission and response
- MsV1_0ChangeCachedPassword, // Both submission and response
- MsV1_0GenericPassthrough, // Both submission and response
- MsV1_0CacheLogon, // Submission only, no response
- MsV1_0SubAuth, // Both submission and response
- MsV1_0DeriveCredential, // Both submission and response
- MsV1_0CacheLookup, // Both submission and response
- MsV1_0SetProcessOption); // Submission only, no response
- {$EXTERNALSYM _MSV1_0_PROTOCOL_MESSAGE_TYPE}
- MSV1_0_PROTOCOL_MESSAGE_TYPE = _MSV1_0_PROTOCOL_MESSAGE_TYPE;
- {$EXTERNALSYM MSV1_0_PROTOCOL_MESSAGE_TYPE}
- PMSV1_0_PROTOCOL_MESSAGE_TYPE = ^MSV1_0_PROTOCOL_MESSAGE_TYPE;
- {$EXTERNALSYM PMSV1_0_PROTOCOL_MESSAGE_TYPE}
- TMsv1_0ProtocolMessageType = MSV1_0_PROTOCOL_MESSAGE_TYPE;
- PMsv1_0ProtocolMessageType = PMSV1_0_PROTOCOL_MESSAGE_TYPE;
- PMSV1_0_CHANGEPASSWORD_REQUEST = ^MSV1_0_CHANGEPASSWORD_REQUEST;
- {$EXTERNALSYM PMSV1_0_CHANGEPASSWORD_REQUEST}
- _MSV1_0_CHANGEPASSWORD_REQUEST = record
- MessageType: MSV1_0_PROTOCOL_MESSAGE_TYPE;
- DomainName: UNICODE_STRING;
- AccountName: UNICODE_STRING;
- OldPassword: UNICODE_STRING;
- NewPassword: UNICODE_STRING;
- Impersonating: ByteBool;
- end;
- {$EXTERNALSYM _MSV1_0_CHANGEPASSWORD_REQUEST}
- MSV1_0_CHANGEPASSWORD_REQUEST = _MSV1_0_CHANGEPASSWORD_REQUEST;
- {$EXTERNALSYM MSV1_0_CHANGEPASSWORD_REQUEST}
- TMsv10ChangepasswordRequest = MSV1_0_CHANGEPASSWORD_REQUEST;
- PMsv10ChangepasswordRequest = PMSV1_0_CHANGEPASSWORD_REQUEST;
- PMSV1_0_CHANGEPASSWORD_RESPONSE = ^MSV1_0_CHANGEPASSWORD_RESPONSE;
- {$EXTERNALSYM PMSV1_0_CHANGEPASSWORD_RESPONSE}
- _MSV1_0_CHANGEPASSWORD_RESPONSE = record
- MessageType: MSV1_0_PROTOCOL_MESSAGE_TYPE;
- PasswordInfoValid: ByteBool;
- DomainPasswordInfo: DOMAIN_PASSWORD_INFORMATION;
- end;
- {$EXTERNALSYM _MSV1_0_CHANGEPASSWORD_RESPONSE}
- MSV1_0_CHANGEPASSWORD_RESPONSE = _MSV1_0_CHANGEPASSWORD_RESPONSE;
- {$EXTERNALSYM MSV1_0_CHANGEPASSWORD_RESPONSE}
- TMsv10ChangepasswordResponse = MSV1_0_CHANGEPASSWORD_RESPONSE;
- PMsv10ChangepasswordResponse = PMSV1_0_CHANGEPASSWORD_RESPONSE;
- //
- // MsV1_0GenericPassthrough - for remoting a CallPackage to
- // a domain controller on the specified domain
- //
- _MSV1_0_PASSTHROUGH_REQUEST = record
- MessageType: MSV1_0_PROTOCOL_MESSAGE_TYPE;
- DomainName: UNICODE_STRING;
- PackageName: UNICODE_STRING;
- DataLength: ULONG;
- LogonData: PUCHAR;
- Pad: ULONG;
- end;
- {$EXTERNALSYM _MSV1_0_PASSTHROUGH_REQUEST}
- MSV1_0_PASSTHROUGH_REQUEST = _MSV1_0_PASSTHROUGH_REQUEST;
- {$EXTERNALSYM MSV1_0_PASSTHROUGH_REQUEST}
- PMSV1_0_PASSTHROUGH_REQUEST = ^MSV1_0_PASSTHROUGH_REQUEST;
- {$EXTERNALSYM PMSV1_0_PASSTHROUGH_REQUEST}
- TMsv10PassThroughRequest = MSV1_0_PASSTHROUGH_REQUEST;
- PMsv10PassThroughRequest = PMSV1_0_PASSTHROUGH_REQUEST;
- _MSV1_0_PASSTHROUGH_RESPONSE = record
- MessageType: MSV1_0_PROTOCOL_MESSAGE_TYPE;
- Pad: ULONG;
- DataLength: ULONG;
- ValidationData: PUCHAR;
- end;
- {$EXTERNALSYM _MSV1_0_PASSTHROUGH_RESPONSE}
- MSV1_0_PASSTHROUGH_RESPONSE = _MSV1_0_PASSTHROUGH_RESPONSE;
- {$EXTERNALSYM MSV1_0_PASSTHROUGH_RESPONSE}
- PMSV1_0_PASSTHROUGH_RESPONSE = ^MSV1_0_PASSTHROUGH_RESPONSE;
- {$EXTERNALSYM PMSV1_0_PASSTHROUGH_RESPONSE}
- TMsv10PassThroughResponse = MSV1_0_PASSTHROUGH_RESPONSE;
- PMsv10PassThroughResponse = PMSV1_0_PASSTHROUGH_RESPONSE;
- //
- // MsV1_0SubAuthInfo submit buffer and response - for submitting a buffer to a
- // specified Subauthentication Package during an LsaCallAuthenticationPackage().
- // If this Subauthentication is to be done locally, then package this message
- // in LsaCallAuthenticationPackage(). If this SubAuthentication needs to be done
- // on the domain controller, then call LsaCallauthenticationPackage with the
- // message type being MsV1_0GenericPassThrough and the LogonData in this struct
- // should be a PMSV1_0_SUBAUTH_REQUEST
- //
- PMSV1_0_SUBAUTH_REQUEST = ^MSV1_0_SUBAUTH_REQUEST;
- {$EXTERNALSYM PMSV1_0_SUBAUTH_REQUEST}
- _MSV1_0_SUBAUTH_REQUEST = record
- MessageType: MSV1_0_PROTOCOL_MESSAGE_TYPE;
- SubAuthPackageId: ULONG;
- SubAuthInfoLength: ULONG;
- SubAuthSubmitBuffer: PUCHAR;
- end;
- {$EXTERNALSYM _MSV1_0_SUBAUTH_REQUEST}
- MSV1_0_SUBAUTH_REQUEST = _MSV1_0_SUBAUTH_REQUEST;
- {$EXTERNALSYM MSV1_0_SUBAUTH_REQUEST}
- TMsv10SubauthRequest = MSV1_0_SUBAUTH_REQUEST;
- PMsv10SubauthRequest = PMSV1_0_SUBAUTH_REQUEST;
- PMSV1_0_SUBAUTH_RESPONSE = ^MSV1_0_SUBAUTH_RESPONSE;
- {$EXTERNALSYM PMSV1_0_SUBAUTH_RESPONSE}
- _MSV1_0_SUBAUTH_RESPONSE = record
- MessageType: MSV1_0_PROTOCOL_MESSAGE_TYPE;
- SubAuthInfoLength: ULONG;
- SubAuthReturnBuffer: PUCHAR;
- end;
- {$EXTERNALSYM _MSV1_0_SUBAUTH_RESPONSE}
- MSV1_0_SUBAUTH_RESPONSE = _MSV1_0_SUBAUTH_RESPONSE;
- {$EXTERNALSYM MSV1_0_SUBAUTH_RESPONSE}
- TMsv10SubauthResponse = MSV1_0_SUBAUTH_RESPONSE;
- PMsv10SubauthResponse = PMSV1_0_SUBAUTH_RESPONSE;
- //
- // Credential Derivation types for MsV1_0DeriveCredential Submit DeriveCredType
- //
- //
- // Derive Credential using SHA-1 and Request buffer DeriveCredSubmitBuffer of
- // length DeriveCredInfoLength mixing bytes.
- // Response buffer DeriveCredReturnBuffer will contain SHA-1 hash of size
- // A_SHA_DIGEST_LEN (20)
- //
- const
- MSV1_0_DERIVECRED_TYPE_SHA1 = 0;
- {$EXTERNALSYM MSV1_0_DERIVECRED_TYPE_SHA1}
- //
- // MsV1_0DeriveCredential submit buffer and response - for submitting a buffer
- // an call to LsaCallAuthenticationPackage().
- //
- type
- PMSV1_0_DERIVECRED_REQUEST = ^MSV1_0_DERIVECRED_REQUEST;
- {$EXTERNALSYM PMSV1_0_DERIVECRED_REQUEST}
- _MSV1_0_DERIVECRED_REQUEST = record
- MessageType: MSV1_0_PROTOCOL_MESSAGE_TYPE;
- LogonId: LUID;
- DeriveCredType: ULONG;
- DeriveCredInfoLength: ULONG;
- DeriveCredSubmitBuffer: array [0..0] of UCHAR; // in-place array of length DeriveCredInfoLength
- end;
- {$EXTERNALSYM _MSV1_0_DERIVECRED_REQUEST}
- MSV1_0_DERIVECRED_REQUEST = _MSV1_0_DERIVECRED_REQUEST;
- {$EXTERNALSYM MSV1_0_DERIVECRED_REQUEST}
- TMsv10DeriveCredRequest = MSV1_0_DERIVECRED_REQUEST;
- PMsv10DeriveCredRequest = PMSV1_0_DERIVECRED_REQUEST;
- PMSV1_0_DERIVECRED_RESPONSE = ^MSV1_0_DERIVECRED_RESPONSE;
- {$EXTERNALSYM PMSV1_0_DERIVECRED_RESPONSE}
- _MSV1_0_DERIVECRED_RESPONSE = record
- MessageType: MSV1_0_PROTOCOL_MESSAGE_TYPE;
- DeriveCredInfoLength: ULONG;
- DeriveCredReturnBuffer: array [0..0] of UCHAR; // in-place array of length DeriveCredInfoLength
- end;
- {$EXTERNALSYM _MSV1_0_DERIVECRED_RESPONSE}
- MSV1_0_DERIVECRED_RESPONSE = _MSV1_0_DERIVECRED_RESPONSE;
- {$EXTERNALSYM MSV1_0_DERIVECRED_RESPONSE}
- TMsv10DeriveCredResponse = MSV1_0_DERIVECRED_RESPONSE;
- PMsv10DeriveCredResponse = PMSV1_0_DERIVECRED_RESPONSE;
- // Revision of the Kerberos Protocol. MS uses Version 5, Revision 6
- const
- KERBEROS_VERSION = 5;
- {$EXTERNALSYM KERBEROS_VERSION}
- KERBEROS_REVISION = 6;
- {$EXTERNALSYM KERBEROS_REVISION}
- // Encryption Types:
- // These encryption types are supported by the default MS KERBSUPP DLL
- // as crypto systems. Values over 127 are local values, and may be changed
- // without notice.
- KERB_ETYPE_NULL = 0;
- {$EXTERNALSYM KERB_ETYPE_NULL}
- KERB_ETYPE_DES_CBC_CRC = 1;
- {$EXTERNALSYM KERB_ETYPE_DES_CBC_CRC}
- KERB_ETYPE_DES_CBC_MD4 = 2;
- {$EXTERNALSYM KERB_ETYPE_DES_CBC_MD4}
- KERB_ETYPE_DES_CBC_MD5 = 3;
- {$EXTERNALSYM KERB_ETYPE_DES_CBC_MD5}
- KERB_ETYPE_RC4_MD4 = -128;
- {$EXTERNALSYM KERB_ETYPE_RC4_MD4}
- KERB_ETYPE_RC4_PLAIN2 = -129;
- {$EXTERNALSYM KERB_ETYPE_RC4_PLAIN2}
- KERB_ETYPE_RC4_LM = -130;
- {$EXTERNALSYM KERB_ETYPE_RC4_LM}
- KERB_ETYPE_RC4_SHA = -131;
- {$EXTERNALSYM KERB_ETYPE_RC4_SHA}
- KERB_ETYPE_DES_PLAIN = -132;
- {$EXTERNALSYM KERB_ETYPE_DES_PLAIN}
- KERB_ETYPE_RC4_HMAC_OLD = -133;
- {$EXTERNALSYM KERB_ETYPE_RC4_HMAC_OLD}
- KERB_ETYPE_RC4_PLAIN_OLD = -134;
- {$EXTERNALSYM KERB_ETYPE_RC4_PLAIN_OLD}
- KERB_ETYPE_RC4_HMAC_OLD_EXP = -135;
- {$EXTERNALSYM KERB_ETYPE_RC4_HMAC_OLD_EXP}
- KERB_ETYPE_RC4_PLAIN_OLD_EXP = -136;
- {$EXTERNALSYM KERB_ETYPE_RC4_PLAIN_OLD_EXP}
- KERB_ETYPE_RC4_PLAIN = -140;
- {$EXTERNALSYM KERB_ETYPE_RC4_PLAIN}
- KERB_ETYPE_RC4_PLAIN_EXP = -141;
- {$EXTERNALSYM KERB_ETYPE_RC4_PLAIN_EXP}
- //
- // Pkinit encryption types
- //
- KERB_ETYPE_DSA_SHA1_CMS = 9;
- {$EXTERNALSYM KERB_ETYPE_DSA_SHA1_CMS}
- KERB_ETYPE_RSA_MD5_CMS = 10;
- {$EXTERNALSYM KERB_ETYPE_RSA_MD5_CMS}
- KERB_ETYPE_RSA_SHA1_CMS = 11;
- {$EXTERNALSYM KERB_ETYPE_RSA_SHA1_CMS}
- KERB_ETYPE_RC2_CBC_ENV = 12;
- {$EXTERNALSYM KERB_ETYPE_RC2_CBC_ENV}
- KERB_ETYPE_RSA_ENV = 13;
- {$EXTERNALSYM KERB_ETYPE_RSA_ENV}
- KERB_ETYPE_RSA_ES_OEAP_ENV = 14;
- {$EXTERNALSYM KERB_ETYPE_RSA_ES_OEAP_ENV}
- KERB_ETYPE_DES_EDE3_CBC_ENV = 15;
- {$EXTERNALSYM KERB_ETYPE_DES_EDE3_CBC_ENV}
- //
- // Deprecated
- //
- KERB_ETYPE_DSA_SIGN = 8;
- {$EXTERNALSYM KERB_ETYPE_DSA_SIGN}
- KERB_ETYPE_RSA_PRIV = 9;
- {$EXTERNALSYM KERB_ETYPE_RSA_PRIV}
- KERB_ETYPE_RSA_PUB = 10;
- {$EXTERNALSYM KERB_ETYPE_RSA_PUB}
- KERB_ETYPE_RSA_PUB_MD5 = 11;
- {$EXTERNALSYM KERB_ETYPE_RSA_PUB_MD5}
- KERB_ETYPE_RSA_PUB_SHA1 = 12;
- {$EXTERNALSYM KERB_ETYPE_RSA_PUB_SHA1}
- KERB_ETYPE_PKCS7_PUB = 13;
- {$EXTERNALSYM KERB_ETYPE_PKCS7_PUB}
- //
- // In use types
- //
- KERB_ETYPE_DES_CBC_MD5_NT = 20;
- {$EXTERNALSYM KERB_ETYPE_DES_CBC_MD5_NT}
- KERB_ETYPE_RC4_HMAC_NT = 23;
- {$EXTERNALSYM KERB_ETYPE_RC4_HMAC_NT}
- KERB_ETYPE_RC4_HMAC_NT_EXP = 24;
- {$EXTERNALSYM KERB_ETYPE_RC4_HMAC_NT_EXP}
- // Checksum algorithms.
- // These algorithms are keyed internally for our use.
- KERB_CHECKSUM_NONE = 0;
- {$EXTERNALSYM KERB_CHECKSUM_NONE}
- KERB_CHECKSUM_CRC32 = 1;
- {$EXTERNALSYM KERB_CHECKSUM_CRC32}
- KERB_CHECKSUM_MD4 = 2;
- {$EXTERNALSYM KERB_CHECKSUM_MD4}
- KERB_CHECKSUM_KRB_DES_MAC = 4;
- {$EXTERNALSYM KERB_CHECKSUM_KRB_DES_MAC}
- KERB_CHECKSUM_KRB_DES_MAC_K = 5;
- {$EXTERNALSYM KERB_CHECKSUM_KRB_DES_MAC_K}
- KERB_CHECKSUM_MD5 = 7;
- {$EXTERNALSYM KERB_CHECKSUM_MD5}
- KERB_CHECKSUM_MD5_DES = 8;
- {$EXTERNALSYM KERB_CHECKSUM_MD5_DES}
- KERB_CHECKSUM_LM = -130;
- {$EXTERNALSYM KERB_CHECKSUM_LM}
- KERB_CHECKSUM_SHA1 = -131;
- {$EXTERNALSYM KERB_CHECKSUM_SHA1}
- KERB_CHECKSUM_REAL_CRC32 = -132;
- {$EXTERNALSYM KERB_CHECKSUM_REAL_CRC32}
- KERB_CHECKSUM_DES_MAC = -133;
- {$EXTERNALSYM KERB_CHECKSUM_DES_MAC}
- KERB_CHECKSUM_DES_MAC_MD5 = -134;
- {$EXTERNALSYM KERB_CHECKSUM_DES_MAC_MD5}
- KERB_CHECKSUM_MD25 = -135;
- {$EXTERNALSYM KERB_CHECKSUM_MD25}
- KERB_CHECKSUM_RC4_MD5 = -136;
- {$EXTERNALSYM KERB_CHECKSUM_RC4_MD5}
- KERB_CHECKSUM_MD5_HMAC = -137; // used by netlogon
- {$EXTERNALSYM KERB_CHECKSUM_MD5_HMAC}
- KERB_CHECKSUM_HMAC_MD5 = -138; // used by Kerberos
- {$EXTERNALSYM KERB_CHECKSUM_HMAC_MD5}
- AUTH_REQ_ALLOW_FORWARDABLE = $00000001;
- {$EXTERNALSYM AUTH_REQ_ALLOW_FORWARDABLE}
- AUTH_REQ_ALLOW_PROXIABLE = $00000002;
- {$EXTERNALSYM AUTH_REQ_ALLOW_PROXIABLE}
- AUTH_REQ_ALLOW_POSTDATE = $00000004;
- {$EXTERNALSYM AUTH_REQ_ALLOW_POSTDATE}
- AUTH_REQ_ALLOW_RENEWABLE = $00000008;
- {$EXTERNALSYM AUTH_REQ_ALLOW_RENEWABLE}
- AUTH_REQ_ALLOW_NOADDRESS = $00000010;
- {$EXTERNALSYM AUTH_REQ_ALLOW_NOADDRESS}
- AUTH_REQ_ALLOW_ENC_TKT_IN_SKEY = $00000020;
- {$EXTERNALSYM AUTH_REQ_ALLOW_ENC_TKT_IN_SKEY}
- AUTH_REQ_ALLOW_VALIDATE = $00000040;
- {$EXTERNALSYM AUTH_REQ_ALLOW_VALIDATE}
- AUTH_REQ_VALIDATE_CLIENT = $00000080;
- {$EXTERNALSYM AUTH_REQ_VALIDATE_CLIENT}
- AUTH_REQ_OK_AS_DELEGATE = $00000100;
- {$EXTERNALSYM AUTH_REQ_OK_AS_DELEGATE}
- AUTH_REQ_PREAUTH_REQUIRED = $00000200;
- {$EXTERNALSYM AUTH_REQ_PREAUTH_REQUIRED}
- AUTH_REQ_TRANSITIVE_TRUST = $00000400;
- {$EXTERNALSYM AUTH_REQ_TRANSITIVE_TRUST}
- AUTH_REQ_ALLOW_S4U_DELEGATE = $00000800;
- {$EXTERNALSYM AUTH_REQ_ALLOW_S4U_DELEGATE}
- AUTH_REQ_PER_USER_FLAGS = (AUTH_REQ_ALLOW_FORWARDABLE or
- AUTH_REQ_ALLOW_PROXIABLE or
- AUTH_REQ_ALLOW_POSTDATE or
- AUTH_REQ_ALLOW_RENEWABLE or
- AUTH_REQ_ALLOW_VALIDATE);
- {$EXTERNALSYM AUTH_REQ_PER_USER_FLAGS}
- //
- // Ticket Flags:
- //
- KERB_TICKET_FLAGS_reserved = DWORD($80000000);
- {$EXTERNALSYM KERB_TICKET_FLAGS_reserved}
- KERB_TICKET_FLAGS_forwardable = $40000000;
- {$EXTERNALSYM KERB_TICKET_FLAGS_forwardable}
- KERB_TICKET_FLAGS_forwarded = $20000000;
- {$EXTERNALSYM KERB_TICKET_FLAGS_forwarded}
- KERB_TICKET_FLAGS_proxiable = $10000000;
- {$EXTERNALSYM KERB_TICKET_FLAGS_proxiable}
- KERB_TICKET_FLAGS_proxy = $08000000;
- {$EXTERNALSYM KERB_TICKET_FLAGS_proxy}
- KERB_TICKET_FLAGS_may_postdate = $04000000;
- {$EXTERNALSYM KERB_TICKET_FLAGS_may_postdate}
- KERB_TICKET_FLAGS_postdated = $02000000;
- {$EXTERNALSYM KERB_TICKET_FLAGS_postdated}
- KERB_TICKET_FLAGS_invalid = $01000000;
- {$EXTERNALSYM KERB_TICKET_FLAGS_invalid}
- KERB_TICKET_FLAGS_renewable = $00800000;
- {$EXTERNALSYM KERB_TICKET_FLAGS_renewable}
- KERB_TICKET_FLAGS_initial = $00400000;
- {$EXTERNALSYM KERB_TICKET_FLAGS_initial}
- KERB_TICKET_FLAGS_pre_authent = $00200000;
- {$EXTERNALSYM KERB_TICKET_FLAGS_pre_authent}
- KERB_TICKET_FLAGS_hw_authent = $00100000;
- {$EXTERNALSYM KERB_TICKET_FLAGS_hw_authent}
- KERB_TICKET_FLAGS_ok_as_delegate = $00040000;
- {$EXTERNALSYM KERB_TICKET_FLAGS_ok_as_delegate}
- KERB_TICKET_FLAGS_name_canonicalize = $00010000;
- {$EXTERNALSYM KERB_TICKET_FLAGS_name_canonicalize}
- KERB_TICKET_FLAGS_reserved1 = $00000001;
- {$EXTERNALSYM KERB_TICKET_FLAGS_reserved1}
- //
- // Name types
- //
- KRB_NT_UNKNOWN = 0; // Name type not known
- {$EXTERNALSYM KRB_NT_UNKNOWN}
- KRB_NT_PRINCIPAL = 1; // Just the name of the principal as in DCE, or for users
- {$EXTERNALSYM KRB_NT_PRINCIPAL}
- KRB_NT_PRINCIPAL_AND_ID = -131; // Name of the principal and its SID.
- {$EXTERNALSYM KRB_NT_PRINCIPAL_AND_ID}
- KRB_NT_SRV_INST = 2; // Service and other unique instance (krbtgt)
- {$EXTERNALSYM KRB_NT_SRV_INST}
- KRB_NT_SRV_INST_AND_ID = -132; // SPN and SID
- {$EXTERNALSYM KRB_NT_SRV_INST_AND_ID}
- KRB_NT_SRV_HST = 3; // Service with host name as instance (telnet, rcommands)
- {$EXTERNALSYM KRB_NT_SRV_HST}
- KRB_NT_SRV_XHST = 4; // Service with host as remaining components
- {$EXTERNALSYM KRB_NT_SRV_XHST}
- KRB_NT_UID = 5; // Unique ID
- {$EXTERNALSYM KRB_NT_UID}
- KRB_NT_ENTERPRISE_PRINCIPAL = 10; // UPN or SPN
- {$EXTERNALSYM KRB_NT_ENTERPRISE_PRINCIPAL}
- KRB_NT_ENT_PRINCIPAL_AND_ID = -130; // UPN and SID
- {$EXTERNALSYM KRB_NT_ENT_PRINCIPAL_AND_ID}
- //
- // MS extensions, negative according to the RFC
- //
- KRB_NT_MS_PRINCIPAL = -128; // NT4 style name
- {$EXTERNALSYM KRB_NT_MS_PRINCIPAL}
- KRB_NT_MS_PRINCIPAL_AND_ID = -129; // nt4 style name with sid
- {$EXTERNALSYM KRB_NT_MS_PRINCIPAL_AND_ID}
- // todo #define KERB_IS_MS_PRINCIPAL(_x_) (((_x_) <= KRB_NT_MS_PRINCIPAL) || ((_x_) >= KRB_NT_ENTERPRISE_PRINCIPAL))
- MICROSOFT_KERBEROS_NAME_A = 'Kerberos';
- {$EXTERNALSYM MICROSOFT_KERBEROS_NAME_A}
- MICROSOFT_KERBEROS_NAME_W = WideString('Kerberos');
- {$EXTERNALSYM MICROSOFT_KERBEROS_NAME_W}
- {$IFDEF UNICODE}
- MICROSOFT_KERBEROS_NAME = MICROSOFT_KERBEROS_NAME_W;
- {$EXTERNALSYM MICROSOFT_KERBEROS_NAME}
- {$ELSE}
- MICROSOFT_KERBEROS_NAME = MICROSOFT_KERBEROS_NAME_A;
- {$EXTERNALSYM MICROSOFT_KERBEROS_NAME}
- {$ENDIF}
- /////////////////////////////////////////////////////////////////////////
- //
- // Quality of protection parameters for MakeSignature / EncryptMessage
- //
- /////////////////////////////////////////////////////////////////////////
- //
- // This flag indicates to EncryptMessage that the message is not to actually
- // be encrypted, but a header/trailer are to be produced.
- //
- KERB_WRAP_NO_ENCRYPT = DWORD($80000001);
- {$EXTERNALSYM KERB_WRAP_NO_ENCRYPT}
- /////////////////////////////////////////////////////////////////////////
- //
- // LsaLogonUser parameters
- //
- /////////////////////////////////////////////////////////////////////////
- const
- KerbInteractiveLogon = 2;
- KerbSmartCardLogon = 6;
- KerbWorkstationUnlockLogon = 7;
- KerbSmartCardUnlockLogon = 8;
- KerbProxyLogon = 9;
- KerbTicketLogon = 10;
- KerbTicketUnlockLogon = 11;
- KerbS4ULogon = 12;
- type
- KERB_LOGON_SUBMIT_TYPE = DWORD;
- {$EXTERNALSYM KERB_LOGON_SUBMIT_TYPE}
- PKERB_LOGON_SUBMIT_TYPE = ^KERB_LOGON_SUBMIT_TYPE;
- {$EXTERNALSYM PKERB_LOGON_SUBMIT_TYPE}
- PKERB_INTERACTIVE_LOGON = ^KERB_INTERACTIVE_LOGON;
- {$EXTERNALSYM PKERB_INTERACTIVE_LOGON}
- _KERB_INTERACTIVE_LOGON = record
- MessageType: KERB_LOGON_SUBMIT_TYPE;
- LogonDomainName: UNICODE_STRING;
- UserName: UNICODE_STRING;
- Password: UNICODE_STRING;
- end;
- {$EXTERNALSYM _KERB_INTERACTIVE_LOGON}
- KERB_INTERACTIVE_LOGON = _KERB_INTERACTIVE_LOGON;
- {$EXTERNALSYM KERB_INTERACTIVE_LOGON}
- TKerbInteractiveLogon = KERB_INTERACTIVE_LOGON;
- PKerbInteractiveLogon = PKERB_INTERACTIVE_LOGON;
- PKERB_INTERACTIVE_UNLOCK_LOGON = ^KERB_INTERACTIVE_UNLOCK_LOGON;
- {$EXTERNALSYM PKERB_INTERACTIVE_UNLOCK_LOGON}
- _KERB_INTERACTIVE_UNLOCK_LOGON = record
- Logon: KERB_INTERACTIVE_LOGON;
- LogonId: LUID;
- end;
- {$EXTERNALSYM _KERB_INTERACTIVE_UNLOCK_LOGON}
- KERB_INTERACTIVE_UNLOCK_LOGON = _KERB_INTERACTIVE_UNLOCK_LOGON;
- {$EXTERNALSYM KERB_INTERACTIVE_UNLOCK_LOGON}
- TKerbInteractiveUnlockLogon = KERB_INTERACTIVE_UNLOCK_LOGON;
- PKerbInteractiveUnlockLogon = PKERB_INTERACTIVE_UNLOCK_LOGON;
- PKERB_SMART_CARD_LOGON = ^KERB_SMART_CARD_LOGON;
- {$EXTERNALSYM PKERB_SMART_CARD_LOGON}
- _KERB_SMART_CARD_LOGON = record
- MessageType: KERB_LOGON_SUBMIT_TYPE;
- Pin: UNICODE_STRING;
- CspDataLength: ULONG;
- CspData: PUCHAR;
- end;
- {$EXTERNALSYM _KERB_SMART_CARD_LOGON}
- KERB_SMART_CARD_LOGON = _KERB_SMART_CARD_LOGON;
- {$EXTERNALSYM KERB_SMART_CARD_LOGON}
- TKerbSmartCardLogon = KERB_SMART_CARD_LOGON;
- PKerbSmartCardLogon = PKERB_SMART_CARD_LOGON;
- PKERB_SMART_CARD_UNLOCK_LOGON = ^KERB_SMART_CARD_UNLOCK_LOGON;
- {$EXTERNALSYM PKERB_SMART_CARD_UNLOCK_LOGON}
- _KERB_SMART_CARD_UNLOCK_LOGON = record
- Logon: KERB_SMART_CARD_LOGON;
- LogonId: LUID;
- end;
- {$EXTERNALSYM _KERB_SMART_CARD_UNLOCK_LOGON}
- KERB_SMART_CARD_UNLOCK_LOGON = _KERB_SMART_CARD_UNLOCK_LOGON;
- {$EXTERNALSYM KERB_SMART_CARD_UNLOCK_LOGON}
- TKerbSmartCardUnlockLogon = KERB_SMART_CARD_UNLOCK_LOGON;
- PKerbSmartCardUnlockLogon = PKERB_SMART_CARD_UNLOCK_LOGON;
- //
- // Structure used for a ticket-only logon
- //
- PKERB_TICKET_LOGON = ^KERB_TICKET_LOGON;
- {$EXTERNALSYM PKERB_TICKET_LOGON}
- _KERB_TICKET_LOGON = record
- MessageType: KERB_LOGON_SUBMIT_TYPE;
- Flags: ULONG;
- ServiceTicketLength: ULONG;
- TicketGrantingTicketLength: ULONG;
- ServiceTicket: PUCHAR; // REQUIRED: Service ticket "host"
- TicketGrantingTicket: PUCHAR; // OPTIONAL: User's encdoded in a KERB_CRED message, encrypted with session key from service ticket
- end;
- {$EXTERNALSYM _KERB_TICKET_LOGON}
- KERB_TICKET_LOGON = _KERB_TICKET_LOGON;
- {$EXTERNALSYM KERB_TICKET_LOGON}
- TKerbTicketLogon = KERB_TICKET_LOGON;
- PKerbTicketLogon = PKERB_TICKET_LOGON;
- //
- // Flags for the ticket logon flags field
- //
- const
- KERB_LOGON_FLAG_ALLOW_EXPIRED_TICKET = $1;
- {$EXTERNALSYM KERB_LOGON_FLAG_ALLOW_EXPIRED_TICKET}
- type
- PKERB_TICKET_UNLOCK_LOGON = ^KERB_TICKET_UNLOCK_LOGON;
- {$EXTERNALSYM PKERB_TICKET_UNLOCK_LOGON}
- _KERB_TICKET_UNLOCK_LOGON = record
- Logon: KERB_TICKET_LOGON;
- LogonId: LUID;
- end;
- {$EXTERNALSYM _KERB_TICKET_UNLOCK_LOGON}
- KERB_TICKET_UNLOCK_LOGON = _KERB_TICKET_UNLOCK_LOGON;
- {$EXTERNALSYM KERB_TICKET_UNLOCK_LOGON}
- TKerbTicketUnlockLogon = KERB_TICKET_UNLOCK_LOGON;
- PKerbTicketUnlockLogon = PKERB_TICKET_UNLOCK_LOGON;
- //
- // Used for S4U Client requests
- //
- //
- _KERB_S4U_LOGON = record
- MessageType: KERB_LOGON_SUBMIT_TYPE;
- Flags: ULONG;
- ClientUpn: UNICODE_STRING; // REQUIRED: UPN for client
- ClientRealm: UNICODE_STRING; // Optional: Client Realm, if known
- end;
- {$EXTERNALSYM _KERB_S4U_LOGON}
- KERB_S4U_LOGON = _KERB_S4U_LOGON;
- {$EXTERNALSYM KERB_S4U_LOGON}
- PKERB_S4U_LOGON = ^KERB_S4U_LOGON;
- {$EXTERNALSYM PKERB_S4U_LOGON}
- TKerbS4ULogon = KERB_S4U_LOGON;
- PKerbS4ULogon = PKERB_S4U_LOGON;
- //
- // Use the same profile structure as MSV1_0
- //
- type
- _KERB_PROFILE_BUFFER_TYPE = (
- kpbtFiller0, kpbtFiller1,
- KerbInteractiveProfile,
- kpbtFiller3,
- KerbSmartCardProfile,
- kpbtFiller5,
- KerbTicketProfile);
- {$EXTERNALSYM _KERB_PROFILE_BUFFER_TYPE}
- KERB_PROFILE_BUFFER_TYPE = _KERB_PROFILE_BUFFER_TYPE;
- {$EXTERNALSYM KERB_PROFILE_BUFFER_TYPE}
- PKERB_PROFILE_BUFFER_TYPE = ^KERB_PROFILE_BUFFER_TYPE;
- {$EXTERNALSYM PKERB_PROFILE_BUFFER_TYPE}
- TKerbProfileBufferType = KERB_PROFILE_BUFFER_TYPE;
- PKerbProfileBufferType = PKERB_PROFILE_BUFFER_TYPE;
- PKERB_INTERACTIVE_PROFILE = ^KERB_INTERACTIVE_PROFILE;
- {$EXTERNALSYM PKERB_INTERACTIVE_PROFILE}
- _KERB_INTERACTIVE_PROFILE = record
- MessageType: KERB_PROFILE_BUFFER_TYPE;
- LogonCount: USHORT;
- BadPasswordCount: USHORT;
- LogonTime: LARGE_INTEGER;
- LogoffTime: LARGE_INTEGER;
- KickOffTime: LARGE_INTEGER;
- PasswordLastSet: LARGE_INTEGER;
- PasswordCanChange: LARGE_INTEGER;
- PasswordMustChange: LARGE_INTEGER;
- LogonScript: UNICODE_STRING;
- HomeDirectory: UNICODE_STRING;
- FullName: UNICODE_STRING;
- ProfilePath: UNICODE_STRING;
- HomeDirectoryDrive: UNICODE_STRING;
- LogonServer: UNICODE_STRING;
- UserFlags: ULONG;
- end;
- {$EXTERNALSYM _KERB_INTERACTIVE_PROFILE}
- KERB_INTERACTIVE_PROFILE = _KERB_INTERACTIVE_PROFILE;
- {$EXTERNALSYM KERB_INTERACTIVE_PROFILE}
- TKerbInteractiveProfile = KERB_INTERACTIVE_PROFILE;
- PKerbInteractiveProfile = PKERB_INTERACTIVE_PROFILE;
- //
- // For smart card, we return a smart card profile, which is an interactive
- // profile plus a certificate
- //
- PKERB_SMART_CARD_PROFILE = ^KERB_SMART_CARD_PROFILE;
- {$EXTERNALSYM PKERB_SMART_CARD_PROFILE}
- _KERB_SMART_CARD_PROFILE = record
- Profile: KERB_INTERACTIVE_PROFILE;
- CertificateSize: ULONG;
- CertificateData: PUCHAR;
- end;
- {$EXTERNALSYM _KERB_SMART_CARD_PROFILE}
- KERB_SMART_CARD_PROFILE = _KERB_SMART_CARD_PROFILE;
- {$EXTERNALSYM KERB_SMART_CARD_PROFILE}
- TKerbSmartCardProfile = KERB_SMART_CARD_PROFILE;
- PKerbSmartCardProfile = PKERB_SMART_CARD_PROFILE;
- //
- // For a ticket logon profile, we return the session key from the ticket
- //
- PKERB_CRYPTO_KEY = ^KERB_CRYPTO_KEY;
- {$EXTERNALSYM PKERB_CRYPTO_KEY}
- KERB_CRYPTO_KEY = record
- KeyType: LONG;
- Length: ULONG;
- Value: PUCHAR;
- end;
- {$EXTERNALSYM KERB_CRYPTO_KEY}
- TKerbCryptoKey = KERB_CRYPTO_KEY;
- PKerbCryptoKey = PKERB_CRYPTO_KEY;
- PKERB_TICKET_PROFILE = ^KERB_TICKET_PROFILE;
- {$EXTERNALSYM PKERB_TICKET_PROFILE}
- _KERB_TICKET_PROFILE = record
- Profile: KERB_INTERACTIVE_PROFILE;
- SessionKey: KERB_CRYPTO_KEY;
- end;
- {$EXTERNALSYM _KERB_TICKET_PROFILE}
- KERB_TICKET_PROFILE = _KERB_TICKET_PROFILE;
- {$EXTERNALSYM KERB_TICKET_PROFILE}
- TKerbTicketProfile = KERB_TICKET_PROFILE;
- PKerbTicketProfile = PKERB_TICKET_PROFILE;
- _KERB_PROTOCOL_MESSAGE_TYPE = (
- KerbDebugRequestMessage,
- KerbQueryTicketCacheMessage,
- KerbChangeMachinePasswordMessage,
- KerbVerifyPacMessage,
- KerbRetrieveTicketMessage,
- KerbUpdateAddressesMessage,
- KerbPurgeTicketCacheMessage,
- KerbChangePasswordMessage,
- KerbRetrieveEncodedTicketMessage,
- KerbDecryptDataMessage,
- KerbAddBindingCacheEntryMessage,
- KerbSetPasswordMessage,
- KerbSetPasswordExMessage,
- KerbVerifyCredentialsMessage,
- KerbQueryTicketCacheExMessage,
- KerbPurgeTicketCacheExMessage,
- KerbRefreshSmartcardCredentialsMessage,
- KerbAddExtraCredentialsMessage,
- KerbQuerySupplementalCredentialsMessage);
- {$EXTERNALSYM _KERB_PROTOCOL_MESSAGE_TYPE}
- KERB_PROTOCOL_MESSAGE_TYPE = _KERB_PROTOCOL_MESSAGE_TYPE;
- {$EXTERNALSYM KERB_PROTOCOL_MESSAGE_TYPE}
- PKERB_PROTOCOL_MESSAGE_TYPE = ^KERB_PROTOCOL_MESSAGE_TYPE;
- {$EXTERNALSYM PKERB_PROTOCOL_MESSAGE_TYPE}
- TKerbProtocolMessageType = KERB_PROTOCOL_MESSAGE_TYPE;
- PKerbProtocolMessageType = PKERB_PROTOCOL_MESSAGE_TYPE;
- //
- // Used both for retrieving tickets and for querying ticket cache
- //
- PKERB_QUERY_TKT_CACHE_REQUEST = ^KERB_QUERY_TKT_CACHE_REQUEST;
- {$EXTERNALSYM PKERB_QUERY_TKT_CACHE_REQUEST}
- _KERB_QUERY_TKT_CACHE_REQUEST = record
- MessageType: KERB_PROTOCOL_MESSAGE_TYPE;
- LogonId: LUID;
- end;
- {$EXTERNALSYM _KERB_QUERY_TKT_CACHE_REQUEST}
- KERB_QUERY_TKT_CACHE_REQUEST = _KERB_QUERY_TKT_CACHE_REQUEST;
- {$EXTERNALSYM KERB_QUERY_TKT_CACHE_REQUEST}
- TKerbQueryTktCacheRequest = KERB_QUERY_TKT_CACHE_REQUEST;
- PKerbQueryTktCacheRequest = PKERB_QUERY_TKT_CACHE_REQUEST;
- PKERB_TICKET_CACHE_INFO = ^KERB_TICKET_CACHE_INFO;
- {$EXTERNALSYM PKERB_TICKET_CACHE_INFO}
- _KERB_TICKET_CACHE_INFO = record
- ServerName: UNICODE_STRING;
- RealmName: UNICODE_STRING;
- StartTime: LARGE_INTEGER;
- EndTime: LARGE_INTEGER;
- RenewTime: LARGE_INTEGER;
- EncryptionType: LONG;
- TicketFlags: ULONG;
- end;
- {$EXTERNALSYM _KERB_TICKET_CACHE_INFO}
- KERB_TICKET_CACHE_INFO = _KERB_TICKET_CACHE_INFO;
- {$EXTERNALSYM KERB_TICKET_CACHE_INFO}
- TKerbTicketCacheInfo = KERB_TICKET_CACHE_INFO;
- PKerbTicketCacheInfo = PKERB_TICKET_CACHE_INFO;
- _KERB_TICKET_CACHE_INFO_EX = record
- ClientName: UNICODE_STRING;
- ClientRealm: UNICODE_STRING;
- ServerName: UNICODE_STRING;
- ServerRealm: UNICODE_STRING;
- StartTime: LARGE_INTEGER;
- EndTime: LARGE_INTEGER;
- RenewTime: LARGE_INTEGER;
- EncryptionType: LONG;
- TicketFlags: ULONG;
- end;
- {$EXTERNALSYM _KERB_TICKET_CACHE_INFO_EX}
- KERB_TICKET_CACHE_INFO_EX = _KERB_TICKET_CACHE_INFO_EX;
- {$EXTERNALSYM KERB_TICKET_CACHE_INFO_EX}
- PKERB_TICKET_CACHE_INFO_EX = ^KERB_TICKET_CACHE_INFO_EX;
- {$EXTERNALSYM PKERB_TICKET_CACHE_INFO_EX}
- TKerbTicketCacheInfoEx = KERB_TICKET_CACHE_INFO_EX;
- PKerbTicketCacheInfoEx = PKERB_TICKET_CACHE_INFO_EX;
- PKERB_QUERY_TKT_CACHE_RESPONSE = ^KERB_QUERY_TKT_CACHE_RESPONSE;
- {$EXTERNALSYM PKERB_QUERY_TKT_CACHE_RESPONSE}
- _KERB_QUERY_TKT_CACHE_RESPONSE = record
- MessageType: KERB_PROTOCOL_MESSAGE_TYPE;
- CountOfTickets: ULONG;
- Tickets: array [0..ANYSIZE_ARRAY - 1] of KERB_TICKET_CACHE_INFO;
- end;
- {$EXTERNALSYM _KERB_QUERY_TKT_CACHE_RESPONSE}
- KERB_QUERY_TKT_CACHE_RESPONSE = _KERB_QUERY_TKT_CACHE_RESPONSE;
- {$EXTERNALSYM KERB_QUERY_TKT_CACHE_RESPONSE}
- TKerbQueryTktCacheResponse = KERB_QUERY_TKT_CACHE_RESPONSE;
- PKerbQueryTktCacheResponse = PKERB_QUERY_TKT_CACHE_RESPONSE;
- _KERB_QUERY_TKT_CACHE_EX_RESPONSE = record
- MessageType: KERB_PROTOCOL_MESSAGE_TYPE;
- CountOfTickets: ULONG;
- Tickets: array [0..ANYSIZE_ARRAY - 1] of KERB_TICKET_CACHE_INFO_EX;
- end;
- {$EXTERNALSYM _KERB_QUERY_TKT_CACHE_EX_RESPONSE}
- KERB_QUERY_TKT_CACHE_EX_RESPONSE = _KERB_QUERY_TKT_CACHE_EX_RESPONSE;
- {$EXTERNALSYM KERB_QUERY_TKT_CACHE_EX_RESPONSE}
- PKERB_QUERY_TKT_CACHE_EX_RESPONSE = ^KERB_QUERY_TKT_CACHE_EX_RESPONSE;
- {$EXTERNALSYM PKERB_QUERY_TKT_CACHE_EX_RESPONSE}
- TKerbQueryTktCacheExResponse = KERB_QUERY_TKT_CACHE_EX_RESPONSE;
- PKerbQueryTktCacheExResponse = PKERB_QUERY_TKT_CACHE_EX_RESPONSE;
- //
- // Types for retrieving encoded ticket from the cache
- //
- _SecHandle = record
- dwLower: ULONG_PTR;
- dwUpper: ULONG_PTR;
- end;
- {$EXTERNALSYM _SecHandle}
- SecHandle = _SecHandle;
- {$EXTERNALSYM SecHandle}
- PSecHandle = ^SecHandle;
- {$EXTERNALSYM PSecHandle}
- // Ticket Flags
- const
- KERB_USE_DEFAULT_TICKET_FLAGS = $0;
- {$EXTERNALSYM KERB_USE_DEFAULT_TICKET_FLAGS}
- // CacheOptions
- KERB_RETRIEVE_TICKET_DEFAULT = $0;
- {$EXTERNALSYM KERB_RETRIEVE_TICKET_DEFAULT}
- KERB_RETRIEVE_TICKET_DONT_USE_CACHE = $1;
- {$EXTERNALSYM KERB_RETRIEVE_TICKET_DONT_USE_CACHE}
- KERB_RETRIEVE_TICKET_USE_CACHE_ONLY = $2;
- {$EXTERNALSYM KERB_RETRIEVE_TICKET_USE_CACHE_ONLY}
- KERB_RETRIEVE_TICKET_USE_CREDHANDLE = $4;
- {$EXTERNALSYM KERB_RETRIEVE_TICKET_USE_CREDHANDLE}
- KERB_RETRIEVE_TICKET_AS_KERB_CRED = $8;
- {$EXTERNALSYM KERB_RETRIEVE_TICKET_AS_KERB_CRED}
- KERB_RETRIEVE_TICKET_WITH_SEC_CRED = $10;
- {$EXTERNALSYM KERB_RETRIEVE_TICKET_WITH_SEC_CRED}
- // Encryption Type options
- KERB_ETYPE_DEFAULT = $0; // don't specify etype in tkt req.
- {$EXTERNALSYM KERB_ETYPE_DEFAULT}
- type
- _KERB_AUTH_DATA = record
- Type_: ULONG;
- Length: ULONG;
- Data: PUCHAR;
- end;
- {$EXTERNALSYM _KERB_AUTH_DATA}
- KERB_AUTH_DATA = _KERB_AUTH_DATA;
- {$EXTERNALSYM KERB_AUTH_DATA}
- PKERB_AUTH_DATA = ^KERB_AUTH_DATA;
- {$EXTERNALSYM PKERB_AUTH_DATA}
- TKerbAuthData = KERB_AUTH_DATA;
- PKerbAuthData = PKERB_AUTH_DATA;
- _KERB_NET_ADDRESS = record
- Family: ULONG;
- Length: ULONG;
- Address: PCHAR;
- end;
- {$EXTERNALSYM _KERB_NET_ADDRESS}
- KERB_NET_ADDRESS = _KERB_NET_ADDRESS;
- {$EXTERNALSYM KERB_NET_ADDRESS}
- PKERB_NET_ADDRESS = ^KERB_NET_ADDRESS;
- {$EXTERNALSYM PKERB_NET_ADDRESS}
- TKerbNetAddress = KERB_NET_ADDRESS;
- PKerbNetAddress = PKERB_NET_ADDRESS;
- _KERB_NET_ADDRESSES = record
- Number: ULONG;
- Addresses: array [0..ANYSIZE_ARRAY - 1] of KERB_NET_ADDRESS;
- end;
- {$EXTERNALSYM _KERB_NET_ADDRESSES}
- KERB_NET_ADDRESSES = _KERB_NET_ADDRESSES;
- {$EXTERNALSYM KERB_NET_ADDRESSES}
- PKERB_NET_ADDRESSES = ^KERB_NET_ADDRESSES;
- {$EXTERNALSYM PKERB_NET_ADDRESSES}
- TKerbNetAddresses = KERB_NET_ADDRESSES;
- PKerbNetAddresses = PKERB_NET_ADDRESSES;
- //
- // Types for the information about a ticket
- //
- type
- PKERB_EXTERNAL_NAME = ^KERB_EXTERNAL_NAME;
- {$EXTERNALSYM PKERB_EXTERNAL_NAME}
- _KERB_EXTERNAL_NAME = record
- NameType: SHORT;
- NameCount: USHORT;
- Names: array [0..ANYSIZE_ARRAY - 1] of UNICODE_STRING;
- end;
- {$EXTERNALSYM _KERB_EXTERNAL_NAME}
- KERB_EXTERNAL_NAME = _KERB_EXTERNAL_NAME;
- {$EXTERNALSYM KERB_EXTERNAL_NAME}
- TKerbExternalName = KERB_EXTERNAL_NAME;
- PKerbExternalName = PKERB_EXTERNAL_NAME;
- PKERB_EXTERNAL_TICKET = ^KERB_EXTERNAL_TICKET;
- {$EXTERNALSYM PKERB_EXTERNAL_TICKET}
- _KERB_EXTERNAL_TICKET = record
- ServiceName: PKERB_EXTERNAL_NAME;
- TargetName: PKERB_EXTERNAL_NAME;
- ClientName: PKERB_EXTERNAL_NAME;
- DomainName: UNICODE_STRING;
- TargetDomainName: UNICODE_STRING; // contains ClientDomainName
- AltTargetDomainName: UNICODE_STRING;
- SessionKey: KERB_CRYPTO_KEY;
- TicketFlags: ULONG;
- Flags: ULONG;
- KeyExpirationTime: LARGE_INTEGER;
- StartTime: LARGE_INTEGER;
- EndTime: LARGE_INTEGER;
- RenewUntil: LARGE_INTEGER;
- TimeSkew: LARGE_INTEGER;
- EncodedTicketSize: ULONG;
- EncodedTicket: PUCHAR;
- end;
- {$EXTERNALSYM _KERB_EXTERNAL_TICKET}
- KERB_EXTERNAL_TICKET = _KERB_EXTERNAL_TICKET;
- {$EXTERNALSYM KERB_EXTERNAL_TICKET}
- TKerbExternalTicket = KERB_EXTERNAL_TICKET;
- PKerbExternalTicket = PKERB_EXTERNAL_TICKET;
- _KERB_RETRIEVE_TKT_REQUEST = record
- MessageType: KERB_PROTOCOL_MESSAGE_TYPE;
- LogonId: LUID;
- TargetName: UNICODE_STRING;
- TicketFlags: ULONG;
- CacheOptions: ULONG;
- EncryptionType: LONG;
- CredentialsHandle: SecHandle;
- end;
- {$EXTERNALSYM _KERB_RETRIEVE_TKT_REQUEST}
- KERB_RETRIEVE_TKT_REQUEST = _KERB_RETRIEVE_TKT_REQUEST;
- {$EXTERNALSYM KERB_RETRIEVE_TKT_REQUEST}
- PKERB_RETRIEVE_TKT_REQUEST = ^KERB_RETRIEVE_TKT_REQUEST;
- {$EXTERNALSYM PKERB_RETRIEVE_TKT_REQUEST}
- TKerbRetrieveTktRequest = KERB_RETRIEVE_TKT_REQUEST;
- PKerbRetrieveTktRequest = PKERB_RETRIEVE_TKT_REQUEST;
- PKERB_RETRIEVE_TKT_RESPONSE = ^KERB_RETRIEVE_TKT_RESPONSE;
- {$EXTERNALSYM PKERB_RETRIEVE_TKT_RESPONSE}
- _KERB_RETRIEVE_TKT_RESPONSE = record
- Ticket: KERB_EXTERNAL_TICKET;
- end;
- {$EXTERNALSYM _KERB_RETRIEVE_TKT_RESPONSE}
- KERB_RETRIEVE_TKT_RESPONSE = _KERB_RETRIEVE_TKT_RESPONSE;
- {$EXTERNALSYM KERB_RETRIEVE_TKT_RESPONSE}
- TKerbRetrieveTktResponse = KERB_RETRIEVE_TKT_RESPONSE;
- PKerbRetrieveTktResponse = PKERB_RETRIEVE_TKT_RESPONSE;
- //
- // Used to purge entries from the ticket cache
- //
- PKERB_PURGE_TKT_CACHE_REQUEST = ^KERB_PURGE_TKT_CACHE_REQUEST;
- {$EXTERNALSYM PKERB_PURGE_TKT_CACHE_REQUEST}
- _KERB_PURGE_TKT_CACHE_REQUEST = record
- MessageType: KERB_PROTOCOL_MESSAGE_TYPE;
- LogonId: LUID;
- ServerName: UNICODE_STRING;
- RealmName: UNICODE_STRING;
- end;
- {$EXTERNALSYM _KERB_PURGE_TKT_CACHE_REQUEST}
- KERB_PURGE_TKT_CACHE_REQUEST = _KERB_PURGE_TKT_CACHE_REQUEST;
- {$EXTERNALSYM KERB_PURGE_TKT_CACHE_REQUEST}
- TKerbPurgeTktCacheRequest = KERB_PURGE_TKT_CACHE_REQUEST;
- PKerbPurgeTktCacheRequest = PKERB_PURGE_TKT_CACHE_REQUEST;
- //
- // Flags for purge requests
- //
- const
- KERB_PURGE_ALL_TICKETS = 1;
- {$EXTERNALSYM KERB_PURGE_ALL_TICKETS}
- type
- _KERB_PURGE_TKT_CACHE_EX_REQUEST = record
- MessageType: KERB_PROTOCOL_MESSAGE_TYPE;
- LogonId: LUID;
- Flags: ULONG;
- TicketTemplate: KERB_TICKET_CACHE_INFO_EX;
- end;
- {$EXTERNALSYM _KERB_PURGE_TKT_CACHE_EX_REQUEST}
- KERB_PURGE_TKT_CACHE_EX_REQUEST = _KERB_PURGE_TKT_CACHE_EX_REQUEST;
- {$EXTERNALSYM KERB_PURGE_TKT_CACHE_EX_REQUEST}
- PKERB_PURGE_TKT_CACHE_EX_REQUEST = ^KERB_PURGE_TKT_CACHE_EX_REQUEST;
- {$EXTERNALSYM PKERB_PURGE_TKT_CACHE_EX_REQUEST}
- TKerbPurgeTktCacheExRequest = KERB_PURGE_TKT_CACHE_EX_REQUEST;
- PKerbPurgeTktCacheExRequest = PKERB_PURGE_TKT_CACHE_EX_REQUEST;
- //
- // KerbChangePassword
- //
- // KerbChangePassword changes the password on the KDC account plus
- // the password cache and logon credentials if applicable.
- //
- //
- PKERB_CHANGEPASSWORD_REQUEST = ^KERB_CHANGEPASSWORD_REQUEST;
- {$EXTERNALSYM PKERB_CHANGEPASSWORD_REQUEST}
- _KERB_CHANGEPASSWORD_REQUEST = record
- MessageType: KERB_PROTOCOL_MESSAGE_TYPE;
- DomainName: UNICODE_STRING;
- AccountName: UNICODE_STRING;
- OldPassword: UNICODE_STRING;
- NewPassword: UNICODE_STRING;
- Impersonating: ByteBool;
- end;
- {$EXTERNALSYM _KERB_CHANGEPASSWORD_REQUEST}
- KERB_CHANGEPASSWORD_REQUEST = _KERB_CHANGEPASSWORD_REQUEST;
- {$EXTERNALSYM KERB_CHANGEPASSWORD_REQUEST}
- TKerbChangepasswordRequest = KERB_CHANGEPASSWORD_REQUEST;
- PKerbChangepasswordRequest = PKERB_CHANGEPASSWORD_REQUEST;
- //
- // KerbSetPassword
- //
- // KerbSetPassword changes the password on the KDC account plus
- // the password cache and logon credentials if applicable.
- //
- //
- PKERB_SETPASSWORD_REQUEST = ^KERB_SETPASSWORD_REQUEST;
- {$EXTERNALSYM PKERB_SETPASSWORD_REQUEST}
- _KERB_SETPASSWORD_REQUEST = record
- MessageType: KERB_PROTOCOL_MESSAGE_TYPE;
- LogonId: LUID;
- CredentialsHandle: SecHandle;
- Flags: ULONG;
- DomainName: UNICODE_STRING;
- AccountName: UNICODE_STRING;
- Password: UNICODE_STRING;
- end;
- {$EXTERNALSYM _KERB_SETPASSWORD_REQUEST}
- KERB_SETPASSWORD_REQUEST = _KERB_SETPASSWORD_REQUEST;
- {$EXTERNALSYM KERB_SETPASSWORD_REQUEST}
- TKerbSetpasswordRequest = KERB_SETPASSWORD_REQUEST;
- PKerbSetpasswordRequest = PKERB_SETPASSWORD_REQUEST;
- _KERB_SETPASSWORD_EX_REQUEST = record
- MessageType: KERB_PROTOCOL_MESSAGE_TYPE;
- LogonId: LUID;
- CredentialsHandle: SecHandle;
- Flags: ULONG;
- AccountRealm: UNICODE_STRING;
- AccountName: UNICODE_STRING;
- Password: UNICODE_STRING;
- ClientRealm: UNICODE_STRING;
- ClientName: UNICODE_STRING;
- Impersonating: BOOLEAN;
- KdcAddress: UNICODE_STRING;
- KdcAddressType: ULONG;
- end;
- {$EXTERNALSYM _KERB_SETPASSWORD_EX_REQUEST}
- KERB_SETPASSWORD_EX_REQUEST = _KERB_SETPASSWORD_EX_REQUEST;
- {$EXTERNALSYM KERB_SETPASSWORD_EX_REQUEST}
- PKERB_SETPASSWORD_EX_REQUEST = ^KERB_SETPASSWORD_EX_REQUEST;
- {$EXTERNALSYM PKERB_SETPASSWORD_EX_REQUEST}
- TKerbSetPasswordExRequest = KERB_SETPASSWORD_EX_REQUEST;
- PKerbSetPasswordExRequest = PKERB_SETPASSWORD_EX_REQUEST;
- const
- DS_UNKNOWN_ADDRESS_TYPE = 0; // anything *but* IP
- {$EXTERNALSYM DS_UNKNOWN_ADDRESS_TYPE}
- KERB_SETPASS_USE_LOGONID = 1;
- {$EXTERNALSYM KERB_SETPASS_USE_LOGONID}
- KERB_SETPASS_USE_CREDHANDLE = 2;
- {$EXTERNALSYM KERB_SETPASS_USE_CREDHANDLE}
- type
- PKERB_DECRYPT_REQUEST = ^KERB_DECRYPT_REQUEST;
- {$EXTERNALSYM PKERB_DECRYPT_REQUEST}
- _KERB_DECRYPT_REQUEST = record
- MessageType: KERB_PROTOCOL_MESSAGE_TYPE;
- LogonId: LUID;
- Flags: ULONG;
- CryptoType: LONG;
- KeyUsage: LONG;
- Key: KERB_CRYPTO_KEY; // optional
- EncryptedDataSize: ULONG;
- InitialVectorSize: ULONG;
- InitialVector: PUCHAR;
- EncryptedData: PUCHAR;
- end;
- {$EXTERNALSYM _KERB_DECRYPT_REQUEST}
- KERB_DECRYPT_REQUEST = _KERB_DECRYPT_REQUEST;
- {$EXTERNALSYM KERB_DECRYPT_REQUEST}
- TKerbDecryptRequest = KERB_DECRYPT_REQUEST;
- PKerbDecryptRequest = PKERB_DECRYPT_REQUEST;
- //
- // If set, use the primary key from the current logon session of the one provided in the LogonId field.
- // Otherwise, use the Key in the KERB_DECRYPT_MESSAGE.
- const
- KERB_DECRYPT_FLAG_DEFAULT_KEY = $00000001;
- {$EXTERNALSYM KERB_DECRYPT_FLAG_DEFAULT_KEY}
- type
- PKERB_DECRYPT_RESPONSE = ^KERB_DECRYPT_RESPONSE;
- {$EXTERNALSYM PKERB_DECRYPT_RESPONSE}
- _KERB_DECRYPT_RESPONSE = record
- DecryptedData: array [0..ANYSIZE_ARRAY - 1] of UCHAR;
- end;
- {$EXTERNALSYM _KERB_DECRYPT_RESPONSE}
- KERB_DECRYPT_RESPONSE = _KERB_DECRYPT_RESPONSE;
- {$EXTERNALSYM KERB_DECRYPT_RESPONSE}
- TKerbDecryptResponse = KERB_DECRYPT_RESPONSE;
- PKerbDecryptResponse = PKERB_DECRYPT_RESPONSE;
- //
- // Request structure for adding a binding cache entry. TCB privilege
- // is required for this operation.
- //
- PKERB_ADD_BINDING_CACHE_ENTRY_REQUEST = ^KERB_ADD_BINDING_CACHE_ENTRY_REQUEST;
- {$EXTERNALSYM PKERB_ADD_BINDING_CACHE_ENTRY_REQUEST}
- _KERB_ADD_BINDING_CACHE_ENTRY_REQUEST = record
- MessageType: KERB_PROTOCOL_MESSAGE_TYPE;
- RealmName: UNICODE_STRING;
- KdcAddress: UNICODE_STRING;
- AddressType: ULONG; //dsgetdc.h DS_NETBIOS_ADDRESS||DS_INET_ADDRESS
- end;
- {$EXTERNALSYM _KERB_ADD_BINDING_CACHE_ENTRY_REQUEST}
- KERB_ADD_BINDING_CACHE_ENTRY_REQUEST = _KERB_ADD_BINDING_CACHE_ENTRY_REQUEST;
- {$EXTERNALSYM KERB_ADD_BINDING_CACHE_ENTRY_REQUEST}
- TKerbAddBindingCacheEntryRequest = KERB_ADD_BINDING_CACHE_ENTRY_REQUEST;
- PKerbAddBindingCacheEntryRequest = PKERB_ADD_BINDING_CACHE_ENTRY_REQUEST;
- //
- // Request structure for reacquiring smartcard credentials for a
- // given LUID.
- // Requires TCB.
- //
- _KERB_REFRESH_SCCRED_REQUEST = record
- MessageType: KERB_PROTOCOL_MESSAGE_TYPE;
- CredentialBlob: UNICODE_STRING; // optional
- LogonId: LUID;
- Flags: ULONG;
- end;
- {$EXTERNALSYM _KERB_REFRESH_SCCRED_REQUEST}
- KERB_REFRESH_SCCRED_REQUEST = _KERB_REFRESH_SCCRED_REQUEST;
- {$EXTERNALSYM KERB_REFRESH_SCCRED_REQUEST}
- PKERB_REFRESH_SCCRED_REQUEST = ^KERB_REFRESH_SCCRED_REQUEST;
- {$EXTERNALSYM PKERB_REFRESH_SCCRED_REQUEST}
- TKerbRefreshScCredRequest = KERB_REFRESH_SCCRED_REQUEST;
- PKerbRefreshScCredRequest = PKERB_REFRESH_SCCRED_REQUEST;
- //
- // Flags for KERB_REFRESH_SCCRED_REQUEST
- //
- // KERB_REFRESH_SCCRED_RELEASE
- // Release the smartcard handle for LUID
- //
- // KERB_REFRESH_SCCRED_GETTGT
- // Use the certificate hash in the blob to get a TGT for the logon
- // session.
- //
- const
- KERB_REFRESH_SCCRED_RELEASE = $0;
- {$EXTERNALSYM KERB_REFRESH_SCCRED_RELEASE}
- KERB_REFRESH_SCCRED_GETTGT = $1;
- {$EXTERNALSYM KERB_REFRESH_SCCRED_GETTGT}
- //
- // Request structure for adding extra Server credentials to a given
- // logon session. Only applicable during AcceptSecurityContext, and
- // requires TCB to alter "other" creds
- //
- type
- _KERB_ADD_CREDENTIALS_REQUEST = record
- MessageType: KERB_PROTOCOL_MESSAGE_TYPE;
- UserName: UNICODE_STRING;
- DomainName: UNICODE_STRING;
- Password: UNICODE_STRING;
- LogonId: LUID; // optional
- Flags: ULONG;
- end;
- {$EXTERNALSYM _KERB_ADD_CREDENTIALS_REQUEST}
- KERB_ADD_CREDENTIALS_REQUEST = _KERB_ADD_CREDENTIALS_REQUEST;
- {$EXTERNALSYM KERB_ADD_CREDENTIALS_REQUEST}
- PKERB_ADD_CREDENTIALS_REQUEST = ^KERB_ADD_CREDENTIALS_REQUEST;
- {$EXTERNALSYM PKERB_ADD_CREDENTIALS_REQUEST}
- TKerbAddCredentialsRequest = KERB_ADD_CREDENTIALS_REQUEST;
- PKerbAddCredentialsRequest = PKERB_ADD_CREDENTIALS_REQUEST;
- const
- KERB_REQUEST_ADD_CREDENTIAL = 1;
- {$EXTERNALSYM KERB_REQUEST_ADD_CREDENTIAL}
- KERB_REQUEST_REPLACE_CREDENTIAL = 2;
- {$EXTERNALSYM KERB_REQUEST_REPLACE_CREDENTIAL}
- KERB_REQUEST_REMOVE_CREDENTIAL = 4;
- {$EXTERNALSYM KERB_REQUEST_REMOVE_CREDENTIAL}
- implementation
- function LSA_SUCCESS(Error: NTSTATUS): BOOL;
- begin
- Result := LONG(Error) > 0;
- end;
- const
- secur32 = 'secur32.dll';
- advapi32 = 'advapi32.dll';
- {$IFDEF DYNAMIC_LINK}
- var
- _LsaRegisterLogonProcess: Pointer;
- function LsaRegisterLogonProcess;
- begin
- GetProcedureAddress(_LsaRegisterLogonProcess, secur32, 'LsaRegisterLogonProcess');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LsaRegisterLogonProcess]
- end;
- end;
- {$ELSE}
- function LsaRegisterLogonProcess; external secur32 name 'LsaRegisterLogonProcess';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LsaLogonUser: Pointer;
- function LsaLogonUser;
- begin
- GetProcedureAddress(_LsaLogonUser, secur32, 'LsaLogonUser');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LsaLogonUser]
- end;
- end;
- {$ELSE}
- function LsaLogonUser; external secur32 name 'LsaLogonUser';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LsaLookupAuthenticationPackage: Pointer;
- function LsaLookupAuthenticationPackage;
- begin
- GetProcedureAddress(_LsaLookupAuthenticationPackage, secur32, 'LsaLookupAuthenticationPackage');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LsaLookupAuthenticationPackage]
- end;
- end;
- {$ELSE}
- function LsaLookupAuthenticationPackage; external secur32 name 'LsaLookupAuthenticationPackage';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LsaFreeReturnBuffer: Pointer;
- function LsaFreeReturnBuffer;
- begin
- GetProcedureAddress(_LsaFreeReturnBuffer, secur32, 'LsaFreeReturnBuffer');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LsaFreeReturnBuffer]
- end;
- end;
- {$ELSE}
- function LsaFreeReturnBuffer; external secur32 name 'LsaFreeReturnBuffer';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LsaCallAuthenticationPackage: Pointer;
- function LsaCallAuthenticationPackage;
- begin
- GetProcedureAddress(_LsaCallAuthenticationPackage, secur32, 'LsaCallAuthenticationPackage');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LsaCallAuthenticationPackage]
- end;
- end;
- {$ELSE}
- function LsaCallAuthenticationPackage; external secur32 name 'LsaCallAuthenticationPackage';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LsaDeregisterLogonProcess: Pointer;
- function LsaDeregisterLogonProcess;
- begin
- GetProcedureAddress(_LsaDeregisterLogonProcess, secur32, 'LsaDeregisterLogonProcess');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LsaDeregisterLogonProcess]
- end;
- end;
- {$ELSE}
- function LsaDeregisterLogonProcess; external secur32 name 'LsaDeregisterLogonProcess';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LsaConnectUntrusted: Pointer;
- function LsaConnectUntrusted;
- begin
- GetProcedureAddress(_LsaConnectUntrusted, secur32, 'LsaConnectUntrusted');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LsaConnectUntrusted]
- end;
- end;
- {$ELSE}
- function LsaConnectUntrusted; external secur32 name 'LsaConnectUntrusted';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LsaFreeMemory: Pointer;
- function LsaFreeMemory;
- begin
- GetProcedureAddress(_LsaFreeMemory, advapi32, 'LsaFreeMemory');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LsaFreeMemory]
- end;
- end;
- {$ELSE}
- function LsaFreeMemory; external advapi32 name 'LsaFreeMemory';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LsaClose: Pointer;
- function LsaClose;
- begin
- GetProcedureAddress(_LsaClose, advapi32, 'LsaClose');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LsaClose]
- end;
- end;
- {$ELSE}
- function LsaClose; external advapi32 name 'LsaClose';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LsaOpenPolicy: Pointer;
- function LsaOpenPolicy;
- begin
- GetProcedureAddress(_LsaOpenPolicy, advapi32, 'LsaOpenPolicy');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LsaOpenPolicy]
- end;
- end;
- {$ELSE}
- function LsaOpenPolicy; external advapi32 name 'LsaOpenPolicy';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LsaEnumerateLogonSessions: Pointer;
- function LsaEnumerateLogonSessions;
- begin
- GetProcedureAddress(_LsaEnumerateLogonSessions, secur32, 'LsaEnumerateLogonSessions');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LsaEnumerateLogonSessions]
- end;
- end;
- {$ELSE}
- function LsaEnumerateLogonSessions; external secur32 name 'LsaEnumerateLogonSessions';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LsaGetLogonSessionData: Pointer;
- function LsaGetLogonSessionData;
- begin
- GetProcedureAddress(_LsaGetLogonSessionData, secur32, 'LsaGetLogonSessionData');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LsaGetLogonSessionData]
- end;
- end;
- {$ELSE}
- function LsaGetLogonSessionData; external secur32 name 'LsaGetLogonSessionData';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LsaQueryInformationPolicy: Pointer;
- function LsaQueryInformationPolicy;
- begin
- GetProcedureAddress(_LsaQueryInformationPolicy, advapi32, 'LsaQueryInformationPolicy');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LsaQueryInformationPolicy]
- end;
- end;
- {$ELSE}
- function LsaQueryInformationPolicy; external advapi32 name 'LsaQueryInformationPolicy';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LsaSetInformationPolicy: Pointer;
- function LsaSetInformationPolicy;
- begin
- GetProcedureAddress(_LsaSetInformationPolicy, advapi32, 'LsaSetInformationPolicy');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LsaSetInformationPolicy]
- end;
- end;
- {$ELSE}
- function LsaSetInformationPolicy; external advapi32 name 'LsaSetInformationPolicy';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LsaQueryDomainInformationPolicy: Pointer;
- function LsaQueryDomainInformationPolicy;
- begin
- GetProcedureAddress(_LsaQueryDomainInformationPolicy, advapi32, 'LsaQueryDomainInformationPolicy');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LsaQueryDomainInformationPolicy]
- end;
- end;
- {$ELSE}
- function LsaQueryDomainInformationPolicy; external advapi32 name 'LsaQueryDomainInformationPolicy';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LsaSetDomainInformationPolicy: Pointer;
- function LsaSetDomainInformationPolicy;
- begin
- GetProcedureAddress(_LsaSetDomainInformationPolicy, advapi32, 'LsaSetDomainInformationPolicy');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LsaSetDomainInformationPolicy]
- end;
- end;
- {$ELSE}
- function LsaSetDomainInformationPolicy; external advapi32 name 'LsaSetDomainInformationPolicy';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LsaRegisterPolicyChangeNot: Pointer;
- function LsaRegisterPolicyChangeNotification;
- begin
- GetProcedureAddress(_LsaRegisterPolicyChangeNot, secur32, 'LsaRegisterPolicyChangeNotification');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LsaRegisterPolicyChangeNot]
- end;
- end;
- {$ELSE}
- function LsaRegisterPolicyChangeNotification; external secur32 name 'LsaRegisterPolicyChangeNotification';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LsaUnregisterPolicyChangeNot: Pointer;
- function LsaUnregisterPolicyChangeNotification;
- begin
- GetProcedureAddress(_LsaUnregisterPolicyChangeNot, secur32, 'LsaUnregisterPolicyChangeNotification');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LsaUnregisterPolicyChangeNot]
- end;
- end;
- {$ELSE}
- function LsaUnregisterPolicyChangeNotification; external secur32 name 'LsaUnregisterPolicyChangeNotification';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LsaEnumerateTrustedDomains: Pointer;
- function LsaEnumerateTrustedDomains;
- begin
- GetProcedureAddress(_LsaEnumerateTrustedDomains, advapi32, 'LsaEnumerateTrustedDomains');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LsaEnumerateTrustedDomains]
- end;
- end;
- {$ELSE}
- function LsaEnumerateTrustedDomains; external advapi32 name 'LsaEnumerateTrustedDomains';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LsaLookupNames: Pointer;
- function LsaLookupNames;
- begin
- GetProcedureAddress(_LsaLookupNames, advapi32, 'LsaLookupNames');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LsaLookupNames]
- end;
- end;
- {$ELSE}
- function LsaLookupNames; external advapi32 name 'LsaLookupNames';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LsaLookupNames2: Pointer;
- function LsaLookupNames2;
- begin
- GetProcedureAddress(_LsaLookupNames2, advapi32, 'LsaLookupNames2');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LsaLookupNames2]
- end;
- end;
- {$ELSE}
- function LsaLookupNames2; external advapi32 name 'LsaLookupNames2';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LsaLookupSids: Pointer;
- function LsaLookupSids;
- begin
- GetProcedureAddress(_LsaLookupSids, advapi32, 'LsaLookupSids');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LsaLookupSids]
- end;
- end;
- {$ELSE}
- function LsaLookupSids; external advapi32 name 'LsaLookupSids';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LsaEnumAccountsWithUserRight: Pointer;
- function LsaEnumerateAccountsWithUserRight;
- begin
- GetProcedureAddress(_LsaEnumAccountsWithUserRight, advapi32, 'LsaEnumerateAccountsWithUserRight');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LsaEnumAccountsWithUserRight]
- end;
- end;
- {$ELSE}
- function LsaEnumerateAccountsWithUserRight; external advapi32 name 'LsaEnumerateAccountsWithUserRight';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LsaEnumerateAccountRights: Pointer;
- function LsaEnumerateAccountRights;
- begin
- GetProcedureAddress(_LsaEnumerateAccountRights, advapi32, 'LsaEnumerateAccountRights');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LsaEnumerateAccountRights]
- end;
- end;
- {$ELSE}
- function LsaEnumerateAccountRights; external advapi32 name 'LsaEnumerateAccountRights';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LsaAddAccountRights: Pointer;
- function LsaAddAccountRights;
- begin
- GetProcedureAddress(_LsaAddAccountRights, advapi32, 'LsaAddAccountRights');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LsaAddAccountRights]
- end;
- end;
- {$ELSE}
- function LsaAddAccountRights; external advapi32 name 'LsaAddAccountRights';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LsaRemoveAccountRights: Pointer;
- function LsaRemoveAccountRights;
- begin
- GetProcedureAddress(_LsaRemoveAccountRights, advapi32, 'LsaRemoveAccountRights');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LsaRemoveAccountRights]
- end;
- end;
- {$ELSE}
- function LsaRemoveAccountRights; external advapi32 name 'LsaRemoveAccountRights';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LsaOpenTrustedDomainByName: Pointer;
- function LsaOpenTrustedDomainByName;
- begin
- GetProcedureAddress(_LsaOpenTrustedDomainByName, advapi32, 'LsaOpenTrustedDomainByName');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LsaOpenTrustedDomainByName]
- end;
- end;
- {$ELSE}
- function LsaOpenTrustedDomainByName; external advapi32 name 'LsaOpenTrustedDomainByName';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LsaQueryTrustedDomainInfo: Pointer;
- function LsaQueryTrustedDomainInfo;
- begin
- GetProcedureAddress(_LsaQueryTrustedDomainInfo, advapi32, 'LsaQueryTrustedDomainInfo');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LsaQueryTrustedDomainInfo]
- end;
- end;
- {$ELSE}
- function LsaQueryTrustedDomainInfo; external advapi32 name 'LsaQueryTrustedDomainInfo';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LsaSetTrustedDomainInformation: Pointer;
- function LsaSetTrustedDomainInformation;
- begin
- GetProcedureAddress(_LsaSetTrustedDomainInformation, advapi32, 'LsaSetTrustedDomainInformation');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LsaSetTrustedDomainInformation]
- end;
- end;
- {$ELSE}
- function LsaSetTrustedDomainInformation; external advapi32 name 'LsaSetTrustedDomainInformation';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LsaDeleteTrustedDomain: Pointer;
- function LsaDeleteTrustedDomain;
- begin
- GetProcedureAddress(_LsaDeleteTrustedDomain, advapi32, 'LsaDeleteTrustedDomain');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LsaDeleteTrustedDomain]
- end;
- end;
- {$ELSE}
- function LsaDeleteTrustedDomain; external advapi32 name 'LsaDeleteTrustedDomain';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LsaQueryTrustedDomainInfoByName: Pointer;
- function LsaQueryTrustedDomainInfoByName;
- begin
- GetProcedureAddress(_LsaQueryTrustedDomainInfoByName, advapi32, 'LsaQueryTrustedDomainInfoByName');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LsaQueryTrustedDomainInfoByName]
- end;
- end;
- {$ELSE}
- function LsaQueryTrustedDomainInfoByName; external advapi32 name 'LsaQueryTrustedDomainInfoByName';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LsaSetTrustedDomainInfoByName: Pointer;
- function LsaSetTrustedDomainInfoByName;
- begin
- GetProcedureAddress(_LsaSetTrustedDomainInfoByName, advapi32, 'LsaSetTrustedDomainInfoByName');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LsaSetTrustedDomainInfoByName]
- end;
- end;
- {$ELSE}
- function LsaSetTrustedDomainInfoByName; external advapi32 name 'LsaSetTrustedDomainInfoByName';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LsaEnumerateTrustedDomainsEx: Pointer;
- function LsaEnumerateTrustedDomainsEx;
- begin
- GetProcedureAddress(_LsaEnumerateTrustedDomainsEx, advapi32, 'LsaEnumerateTrustedDomainsEx');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LsaEnumerateTrustedDomainsEx]
- end;
- end;
- {$ELSE}
- function LsaEnumerateTrustedDomainsEx; external advapi32 name 'LsaEnumerateTrustedDomainsEx';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LsaCreateTrustedDomainEx: Pointer;
- function LsaCreateTrustedDomainEx;
- begin
- GetProcedureAddress(_LsaCreateTrustedDomainEx, advapi32, 'LsaCreateTrustedDomainEx');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LsaCreateTrustedDomainEx]
- end;
- end;
- {$ELSE}
- function LsaCreateTrustedDomainEx; external advapi32 name 'LsaCreateTrustedDomainEx';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LsaQueryForestTrustInformation: Pointer;
- function LsaQueryForestTrustInformation;
- begin
- GetProcedureAddress(_LsaQueryForestTrustInformation, advapi32, 'LsaQueryForestTrustInformation');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LsaQueryForestTrustInformation]
- end;
- end;
- {$ELSE}
- function LsaQueryForestTrustInformation; external advapi32 name 'LsaQueryForestTrustInformation';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LsaSetForestTrustInformation: Pointer;
- function LsaSetForestTrustInformation;
- begin
- GetProcedureAddress(_LsaSetForestTrustInformation, advapi32, 'LsaSetForestTrustInformation');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LsaSetForestTrustInformation]
- end;
- end;
- {$ELSE}
- function LsaSetForestTrustInformation; external advapi32 name 'LsaSetForestTrustInformation';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LsaStorePrivateData: Pointer;
- function LsaStorePrivateData;
- begin
- GetProcedureAddress(_LsaStorePrivateData, advapi32, 'LsaStorePrivateData');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LsaStorePrivateData]
- end;
- end;
- {$ELSE}
- function LsaStorePrivateData; external advapi32 name 'LsaStorePrivateData';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LsaRetrievePrivateData: Pointer;
- function LsaRetrievePrivateData;
- begin
- GetProcedureAddress(_LsaRetrievePrivateData, advapi32, 'LsaRetrievePrivateData');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LsaRetrievePrivateData]
- end;
- end;
- {$ELSE}
- function LsaRetrievePrivateData; external advapi32 name 'LsaRetrievePrivateData';
- {$ENDIF DYNAMIC_LINK}
- {$IFDEF DYNAMIC_LINK}
- var
- _LsaNtStatusToWinError: Pointer;
- function LsaNtStatusToWinError;
- begin
- GetProcedureAddress(_LsaNtStatusToWinError, advapi32, 'LsaNtStatusToWinError');
- asm
- mov esp, ebp
- pop ebp
- jmp [_LsaNtStatusToWinError]
- end;
- end;
- {$ELSE}
- function LsaNtStatusToWinError; external advapi32 name 'LsaNtStatusToWinError';
- {$ENDIF DYNAMIC_LINK}
- end.