\Storage Card doesn't always reload when ATADISK reloaded



On our (4.2) platform, we programmatically load/unload (dismount) the
\Storage Card and the ATADISK driver, based on the state of a switch on
our CompactFlash card door.

Most of the time, this works fine. However, it seems that if I unload,
then reload in quick succession (caused by someone opening then closing
the card door), then the \Storage Card filesystem doesn't always
reappear, even though ATADISK gets reloaded.

The unload sequence we follow is:
1. DismountStore() to dismount DSK1: (we have the reg configured so that
\Storage Card is always DSK1:). We don't (currently) wait for any
notification that the store has unloaded.
2. DeactivateDevice() for ATADISK.
3. Wait for a BLOCK_DRIVER_GUID notification that tells us that DSK1:
(ATADISK driver) has been removed.
4. Unload sequence is now complete, and we allow reloading (eg if the
door closes again).

The load sequence is:
1. ActivateDeviceEx() for ATADISK.
2. When ATADISK load is complete, it sends a BLOCK_DRIVER_GUID
notification, for the benefit of Storage Manager.
3. Storage Manager loads a FAT filesystem for each partition (we have
only one normally).
4. We wait for notification (FindFirstChangeNotification() for root
directory changes) that the \Storage Card directory has appeared.
5. Sequence complete - filesystem is now ready to use.

This all works nicely, as long as we don't unload, then reload too
quickly. If we do, the (re)load sequence fails at step 3 above.

What seems to happen (based on stepping through the code with the
debugger) is that Storage Manager's PnP thread receives the
BLOCK_DRIVER_GUID attach notification, and calls its MountStore()
function. That function then searches through its list of stores, and
finds a matching one that it marked as detached. It therefore marks it
as attached again (rather than its more usual call to AddStore()), and
then returns (without sending a STORE_MOUNT_GUID attach notification -
perhaps that is significant?).

In any case, the end result is that the \Storage Card filesystem doesn't
seem to be reloaded, as I don't get a filesystem notification for it (or
a STORE_MOUNT_GUID PnP notification - I've tried that approach too), and
I can't see it with the remote file viewer, or from an application.

Does anyone have any idea what might be going on here? Better still, how
can I get it to work (ie to always load the filesystem when ATADISK (re)
loads up)?
.



Relevant Pages

  • Re: Storage Card doesnt always reload when ATADISK reloaded
    ... The door switch is not in the CF spec and it does not really indicate the actual insertion state of the CF card. ... If your CF card is modeled after a PCMCIA card, then you can get notification of an insertion and removal by registering for PCMCIA event notifications. ... PCMCIA_CARD_REGISTER_CLIENT fnCardRegisterClient; PCMCIA_CARD_DEREGISTER_CLIENT fnCardDeregisterClient; ... However, it seems that if I unload, then reload in quick succession, then the \Storage Card filesystem doesn't always reappear, even though ATADISK gets reloaded. ...
    (microsoft.public.windowsce.platbuilder)
  • CE 6.0 CF card mount problem!
    ... CF Card, ... ATADISK: ... Dumping registry for key PCMCIA ... FSDMGR!LoadPartitionDriver: Loading partition driver mspart.dll ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Strange Paypal "Chargeback" claim
    ... Shortly after she received a notification via ebay that the ... and used the "refund payment" option to refund the paypal ... asked their card issuer to reverse a payment made to you. ... Although a chargeback may appear to be similar to a PayPal claim, ...
    (uk.people.consumers.ebay)
  • Strange Paypal "Chargeback" claim
    ... Shortly after she received a notification via ebay that the ... and used the "refund payment" option to refund the paypal ... asked their card issuer to reverse a payment made to you. ... Although a chargeback may appear to be similar to a PayPal claim, ...
    (uk.people.consumers.ebay)
  • Re: RequestDeviceNotifications for WLAN card
    ... Do you have to do something to the card before it can connect to a wireless ... I have an application that needs to get notification when ever a WLAN ... driver, However there is no generic CLSID for the WLAN SDIO driver (or ...
    (microsoft.public.windowsce.platbuilder)