none
WinCE6: How to detect ExFAT format? RRS feed

  • Question

  • Hi all,

    I want to know if it is possible to detect if a partition is formated in FAT or exFAT ?

    I have added "FormatExFat" into the registry, but how can I be sure that the partition has been formated in exFAT and not in FAT32?

    Regards

    Fabrice

    Monday, March 21, 2011 2:48 PM

All replies

  • If you need to check it once, just to verify it, and you have a DOS with the debug utility you may dump the partition boot sector and check for "EXFAT " signature. Enabling DEBUGMSG in exfat.dll may also reveal something. I do not have on the top of my head some storemgr API to check it easily
    Luca Calligaris lucaDOTcalligarisATeurotechDOTcom www.eurotech.com Check my blog: http://lcalligaris.wordpress.com
    Monday, March 21, 2011 3:19 PM
  • With debugger you can see, if the File System driver calls function FormatVolumeInternalEx() or FormatVolumeInternal(). See file public\common\oak\drivers\fsd\fatutil\main\formatdisk.cpp.

    Monday, March 21, 2011 3:48 PM
  • Thanks for the link, I have take a look at those files and in scandisk.cpp, there is a call to a routine called IsVolumeExfat(), but I can't find any information about this routine.

    Is this routine available from exfat.dll ?

    Can I call it from C#?

    Monday, March 21, 2011 4:02 PM
  • By "dumpbin /exports fautil.dll", you can tell the IsVolumeExfat is not exported for external use.
    Although the source code of IsVolumenExfat is unavailable, but to implement your own IsVolumenExfat won't be too hard, either.
    The key is to read the boot sector of your volume, and then use Luca's suggestion: compare the the value from offset 0x03 to 0x0A (bsOemName filed dfines in public\COMMON\oak\drivers\fsd\fatutil\main\bootsec.h) is equal to "EXFAT   " (8 bytes), if so it should be a ExFAT Volume.
    To access boot sector, you may use the CScan::ReadBootSector of Scandisk.cpp as an example.

    Monday, March 21, 2011 9:13 PM
  • I found on Bruce Eitman blog a program example to monitor disk partition and get information about support and partitions.

    I have create this program and tested it on my board, and it seems that the NAND Flash partition is always formatted as FATFS and not EXFAT.

    I have formatted an USB Stick in exFAT to see if the tool will detect it, it says MSIFS as file system type. I think this is name for exFAT?!?

    To enable exFAT format for the NAND Flash, made following modification in registry

    [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\FlashDisk]
        "Name"="NAND FLASH Storage"
        "Folder"="NAND Flash"
        "DefaultFileSystem"="FATFS"
        "AutoMount"=dword:1
        "AutoPart"=dword:1
        "AutoFormat"=dword:1
        "MountPermanent"=dword:0
    [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\FlashDisk\FATFS]
        FormatExfat"=dword:1       ; Formatage en mode étendue

    What's wrong with this?

    Thanks for any help

    Regards

    Fabrice

    Wednesday, March 23, 2011 8:02 AM