Possible solution for saving files on EWF systems (without disabling EWF)
Hey guys, I think I've got a good solution for a few of the problems we've been experiencing when it comes to saving files on EWF systems. Basically we want an EWF (using HORM) system that's smart enough to resume playing the last song or radio station we were listening to when the system shutdown. That means we need to write some state information to a file on the disk so that the front end can read it. We also want to be able to save other information like addresses, trips, phone numbers, etc. In some cases, people may want to save a whole database for MP3's and so on. Well, the problem with all that when it comes to EWF is that saving that information between reboots requires disabling EWF, committing the overlay, and then rebooting in order to enable EWF. This in turn makes us lose our HORM state so once the system has rebooted you then need to hibernate in order to create your HORM state.
Well, here's my solution: using SDI disks, another feature from XPe, we can create a virtual drive of any size we wish to use in our EWF system. When the PC boots up we mount that drive and any files we want are stored in it. Now, the way SDI drives work is that they are static files on your hard drive (i.e. they don't change in size after you create them). This allows us to use the EwfMgrCommitFile function in the EWF API to safely commit the contents of that file to the EWF protected volume. The way it would work is when the system shuts down a task would run to unmount the SDI disk and then call EwfMgrCommitFile to commit the changes to the SDI disk onto the EWF protected volume. The SDI disk would then be mounted again at boot up.
I've already tested all this and even contacted some MSFT people from the Embedded team and they confirmed that I should be able to safely do this. I ran a test on a VirtualPC system and chkdsk didn't find any disk errors after commit the disk multiple times. I'll update this thread later tonight with two command line utilties, one to mount/unmount SDI disks and the other to commit a file to the EWF volume. In the mean time if you're interested, then you can install the SDI driver located in the Windows Embedded folder on your hard drive (if you have XPe Tools installed). Go here for instructions: http://msdn.microsoft.com/library/en...gSDIDriver.asp In the bin folder there's a file named sdiaut.dll. You need to place that in your system32 directory and on the command line run "regsvr32 sdiaut.dll" to register the COM library. Then, using sdiloader.exe you can create and mount an SDI disk.
I'll upload my utilities soon...