Module: SecureRandom::Kernel32
- Extended by:
- Fiddle::Importer
- Defined in:
- lib/securerandom.rb
Overview
:nodoc:
Class Method Summary collapse
-
.last_error_message ⇒ Object
Following code is based on David Garamond’s GUID library for Ruby.
Class Method Details
.last_error_message ⇒ Object
Following code is based on David Garamond’s GUID library for Ruby.
82 83 84 85 86 87 88 89 90 |
# File 'lib/securerandom.rb', line 82 def self. = 0x00000200 = 0x00001000 code = GetLastError() msg = "\0" * 1024 len = FormatMessageA( + , 0, code, 0, msg, 1024, nil) msg[0, len].force_encoding("filesystem").tr("\r", '').chomp end |