RE: [GD-Windows] retrieving the cluster size on xp
Brought to you by:
vexxed72
From: Carsten O. <car...@se...> - 2004-03-14 23:43:02
|
Erm... Show me _one_ *.vxd on a NT based OS. There ain't none. DeviceIoControl is _documented_ to be different on NT and 9x. If you rely on specific behaviour for portable code, you're doomed. OTOH, given the wide variety of filesystems on Win32 systems, why do you expect to find something like a cluster size at all? Why should it matter? You either write portable application code and shouldn't have to resort to native OS constants. Or you write OS specific code and then you'll have to face the differences. And you better know about them. 9x and NT/2K/XP _are_ different platforms. System information easily tells you that. Having nearly the same API on both of them is a mere convenience, not a guarantee. And: Your code crashes because CreateFile() returned NULL??? You'd better learn proper error handling before messing with my hard disk... Carsten Orthbandt Founder + Development Director SEK SpieleEntwicklungsKombinat GmbH http://www.sek-ost.de Wenn ich Visionen habe, gehe ich zum Arzt. - Helmut Schmidt > -----Original Message----- > From: gam...@li...=20 > [mailto:gam...@li...] On=20 > Behalf Of tweety > Sent: Sunday, March 14, 2004 10:37 PM > To: gam...@li... > Subject: RE: [GD-Windows] retrieving the cluster size on xp >=20 >=20 > I didn't explain myself properly... I wrote some=20 > deviceiocontrol code for wme/w98 and it craches because=20 > createfile on vmm32.vxd (or whatever) returns null.=20 > Getdiskfreespace works properly on my machine (then again, I=20 > have 32k and 4k clusters...). Still, there should be a=20 > function that works on ALL windowses and that returns the=20 > cluster size. >=20 > ---------------------------------- > Peace and love, > Tweety > mi...@sy... - twe...@us... > YahooID: tweety_04_01 >=20 >=20 >=20 > -----Original Message----- > From: gam...@li... > [mailto:gam...@li...] On=20 > Behalf Of Carsten Orthbandt > Sent: March 14, 2004 3:58 AM > To: gam...@li... > Subject: RE: [GD-Windows] retrieving the cluster size on xp >=20 > I'd bet some money on your source being the reason for=20 > crashing. The GetDiskFreeSpace API works fine for me on all=20 > flavours of Win32. I don't think you'll crash XP calling this=20 > function, it's your app. Generally, Win9x is much more=20 > forgiving when it comes to invalid memory accesses than the=20 > WinNT siblings. Wich is actually a good thing. >=20 > Carsten Orthbandt > Founder + Development Director > SEK SpieleEntwicklungsKombinat GmbH > http://www.sek-ost.de >=20 > Wenn ich Visionen habe, gehe ich zum Arzt. - Helmut Schmidt >=20 >=20 > > -----Original Message----- > > From: gam...@li... > > [mailto:gam...@li...]=20 > On Behalf Of > > tweety > > Sent: Sunday, March 14, 2004 5:02 AM > > To: gam...@li... > > Subject: RE: [GD-Windows] retrieving the cluster size on xp > >=20 > >=20 > > Ok, I'll try it. Thanks. By the way, I did it in w98/me a long time > > ago, it just crashes on xp... :) You know, I find really sad that=20 > > there's a function in *foxpro* to find the cluster size of=20 > a drive and=20 > > there's not ONE thing in the whole windows 32 api to return the=20 > > cluster size reliably in all operating systems... Maybe longhorn?... > >=20 > > ---------------------------------- > > Peace and love, > > Tweety > > mi...@sy... - twe...@us... > > YahooID: tweety_04_01 > >=20 > > =20 > >=20 > > -----Original Message----- > > From: gam...@li... > > [mailto:gam...@li...]=20 > On Behalf Of > > Simon O'Connor > > Sent: March 13, 2004 5:06 PM > > To: gam...@li... > > Subject: RE: [GD-Windows] retrieving the cluster size on xp > >=20 > >=20 > > Hi Tweety, > >=20 > >=20 > > GetDiskFreeSpace() is supported on Windows XP, Windows 2000, Windows > > NT, Windows Me, Windows 98, Windows 95, and Windows Server 2003... > >=20 > > My comments about 9x were just addressing your preference for a > > portable method. > >=20 > >=20 > > Cheers, > >=20 > > Simon O'Connor > > Programmer @ Acclaim > > & Microsoft DirectX MVP > >=20 > > > -----Original Message----- > > > From: gam...@li... > > > [mailto:gam...@li...] > > On Behalf Of > > > tweety > > > Sent: 13 March 2004 21:55 > > > To: gam...@li... > > > Subject: RE: [GD-Windows] retrieving the cluster size on xp > > >=20 > > > I specified in the subject that I'm interested in finding out the > > > cluster size (it's not a hint, but not partitionmagic, I'm > > just trying > > > to find out the waste of space on my drive) on *xp*, not=20 > 9x/me. And > > > I'd really, REALLY, REEEALY preffer not to go to the ddk... > > >=20 > > > ---------------------------------- > > > Peace and love, > > > Tweety > > > mi...@sy... - twe...@us... > > > YahooID: tweety_04_01 > > >=20 > > > =20 > > >=20 > > > -----Original Message----- > > > From: gam...@li... > > > [mailto:gam...@li...] > > On Behalf Of > > > Simon O'Connor > > > Sent: March 13, 2004 4:42 PM > > > To: gam...@li... > > > Subject: RE: [GD-Windows] retrieving the cluster size on xp > > >=20 > > >=20 > > > Hi Tweety, > > >=20 > > >=20 > > > You can use GetDiskFreeSpace() to find the number of sectors per > > > cluster and the number of bytes per sector so simply > > multiply them to > > > find the size of a cluster. > > >=20 > > >=20 > > > The docs for GetDiskFreeSpace() do mention that the=20 > returned sectors > > > per cluster value can be inaccurate under Windows 9x/ME=20 > for drives=20 > > > with more than 64 sectors per cluster (the 80Gb drive in > > this machine > > > only has 8 per cluster so it might be a fairly unusual case). > > >=20 > > > This is probably only an issue for you if your=20 > application needs to > > > use this for something more than a "hint" (e.g. if you're writing=20 > > > something like PartitionMagic etc). If you do need the totally=20 > > > accurate value, you could obtain the DDK and take a look at the=20 > > > Win9x/Me specific FS_GetDiskInfo() function. > > >=20 > > > =20 > > > Cheers, > > > =20 > > > Simon O'Connor > > > Programmer @ Acclaim > > > & Microsoft DirectX MVP > > >=20 > > >=20 > > > ________________________________ > > >=20 > > > From: gam...@li... > > > [mailto:gam...@li...] > > On Behalf Of > > > tweety > > > Sent: 11 March 2004 23:39 > > > To: gam...@li... > > > Subject: [GD-Windows] retrieving the cluster size on xp > > > =09 > > > =09 > > > Can someone please tell me how to get the cluster > > allocation size in > >=20 > > > windowsxp? of course, a portable way is the best, but just > > 2000/xp is > > > fine. > > > i searched the internet far and wide and all i could find=20 > is how to > > > find it on fat16/12 partitions and on w95/98/xp. i looked at=20 > > > deviceiocontrol's functions, but none seems to return the > > cluster size > > > or something that i could use... can you tell me? > > > =20 > > > ---------------------------------- > > > Peace and love, > > > Tweety > > > mi...@sy... - twe...@us... > > > YahooID: tweety_04_01 > > > =09 > > > =09 > > >=20 > > > --- > > > Incoming mail is certified Virus Free. > > > Checked by AVG anti-virus system (http://www.grisoft.com). > > > Version: 6.0.596 / Virus Database: 379 - Release Date:=20 > 26/02/2004 > > > =09 > > >=20 > > >=20 > > > --- > > > Outgoing mail is certified Virus Free. > > > Checked by AVG anti-virus system (http://www.grisoft.com). > > > Version: 6.0.596 / Virus Database: 379 - Release Date: 26/02/2004 > > > =20 > > >=20 > > >=20 > > >=20 > > > ------------------------------------------------------- > > > This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux > > > tutorial presented by Daniel Robbins, President and CEO of GenToo=20 > > > technologies. Learn everything from fundamentals to system > > >=20 > >=20 > = administration.http://ads.osdn.com/?ad_id=3D1470&alloc_id=3D3638&op=3Dcli= ck > > > _______________________________________________ > > > Gamedevlists-windows mailing list=20 > > > Gam...@li... > > > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > > > Archives:=20 > http://sourceforge.net/mailarchive/forum.php?forum_id=3D555 > > >=20 > > >=20 > > >=20 > > > ------------------------------------------------------- > > > This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux > > > tutorial presented by Daniel Robbins, President and CEO of GenToo=20 > > > technologies. Learn everything from fundamentals to system > > >=20 > >=20 > = administration.http://ads.osdn.com/?ad_id=3D1470&alloc_id=3D3638&op=3Dcli= ck > > > _______________________________________________ > > > Gamedevlists-windows mailing list=20 > > > Gam...@li... > > > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > > > Archives:=20 > http://sourceforge.net/mailarchive/forum.php?forum_id=3D555 > > >=20 > > > --- > > > Incoming mail is certified Virus Free. > > > Checked by AVG anti-virus system (http://www.grisoft.com). > > > Version: 6.0.596 / Virus Database: 379 - Release Date: 26/02/2004 > > > =20 > > >=20 > >=20 > > --- > > Outgoing mail is certified Virus Free. > > Checked by AVG anti-virus system (http://www.grisoft.com). > > Version: 6.0.596 / Virus Database: 379 - Release Date: 26/02/2004 > > =20 > >=20 > >=20 > >=20 > > ------------------------------------------------------- > > This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux > > tutorial presented by Daniel Robbins, President and CEO of GenToo=20 > > technologies. Learn everything from fundamentals to system=20 > >=20 > = administration.http://ads.osdn.com/?ad_id=3D1470&alloc_id=3D3638&op=3Dcli= ck > > _______________________________________________ > > Gamedevlists-windows mailing list > > Gam...@li... > > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > > Archives: = http://sourceforge.net/mailarchive/forum.php?forum_id=3D555 > >=20 > >=20 > >=20 > > ------------------------------------------------------- > > This SF.Net email is sponsored by: IBM Linux Tutorials > > Free Linux tutorial presented by Daniel Robbins, President > > and CEO of GenToo technologies. Learn everything from=20 > > fundamentals to system=20 > >=20 > = administration.http://ads.osdn.com/?ad_id=3D1470&alloc_id=3D3638&op=3Dcli= ck > > _______________________________________________ > > Gamedevlists-windows mailing list=20 > > Gam...@li... > > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > > Archives: = http://sourceforge.net/mailarchive/forum.php?forum_id=3D555 > >=20 >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id638&op=3Dick > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_idU5 >=20 >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id638&op=3Dick > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_idU5 >=20 |