Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Possible solution for saving files on EWF systems (without disabling EWF)

  1. #1
    FLAC SFiorito's Avatar
    Join Date
    May 2004
    Posts
    1,364

    Thumbs up 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...

  2. #2
    FLAC SFiorito's Avatar
    Join Date
    May 2004
    Posts
    1,364
    1) Okay, first off install the SDI driver: http://msdn.microsoft.com/library/en...gSDIDriver.asp
    2) From the XPe setup directory, look for disk3\ewfapi and place ewfapi.dll in your system32 directory.
    3) Copy sdiaut.dll into your system32 directory and run "regsvr32 sdiaut.dll"
    4) Use the two files I attached in this post:

    sdimount to mount and unmount SDI disks
    Code:
    sdimount c:\test.sdi    <---- mount
    sdimount -u c:\test.sdi    <---- unmount
    ewfcommitfile to commit files
    Code:
    ewfcommitfile c:\test.sdi
    the basic steps would be to unmount, commit, reboot, mount at startup. Remember not to set your HORM state with another disk connected (including SDI disks) since you will also be saving the write cache in the hibernation file!!! That's why you need to mount at startup.

    ewfcommitfile can be used with any file. SDI files will not change in size so we're fine, but just in case you plan on using it for other files keep in mind that if you commit a file that has changed in size you could potentially screw up your partition.
    Attached Files Attached Files

  3. #3
    Newbie
    Join Date
    May 2006
    Posts
    1
    Quote Originally Posted by SFiorito
    1) Okay, first off install the SDI driver: http://msdn.microsoft.com/library/en...gSDIDriver.asp
    2) From the XPe setup directory, look for disk3\ewfapi and place ewfapi.dll in your system32 directory.
    3) Copy sdiaut.dll into your system32 directory and run "regsvr32 sdiaut.dll"
    4) Use the two files I attached in this post:

    sdimount to mount and unmount SDI disks
    Code:
    sdimount c:\test.sdi    <---- mount
    sdimount -u c:\test.sdi    <---- unmount
    ewfcommitfile to commit files
    Code:
    ewfcommitfile c:\test.sdi
    the basic steps would be to unmount, commit, reboot, mount at startup. Remember not to set your HORM state with another disk connected (including SDI disks) since you will also be saving the write cache in the hibernation file!!! That's why you need to mount at startup.

    ewfcommitfile can be used with any file. SDI files will not change in size so we're fine, but just in case you plan on using it for other files keep in mind that if you commit a file that has changed in size you could potentially screw up your partition.
    I have similar problem.
    However, I got the solution to it with your great idea.
    By the way, I want to add SDI Drive mounting and un-mounting routine to my Win32 Application (on WinXPe with EWF) .

    Is this possible??

    What function ( in SDK or DDK ? ) should I use ??

  4. #4
    Newbie
    Join Date
    Jun 2006
    Posts
    1
    I wrote a little batch file to do the commit live and put in the shutdown scripts

  5. #5
    Newbie
    Join Date
    Apr 2007
    Posts
    1
    Yuri, is it possible for your to post the source for ewfcommitfile.exe? I have never been able to get the EwfMgrCommitFile API call to work properly, and that would be a great help. Thanks! Kevin

  6. #6

  7. #7
    Maximum Bitrate
    Join Date
    Jun 2002
    Location
    Malaysia
    Posts
    624
    SFiorito, thanks for this.

    Do you mind going a little bit more into detail on its application?
    I understand the steps, but dont understand how to do it.

    How do I intercept the shutdown sequence to run this?
    sdimount -u c:\test.sdi
    ewfcommitfile c:\test.sdi

    I assume I can do the above with a .bat file? (lets assume the filename is sdewf.bat)
    How do I tell windows to execute sdewf.bat first before shutting down? I perform shutdown by pressing on the power button once.

    And consequently, how do I tell Windows to always run
    sdimount c:\test.sdi
    upon booting up from hibernation (HORM)?

    And one more thing, what is the content of test.sdi?

  8. #8
    Maximum Bitrate jonessc's Avatar
    Join Date
    Nov 2006
    Location
    Wales, UK
    Posts
    787
    What was the outcome of this after?

    Was it running stable?
    CarPuter Progress:
    Planning:-----> [||||||||||] 100%
    Hardware Buying:-> [||||||||||] 100%
    Software:-----> [||||||||||] 100%
    Installing:-----> [||||||||||] 100%
    Current Project= Making skins in photoshop...

  9. #9
    FLAC SFiorito's Avatar
    Join Date
    May 2004
    Posts
    1,364
    it's been a long time since i used that, but it was very stable. with the newer CF cards that can be used in fixed drive mode (and can be partitioned) it's not as big of an issue anymore......hard to believe it's almost been 3 years!
    EWF, HORM, MinLogon on XP.

    Zotac ION Atom N330, 2GB low-profile RAM, M3-ATX
    Win Embedded Std 2011 RC
    OCZ Vertex Turbo 30GB SSD
    Lilliput 629 Transflective, WRX Screen Mount
    BlueSoleil BT, i-Blue GM-2 GPS, DirectedHD Radio, Andrea Mic
    VoomPC 2

  10. #10
    Maximum Bitrate jonessc's Avatar
    Join Date
    Nov 2006
    Location
    Wales, UK
    Posts
    787
    Quote Originally Posted by SFiorito View Post
    it's been a long time since i used that, but it was very stable. with the newer CF cards that can be used in fixed drive mode (and can be partitioned) it's not as big of an issue anymore......hard to believe it's almost been 3 years!
    still an original idea, I have my drive with all the software on one (c) and all my music etc on the other (d) if I installed Road runner on the drive without EWF wud it still come out of hibernate and still remember last song etc? my c drive wud still have EWF enabled on it.
    CarPuter Progress:
    Planning:-----> [||||||||||] 100%
    Hardware Buying:-> [||||||||||] 100%
    Software:-----> [||||||||||] 100%
    Installing:-----> [||||||||||] 100%
    Current Project= Making skins in photoshop...

Page 1 of 2 12 LastLast

Similar Threads

  1. Using EWF on regular WinXP
    By SFiorito in forum WinNT Based
    Replies: 203
    Last Post: 03-17-2009, 07:43 PM
  2. MINLOGON without ewf, easy install with files
    By syfenx in forum WinNT Based
    Replies: 28
    Last Post: 06-07-2005, 11:48 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •