Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env ruby
- require 'win32/api'
- include Win32
- get_logical_drive_strings = API.new('GetLogicalDriveStrings', 'IP', 'I')
- BUFLEN = 260
- buf = 0.chr * BUFLEN
- rc = get_logical_drive_strings.call(BUFLEN, buf)
- if (0..BUFLEN) === rc
- puts buf[0..rc-1].split("\x00")
- else
- puts "buffer too small"
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement