Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Dick cluster size

1 view
Skip to first unread message

mike c

unread,
Jan 21, 2002, 3:00:31 PM1/21/02
to
Hi:

According to the MSDN CD, GetDiskFreeSpace() returns incorrect values even
on volumes smaller than 2G under Win95 (see excerpt, below.) It says nothing
about win98,
but i figure there the same ( am I wrong? )

is there a good way to find out the cluster size (most important, now), and
other information that GetDiskFreeSpace() returns? GetDiskFreeSpaceEx()
doesn't return as much info.

I'll need this info for more recent OSs, also.

thanks for your help,
mike

"because the os manipulates the values ..." where'd it get the correct
values to start with?

from msdn cd:
Windows 95: For volumes that are larger than 2 gigabytes, the
GetDiskFreeSpace function may return misleading values. 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.


mike c

unread,
Jan 21, 2002, 3:05:26 PM1/21/02
to

mike c <cm...@ptd.net> wrote in message news:uBYFr8roBHA.1620@tkmsftngp02...

Navin Pai

unread,
Jan 23, 2002, 9:24:38 PM1/23/02
to
you can get the correct value from the boot sector. open the raw disk
("\\\\.\\c:", etc) and read the first 512 bytes. you will have the boot
sector which contains the information you required.

--
Regds
Navin
---------
Anti Spam: Replace "z" with "s" from email address before replying. Spammers
will be reported to the authorities.

"mike c" <cm...@ptd.net> wrote in message
news:uBYFr8roBHA.1620@tkmsftngp02...

Eric Gisin

unread,
Jan 24, 2002, 10:16:04 PM1/24/02
to
For Win95, local volumes are not larger than 2GB. I expect GetDickFreeSpace
is accurate in this case.

I suspect the "bug" is related to network volumes, were reading the boot
sector doesn't work.

"Navin Pai" <na...@aereouz.com> wrote in message
news:Orq7o3HpBHA.2328@tkmsftngp04...


| you can get the correct value from the boot sector. open the raw disk
| ("\\\\.\\c:", etc) and read the first 512 bytes. you will have the boot
| sector which contains the information you required.
|

Gary Chanson

unread,
Jan 27, 2002, 4:38:10 AM1/27/02
to

"Navin Pai" <na...@aereouz.com> wrote in message
news:Orq7o3HpBHA.2328@tkmsftngp04...
> you can get the correct value from the boot sector. open the raw disk
> ("\\\\.\\c:", etc) and read the first 512 bytes. you will have the boot
> sector which contains the information you required.

That won't help on Win9x, which is what the OP was asking about.

--

-GJC
-gcha...@shore.net

-War is the last resort of the incompetent.


Magnus Bäck

unread,
Jan 26, 2002, 7:32:41 AM1/26/02
to
On Thu, 24 Jan 2002 19:16:04 -0800,
"Eric Gisin" <er...@netidea.com> wrote:

> For Win95, local volumes are not larger than 2GB. I expect GetDickFreeSpace
> is accurate in this case.

This is true for the original Windows 95, but OSR2 introduced FAT32.

[...]

--
Magnus Bäck | CS/CE student, Lund Institute of Technology
ba...@swipnet.se | http://www.jpl.se/~magnus/english.html

mike c

unread,
Jan 31, 2002, 12:29:24 PM1/31/02
to
i looked into the mbr approach. (bytes/sector)*(sectors/cluster) should work
as long as dos mbrs don't /didn't change from what my refernce shows . i
know winders likes to be the only os on the drive. i hope system commander -
never mind ... SC loads the saved mbr to sec 0 when you select an OS to
boot.

as long as NT, 2k, win9x, and ME have the same mbr format, then i just need
to find functions to read the 1st sector in vcrt, ATL/COM, and API ( for
full knowlege of disk access.)

I know how to get the sector with Int 13h, but i remember a post where
someone mentioned using vwin32 functions for raw (? direct ?) disk access
instead.

what are my options? sorry i got back to this thread so late. i found the
info in the mbr and didn't come back to ask the above.

thanks,
mike

Navin Pai <na...@aereouz.com> wrote in message
news:Orq7o3HpBHA.2328@tkmsftngp04...

0 new messages