Detecting a USB drive after resuming from hibernate in HORM environment RRS feed

  • Question

  • Our image uses EWF + HORM.  We use USB sticks for attended, xcopy-based software updates from within WES7 (the WES7 image itself isn't updated in this scenario).  The USB stick is plugged into the system before it is turned on.

    To work with HORM, we have a small WPF app that does nothing but wait for the hibernate-resume system event (the SystemEvents.PowerModeChanged event in C#).  When the system resumes from hibernate, this app checks for the presence of a USB drive, and starts a software update app off of the USB drive if it's present.  Otherwise, it starts our regular shell application.

    However, the USB drive isn't always detected.  I'm guessing the USB drive may not always be mounted before the hibernate-resume system event is raised.  My current solution would be to add a fixed delay after the hibernate-resume before checking for the USB drive, or to listen for drive change events with a timeout.  However, this would add to boot time.

    We do have two unprotected partitions that are mounted after hibernate-resume (using mountvol.exe), before the USB drive is searched for.

    Are USB drives supposed to be mounted when the hibernate-resume event is raised?  Is there a better way to handle this?

    Thursday, April 12, 2012 5:18 PM