class Win32::SSPI::SSPIResult

Takes a return result from an SSPI function and interprets the value.

Constants

RESULT_MAP
SEC_E_INSUFFICIENT_MEMORY

These are generally returned by InitializeSecurityContext

SEC_E_INTERNAL_ERROR
SEC_E_INVALID_HANDLE
SEC_E_INVALID_TOKEN
SEC_E_LOGON_DENIED
SEC_E_NOT_OWNER

These are generally returned by AcquireCredentialsHandle

SEC_E_NO_AUTHENTICATING_AUTHORITY
SEC_E_NO_CREDENTIALS
SEC_E_OK

Good results

SEC_E_SECPKG_NOT_FOUND
SEC_E_TARGET_UNKNOWN
SEC_E_UNKNOWN_CREDENTIALS
SEC_E_UNSUPPORTED_FUNCTION
SEC_E_WRONG_PRINCIPAL
SEC_I_CONTINUE_NEEDED

Attributes

value [R]

Public Class Methods

new (value)
# File ext/win32/lib/win32/sspi.rb, line 188
def initialize(value)
  # convert to unsigned long
  value &= 0xffffffff
  raise "#{value.to_s(16)} is not a recognized result" unless RESULT_MAP.key? value
  @value = value
end

Public Instance Methods

== (other)
# File ext/win32/lib/win32/sspi.rb, line 203
def ==(other)
  case other
  when SSPIResult
    @value == other.value
  when Integer
    @value == other
  when Symbol
    RESULT_MAP[@value] == other
  else
    false
  end
end
ok? ()
# File ext/win32/lib/win32/sspi.rb, line 199
def ok?
  @value == SEC_I_CONTINUE_NEEDED || @value == SEC_E_OK
end
to_s ()
# File ext/win32/lib/win32/sspi.rb, line 195
def to_s
  RESULT_MAP[@value].to_s
end