Sha256: 99bcaf5918f9e90ed9dba512c59ad17ea3430b4a67a0e1c2e9c0e86df5a3e890

Contents?: true

Size: 1.12 KB

Versions: 41

Compression:

Stored size: 1.12 KB

Contents

module RubySMB
  class Client
    module Winreg

      def connect_to_winreg(host)
        share = "\\\\#{host}\\IPC$"
        tree = @tree_connects.find {|tree| tree.share == share}
        tree = tree_connect(share) unless tree
        named_pipe = tree.open_pipe(filename: "winreg", write: true, read: true)
        if block_given?
          res = yield named_pipe
          named_pipe.close
          res
        else
          named_pipe
        end
      end

      def has_registry_key?(host, key)
        connect_to_winreg(host) do |named_pipe|
          named_pipe.has_registry_key?(key)
        end
      end

      def read_registry_key_value(host, key, value_name)
        connect_to_winreg(host) do |named_pipe|
          named_pipe.read_registry_key_value(key, value_name)
        end
      end

      def enum_registry_key(host, key)
        connect_to_winreg(host) do |named_pipe|
          named_pipe.enum_registry_key(key)
        end
      end

      def enum_registry_values(host, key)
        connect_to_winreg(host) do |named_pipe|
          named_pipe.enum_registry_values(key)
        end
      end

    end
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
ruby_smb-3.3.6 lib/ruby_smb/client/winreg.rb
ruby_smb-3.3.5 lib/ruby_smb/client/winreg.rb
ruby_smb-3.3.4 lib/ruby_smb/client/winreg.rb
ruby_smb-3.3.3 lib/ruby_smb/client/winreg.rb
ruby_smb-3.3.2 lib/ruby_smb/client/winreg.rb
ruby_smb-3.3.1 lib/ruby_smb/client/winreg.rb
ruby_smb-3.3.0 lib/ruby_smb/client/winreg.rb
ruby_smb-3.2.8 lib/ruby_smb/client/winreg.rb
ruby_smb-3.2.7 lib/ruby_smb/client/winreg.rb
ruby_smb-3.2.6 lib/ruby_smb/client/winreg.rb
ruby_smb-3.2.5 lib/ruby_smb/client/winreg.rb
ruby_smb-3.2.4 lib/ruby_smb/client/winreg.rb
ruby_smb-3.2.3 lib/ruby_smb/client/winreg.rb
ruby_smb-3.2.2 lib/ruby_smb/client/winreg.rb
ruby_smb-3.2.1 lib/ruby_smb/client/winreg.rb
ruby_smb-3.2.0 lib/ruby_smb/client/winreg.rb
ruby_smb-3.1.7 lib/ruby_smb/client/winreg.rb
ruby_smb-3.1.6 lib/ruby_smb/client/winreg.rb
ruby_smb-3.1.5 lib/ruby_smb/client/winreg.rb
ruby_smb-3.1.4 lib/ruby_smb/client/winreg.rb