Class: WinNet::Bindings4

Inherits:
Object
  • Object
show all
Defined in:
lib/vmopt/windows/win_net.rb

Direct Known Subclasses

Bindings6

Instance Method Summary collapse

Constructor Details

#initializeBindings4

Returns a new instance of Bindings4.



203
204
205
# File 'lib/vmopt/windows/win_net.rb', line 203

def initialize
  @key = 'SYSTEM\CurrentControlSet\Services\Tcpip\Linkage'
end

Instance Method Details

#bindingsObject



207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# File 'lib/vmopt/windows/win_net.rb', line 207

def bindings
  require 'vmopt/utils/registry'
  bindings = {}

  Registry.hklm_read(@key, 'Bind').each_with_index do |entry, index|
    match_data = entry.match(/\\Device\\(\{.*\})/)
    unless match_data.nil?
      bindings[match_data[1]] = index
    end
  end

  bindings
rescue
  {}
end