Class: RubySMB::Field::NtStatus

Inherits:
BinData::Primitive
  • Object
show all
Defined in:
lib/ruby_smb/field/nt_status.rb

Overview

Represents an NTStatus code as defined in 2.3.1 NTSTATUS values

Instance Method Summary collapse

Instance Method Details

#getObject



11
12
13
# File 'lib/ruby_smb/field/nt_status.rb', line 11

def get
  val.to_i
end

#set(value) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/ruby_smb/field/nt_status.rb', line 15

def set(value)
  case value
  when WindowsError::ErrorCode
    set(value.value)
  when Integer
    self.val = value
  else
    self.val = value.to_i
  end
  val
end

#to_nt_statusWindowsError::ErrorCode

Returns a meaningful error code parsed from the numeric value

Returns:

  • (WindowsError::ErrorCode)

    the ErrorCode object for this code



30
31
32
# File 'lib/ruby_smb/field/nt_status.rb', line 30

def to_nt_status
  WindowsError::NTStatus.find_by_retval(value).first
end