Board index » Visual Studio » Sector Size

Sector Size

Visual Studio219
VB6 SP6

Need to get sector size of any hard disk.

Running Win XP.

GetDiskFreeSpace can do this for older OS, however reading the help

description implies bad data returned for sector size on larger>2G drives.



Also, where is Win32API.txt or .MDB or equivalent for things like

GetDiskFreeSpaceEX and other recent APIs?


-
 

Re:Sector Size

On Tue, 27 Dec 2005 22:30:02 -0800, "=?Utf-8?B?TG9yaW4=?="

<Lorin@discussions.microsoft.com>wrote:



Quote
VB6 SP6

Need to get sector size of any hard disk.

Running Win XP.

GetDiskFreeSpace can do this for older OS, however reading the help

description implies bad data returned for sector size on larger>2G drives.



I don't read it like that :-



<quote>

The GetDiskFreeSpace function returns incorrect values for volumes

that are larger than 2 gigabytes. The function caps the values stored

into *lpNumberOfFreeClusters and *lpTotalNumberOfClusters so as to

never report volume sizes that are greater than 2 gigabytes.



Even on volumes that are smaller than 2 gigabytes, the values stored

into *lpSectorsPerCluster, *

lpNumberOfFreeClusters, and *lpTotalNumberOfClusters values may be

incorrect. That is because the operating system manipulates the values

so that computations with them yield the correct volume size.

</quote>



The sector size should be Ok



Quote
Also, where is Win32API.txt or .MDB or equivalent for things like

GetDiskFreeSpaceEX and other recent APIs?



Get the downloadable API Guide (packed with examples) from

www.mentalis.org/agnet/">www.mentalis.org/agnet/

Also download their slightly dated API Viewer



This is a later API viewer :-



API Viewer 2004:

www.activevb.de/rubriken/apiviewer/index-apiviewereng.html">www.activevb.de/rubriken/apiviewer/index-apiviewereng.html

also http://trillian/vrc_app_main.asp







-