News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Detecting an NTFS volume

Started by sinsi, December 31, 2008, 04:50:04 AM

Previous topic - Next topic

sinsi

I've been playing around with checking fragmentation of a file using FSCTL_GET_RETRIEVAL_POINTERS, but this only works on NTFS volumes.
Is there an easy and approved way to check for NTFS? I can think of a few (GetVolumeInformation, reading the boot sector, opening $MFT) but there
seem to be workarounds.
Light travels faster than sound, that's why some people seem bright until you hear them.

donkey

GetVolumeInformation does the trick...

invoke GetVolumeInformation,offset DriveName,0,0,0,0,0,offset szFSName,64
invoke szCmpi,offset szFSName,"NTFS"


Pass the volume name for example "C:" in DriveName and the filesystem will be returned in szFSName. FSCTL_FILESYSTEM_GET_STATISTICS should also work.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

sinsi

Yeah, but I seem to remember reading that you can't rely on it (ralph?old msdn?).

Heh, the current MSDN info is really helpful...
Quote
lpFileSystemNameBuffer [out]
A pointer to a buffer that receives the name of the file system, for example, the FAT file system or the NTFS file system. The maximum buffer size is MAX_PATH+1.
I know it will be "FAT32" or "FAT16" or "NTFS", but good feckin explanation.  ::)
Light travels faster than sound, that's why some people seem bright until you hear them.