[Win32utils-devel] DeviceIoControl + IOCTL_DISK_GET_DRIVE_GEOMETRY problem
Daniel.Berger at qwest.com
Tue May 6 17:05:04 EDT 2008
Ok, what am I doing wrong here?
fh = File.open('test.txt') # Assume you have this
handle = get_osfhandle(fh.fileno)
if handle == INVALID_HANDLE_VALUE
puts "get_osfhandle failed"
buf = 0.chr * 24 # sizeof(DISK_GEOMETRY)
bytes = .pack('L')
bool = DeviceIoControl(
IOCTL_DISK_GET_DRIVE_GEOMETRY(), # 458752
# Fails here
puts "DeviceIoControl failed: " + get_last_error
PS - I've added several IOCTL macro methods to Windows::DeviceIO in CVS
(part of windows-pr).
This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly
prohibited and may be unlawful. If you have received this communication
in error, please immediately notify the sender by reply e-mail and destroy
all copies of the communication and any attachments.
More information about the win32utils-devel