Method: Windows::Functions.win_error

Defined in:
lib/win32/changenotify/functions.rb

.win_error(function, err = FFI.errno) ⇒ Object

Returns a nicer Windows error message



43
44
45
46
47
48
49
50
# File 'lib/win32/changenotify/functions.rb', line 43

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