Exception: Win32::Registry::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/win32/registry.rb

Overview

Error

Constant Summary collapse

FormatMessageA =
Win32API.new('kernel32.dll', 'FormatMessageA', 'LPLLPLP', 'L')

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code) ⇒ Error

Returns a new instance of Error.



338
339
340
341
342
343
# File 'lib/win32/registry.rb', line 338

def initialize(code)
  @code = code
  msg = "\0" * 1024
  len = FormatMessageA.call(0x1200, 0, code, 0, msg, 1024, 0)
  super msg[0, len].tr("\r", '').chomp
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code



344
345
346
# File 'lib/win32/registry.rb', line 344

def code
  @code
end