NTFS and removable media

My coworker is working on firmware for an USB flashdrive which pretends media change. Basically, it enables and disables access to data according to fingerprint verification. When not verified, it returns no media status. All works as expected with FastFat; media changes are detected as expected and user mode software sees new media. With NTFS it works only on the first attempt (no media -> media -> no media) and the next attempt to “insert” media isn’t recognized. User mode software doesn’t see new media and NTFS doesn’t try to access it. The only found way how to recover is to start Disk Manager and refresh drives. Then new media are recognized and everything works until next attempt to change.

He tried to test this problem with a smardcard reader and results were the same: no problem with FastFat and NTFS behaves as decribed above.

It seems as media changes are handled by ClassPnp driver which informs filesystems using DO_VERIFY_VOLUME flag. DDK/IFS kit docs recommends to looks at FastFat implementation for details how to handle this flag correctly. And there is no problem with FastFat in this case… Debug output from checked build ClassPnp about media change notification seem equal in both cases (no guarantee, I haven’t seen it).

Has anybody an experience with this area? We’d like to know if it matters to continue with experiments and try to persuade NTFS about media changes some way or simply give up and try to format FastFat partitions for more than 32 GB instead. No additional software installation (which’d make Disk Manager like refresh) is possible and it has to work with existing OSes (well, XP SP2 at least).

Thanks.

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]

IIRC NTFS does not support the DO_VERIFY_VOLUME media sense, you need to
explicitly dismount it.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Michal Vodicka”
To: “Windows File Systems Devs Interest List”
Sent: Tuesday, June 13, 2006 8:38 AM
Subject: [ntfsd] NTFS and removable media

My coworker is working on firmware for an USB flashdrive which pretends media
change. Basically, it enables and disables access to data according to
fingerprint verification. When not verified, it returns no media status. All
works as expected with FastFat; media changes are detected as expected and user
mode software sees new media. With NTFS it works only on the first attempt (no
media -> media -> no media) and the next attempt to “insert” media isn’t
recognized. User mode software doesn’t see new media and NTFS doesn’t try to
access it. The only found way how to recover is to start Disk Manager and
refresh drives. Then new media are recognized and everything works until next
attempt to change.

He tried to test this problem with a smardcard reader and results were the
same: no problem with FastFat and NTFS behaves as decribed above.

It seems as media changes are handled by ClassPnp driver which informs
filesystems using DO_VERIFY_VOLUME flag. DDK/IFS kit docs recommends to looks
at FastFat implementation for details how to handle this flag correctly. And
there is no problem with FastFat in this case… Debug output from checked
build ClassPnp about media change notification seem equal in both cases (no
guarantee, I haven’t seen it).

Has anybody an experience with this area? We’d like to know if it matters to
continue with experiments and try to persuade NTFS about media changes some way
or simply give up and try to format FastFat partitions for more than 32 GB
instead. No additional software installation (which’d make Disk Manager like
refresh) is possible and it has to work with existing OSes (well, XP SP2 at
least).

Thanks.

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

It can be even worse. My coworker claims if the code path in the ClassPnp driver which sets DO_VERIFY_VOLUME flag isn’t entered, NTFS is able to recognize media change. At XP, at w2k it is just opposite. If he is right, it’d seem as there is a mistakenly inverted condition which check this flag in the NTFS code.

BTW, does anybody know if NTFS officially supports removable media?

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]


From: xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com] on behalf of Maxim S. Shatskih[SMTP:xxxxx@storagecraft.com]
Reply To: Windows File Systems Devs Interest List
Sent: Tuesday, June 13, 2006 6:59 AM
To: Windows File Systems Devs Interest List
Subject: Re: [ntfsd] NTFS and removable media

