[Win32utils-devel] Question about FindFirstVolumeMountPoint

Berger, Daniel Daniel.Berger at qwest.com
Wed Nov 26 09:34:17 EST 2008


Hi,

I can't seem to get FindFirstVolumeMountPoint to work. What am I doing
wrong?

require 'windows/volume'
require 'windows/handle'
require 'windows/error'

include Windows::Volume
include Windows::Handle
include Windows::Error

vol = 0.chr * 512
handle = FindFirstVolume(vol, vol.length)

if handle == INVALID_HANDLE_VALUE
   raise get_last_error
end

vol.strip!
p vol # => \\\\?\\Volume{b4379d44-726d-11dc-87ec-806d6112693f}\\

FindVolumeClose(handle)

mp = 0.chr * 260
mhandle = FindFirstVolumeMountPoint(vol, mp, mp.length)

if mhandle == INVALID_HANDLE_VALUE
   raise get_last_error # ERROR => There are no more files.
(RuntimeError)
end

p mp.strip

FindVolumeMountPointClose(mhandle)

I've probably misread the directions somewhere. Any suggestions?

Thanks,

Dan


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 mailing list