Private Type SecPkgInfo fCapabilities As Long wVersion As Integer wRPCID As Integer cbMaxToken As Long Name As Long Comment As Long End Type
Private Type SecHandle dwLower As Long dwUpper As Long End Type
Private Type AUTH_SEQ fInitialized As Boolean fHaveCredHandle As Boolean fHaveCtxtHandle As Boolean hcred As SecHandle hctxt As SecHandle End Type
Private Type SEC_WINNT_AUTH_IDENTITY User As String UserLength As Long Domain As String DomainLength As Long Password As String PasswordLength As Long Flags As Long End Type
Private Type SEC_WINNT_AUTH_IDENTITYL User As Long UserLength As Long Domain As Long DomainLength As Long Password As Long PasswordLength As Long Flags As Long End Type
Private Type TimeStamp LowPart As Long HighPart As Long End Type
Private Type SecBuffer cbBuffer As Long BufferType As Long pvBuffer As Long End Type
Private Type SecBufferDesc ulVersion As Long cBuffers As Long pBuffers As Long End Type
Private Type OSVERSIONINFO OSVSize As Long dwVerMajor As Long dwVerMinor As Long dwBuildNumber As Long PlatformID As Long szCSDVersion As String * 128 End Type
Private Declare Sub CopyMemory Lib "kernel32" _ Alias "RtlMoveMemory" _ (Destination As Any, _ Source As Any, _ ByVal Length As Long)
Private Declare Function CompleteAuthToken Lib "secur32" _ (ByRef phContext As SecHandle, _ ByRef pToken As SecBufferDesc) As Long
Private Declare Function DeleteSecurityContext Lib "secur32" _ (ByRef phContext As SecHandle) As Long
Private Declare Function FreeCredentialsHandle Lib "secur32" _ (ByRef phContext As SecHandle) As Long
Private Declare Function FreeContextBuffer Lib "secur32" _ (ByVal pvContextBuffer As Long) As Long
Private Declare Function GetProcessHeap Lib "kernel32" () As Long
Private Declare Function HeapAlloc Lib "kernel32" _ (ByVal hHeap As Long, _ ByVal dwFlags As Long, _ ByVal dwBytes As Long) As Long
Private Declare Function HeapFree Lib "kernel32" _ (ByVal hHeap As Long, _ ByVal dwFlags As Long, _ ByVal lpMem As Long) As Long
Private Declare Function GetVersionEx Lib "kernel32" _ Alias "GetVersionExA" _ (lpVersionInformation As OSVERSIONINFO) As Long
Private Declare Function QuerySecurityPackageInfo Lib "secur32" _ Alias "QuerySecurityPackageInfoA" _ (ByVal PackageName As String, _
ByRef pPackageInfo As Long) As Long
Private Declare Function InitializeSecurityContext Lib "secur32" _ Alias "InitializeSecurityContextA" _ (phCredential As Any, _ phContext As Any, _ ByVal pszTargetName As Long, _ ByVal fContextReq As Long, _ ByVal Reserved1 As Long, _ ByVal TargetDataRep As Long, _ pInput As Any, _ ByVal Reserved2 As Long, _ phNewContext As SecHandle, _ pOutput As SecBufferDesc, _ pfContextAttr As Long, _ ptsExpiry As TimeStamp) As Long