Module: FFI
- Extended by:
- Library
- Defined in:
- lib/win32/windows/helper.rb
Class Method Summary collapse
- .raise_windows_error(function, err = FFI.errno) ⇒ Object
- .win_error(function, err = FFI.errno) ⇒ Object
Methods included from Library
Class Method Details
.raise_windows_error(function, err = FFI.errno) ⇒ Object
35 36 37 |
# File 'lib/win32/windows/helper.rb', line 35 def raise_windows_error(function, err=FFI.errno) raise SystemCallError.new(win_error(function, err), err) end |
.win_error(function, err = FFI.errno) ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/win32/windows/helper.rb', line 26 def win_error(function, err=FFI.errno) flags = 0x00001000 | 0x00000200 buf = FFI::MemoryPointer.new(:char, 1024) FormatMessage(flags, nil, err , 0x0409, buf, 1024, nil) function + ': ' + buf.read_string.strip end |