Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2005 Mar : size of \\.\C:
| Subject: | size of \\.\C: |
| Posted by: | "Guenther Wimpassinger" (gw_spam@pickem.at) |
| Date: | Tue, 15 Mar 2005 19:55:08 |
Hi!
I open a device with
"\.\C:" or
"\.\PHYSICALDEVICE0"
Now, I want to know the size of the device. If I am using
DeviecIOControl with IOCTL_DISK_GET_DRIVE_GEOMETRY
the size for C: and PHYSICALDRIVE is the same, but the
Volume C is always smaller than the real physical drive,
especially if you have more than on volume on a disk
(partitions)
GetFileSize or
Seeking to the end and getting the position
(SetFilePointerEx) does not work, and the
OS return errors.
Seeking itself is working (at least seek to position 0
after some read operations)
Reading and Writing with ReadFile/WriteFile is not a
problem. (I am only I/Oing multiple of
DISK_GEOEMTRY.BytesPerSector)
But how do i know how much readoperations have to be
performed, without knowing the size of the volume?
any ideas?
Guenther