Class: RubySMB::Fscc::FileInformation::FileRenameInformation

Inherits:
BinData::Record
  • Object
show all
Defined in:
lib/ruby_smb/fscc/file_information/file_rename_information.rb

Overview

The FileRenameInformation Class as defined in 2.4.34.2 FileRenameInformation

Constant Summary collapse

CLASS_LEVEL =
FileInformation::FILE_RENAME_INFORMATION

Instance Method Summary collapse

Instance Method Details

#get_smb_version(obj = self) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/ruby_smb/fscc/file_information/file_rename_information.rb', line 26

def get_smb_version(obj = self)
  # Return version 1 by default in case the structure is not part of a
  # SMB packet. This way, we can still instantiate this structure
  # independently without breaking the "choice" logic.
  return 1 if obj.nil?
  smb_version = if obj.respond_to?(:smb_header)
                  1
                elsif obj.respond_to?(:smb2_header)
                  2
                else
                  get_smb_version(obj.parent)
                end
  return smb_version
end