IIRC NTFS does not support the DO_VERIFY_VOLUME media sense, you need to
explicitly dismount it.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Michal Vodicka”
> To: “Windows File Systems Devs Interest List”
> Sent: Tuesday, June 13, 2006 8:38 AM
> Subject: [ntfsd] NTFS and removable media
>
>
> My coworker is working on firmware for an USB flashdrive which pretends media
> change. Basically, it enables and disables access to data according to
> fingerprint verification. When not verified, it returns no media status. All
> works as expected with FastFat; media changes are detected as expected and user
> mode software sees new media. With NTFS it works only on the first attempt (no
> media -> media -> no media) and the next attempt to “insert” media isn’t
> recognized. User mode software doesn’t see new media and NTFS doesn’t try to
> access it. The only found way how to recover is to start Disk Manager and
> refresh drives. Then new media are recognized and everything works until next
> attempt to change.
>
> He tried to test this problem with a smardcard reader and results were the
> same: no problem with FastFat and NTFS behaves as decribed above.
>
> It seems as media changes are handled by ClassPnp driver which informs
> filesystems using DO_VERIFY_VOLUME flag. DDK/IFS kit docs recommends to looks
> at FastFat implementation for details how to handle this flag correctly. And
> there is no problem with FastFat in this case… Debug output from checked
> build ClassPnp about media change notification seem equal in both cases (no
> guarantee, I haven’t seen it).
>
> Has anybody an experience with this area? We’d like to know if it matters to
> continue with experiments and try to persuade NTFS about media changes some way
> or simply give up and try to format FastFat partitions for more than 32 GB
> instead. No additional software installation (which’d make Disk Manager like
> refresh) is possible and it has to work with existing OSes (well, XP SP2 at
> least).
>
> Thanks.
>
> Best regards,
>
> Michal Vodicka
> UPEK, Inc.
> [xxxxx@upek.com, http://www.upek.com]
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: unknown lmsubst tag argument: ‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
> —
> Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@upek.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

The last I heard about a year ago is NTFS does not support either removable
media or removable drives. Just too many issues with it. Doesn’t make a
lot of sense and Vista may have eased those rules some, but good luck
finding out how to get it correct.

“Michal Vodicka” wrote in message
news:xxxxx@ntfsd…
It can be even worse. My coworker claims if the code path in the ClassPnp
driver which sets DO_VERIFY_VOLUME flag isn’t entered, NTFS is able to
recognize media change. At XP, at w2k it is just opposite. If he is right,
it’d seem as there is a mistakenly inverted condition which check this flag
in the NTFS code.

BTW, does anybody know if NTFS officially supports removable media?

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]

> ----------
> From:
> xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com]
> on behalf of Maxim S. Shatskih[SMTP:xxxxx@storagecraft.com]
> Reply To: Windows File Systems Devs Interest List
> Sent: Tuesday, June 13, 2006 6:59 AM
> To: Windows File Systems Devs Interest List
> Subject: Re: [ntfsd] NTFS and removable media
>
> IIRC NTFS does not support the DO_VERIFY_VOLUME media sense, you need
> to
> explicitly dismount it.
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
> ----- Original Message -----
> From: “Michal Vodicka”
> To: “Windows File Systems Devs Interest List”
> Sent: Tuesday, June 13, 2006 8:38 AM
> Subject: [ntfsd] NTFS and removable media
>
>
> My coworker is working on firmware for an USB flashdrive which pretends
> media
> change. Basically, it enables and disables access to data according to
> fingerprint verification. When not verified, it returns no media status.
> All
> works as expected with FastFat; media changes are detected as expected and
> user
> mode software sees new media. With NTFS it works only on the first attempt
> (no
> media -> media -> no media) and the next attempt to “insert” media isn’t
> recognized. User mode software doesn’t see new media and NTFS doesn’t try
> to
> access it. The only found way how to recover is to start Disk Manager and
> refresh drives. Then new media are recognized and everything works until
> next
> attempt to change.
>
> He tried to test this problem with a smardcard reader and results were the
> same: no problem with FastFat and NTFS behaves as decribed above.
>
> It seems as media changes are handled by ClassPnp driver which informs
> filesystems using DO_VERIFY_VOLUME flag. DDK/IFS kit docs recommends to
> looks
> at FastFat implementation for details how to handle this flag correctly.
> And
> there is no problem with FastFat in this case… Debug output from checked
> build ClassPnp about media change notification seem equal in both cases
> (no
> guarantee, I haven’t seen it).
>
> Has anybody an experience with this area? We’d like to know if it matters
> to
> continue with experiments and try to persuade NTFS about media changes
> some way
> or simply give up and try to format FastFat partitions for more than 32 GB
> instead. No additional software installation (which’d make Disk Manager
> like
> refresh) is possible and it has to work with existing OSes (well, XP SP2
> at
> least).
>
> Thanks.
>
> Best regards,
>
> Michal Vodicka
> UPEK, Inc.
> [xxxxx@upek.com, http://www.upek.com]
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: unknown lmsubst tag argument: ‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@upek.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>