The MP3car.com Store  

Welcome to the MP3Car.com forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. Registering will also remove advertisements. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   MP3Car.com > Mp3Car Technical > Software & Software Development > Operating System Optimization > WinNT Based

Reply
 
Thread Tools Display Modes
Old 05-20-2005, 06:27 PM   #1
FLAC
 
SFiorito's Avatar
 
Join Date: May 2004
Vehicle: 2006 Impreza WRX Limited
Posts: 1,142
My Photos: (0)
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...
SFiorito is offline   Reply With Quote
Sponsored Links
Old 05-20-2005, 09:23 PM   #2
FLAC
 
SFiorito's Avatar
 
Join Date: May 2004
Vehicle: 2006 Impreza WRX Limited
Posts: 1,142
My Photos: (0)
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
File Type: zip ewfutils.zip (45.4 KB, 842 views)

Last edited by SFiorito : 05-20-2005 at 09:30 PM.
SFiorito is offline   Reply With Quote
Old 05-31-2006, 07:42 AM   #3
Newbie
 
Join Date: May 2006
Posts: 1
My Photos: (0)
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 ??
yuri is offline   Reply With Quote
Old 06-08-2006, 05:56 PM   #4
Newbie
 
Join Date: Jun 2006
Posts: 1
My Photos: (0)
I wrote a little batch file to do the commit live and put in the shutdown scripts

Last edited by hypertech : 06-09-2006 at 06:05 PM.
hypertech is offline   Reply With Quote
Old 04-18-2007, 08:02 AM   #5
Newbie
 
Join Date: Apr 2007
Posts: 1
My Photos: (0)
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
kevinuu is offline   Reply With Quote
Old 04-26-2007, 04:04 PM   #6
Maximum Bitrate
coucouillu's CarPC Specs
 
coucouillu's Avatar
 
Join Date: Nov 2004
Location: FRANCE
Vehicle: 06' Audi A3 2.0 TDI Exclusive Line 170HP
Posts: 892
My Photos: (72)
what about hardlink.exe solution on a writable partition ?I never continue what i stated to try.

Perhaps you could give it a try?

http://http://www.mp3car.com/vbullet...-winxp-12.html

Last edited by coucouillu : 04-26-2007 at 04:09 PM.
coucouillu is offline   Reply With Quote
Old 06-02-2007, 10:32 PM   #7
Maximum Bitrate
 
Join Date: Jun 2002
Location: Malaysia
Vehicle: BMW
Posts: 621
My Photos: (0)
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?
__________________
New Lilliput EBY701 For Sale http://www.nusantech.com/index.asp?c...at=TOUCHSCREEN
SiRF3 Bluetooth GPS http://www.nusantech.com/index.asp?cat=GPS
masch is offline   Reply With Quote
Old 02-26-2008, 07:30 PM   #8
Maximum Bitrate
jonessc's CarPC Specs
 
jonessc's Avatar
 
Join Date: Nov 2006
Location: Wales, UK
Vehicle: BMW 320D M-Sport
Posts: 752
My Photos: (0)
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...
jonessc is online now   Reply With Quote
Old 02-26-2008, 08:21 PM   #9
FLAC
 
SFiorito's Avatar
 
Join Date: May 2004
Vehicle: 2006 Impreza WRX Limited
Posts: 1,142
My Photos: (0)
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!
SFiorito is offline   Reply With Quote
Old 02-27-2008, 05:34 AM   #10
Maximum Bitrate
jonessc's CarPC Specs
 
jonessc's Avatar
 
Join Date: Nov 2006
Location: Wales, UK
Vehicle: BMW 320D M-Sport
Posts: 752
My Photos: (0)
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...
jonessc is online now   Reply With Quote
Sponsored Links
Old 02-27-2008, 11:55 AM   #11
FLAC
 
SFiorito's Avatar
 
Join Date: May 2004
Vehicle: 2006 Impreza WRX Limited
Posts: 1,142
My Photos: (0)
that's more dependent on the front end. I think most front ends should be "power-aware" so if you go to sleep or hibernate they continue playing once you resume. in order for a front end to be HORM/EWF-aware it would need to save its state in a file on a writable partition and read that data upon resuming since each time it resumes will be from the original HORM state. I don't know which, if any, front ends do that.
SFiorito is offline   Reply With Quote
Old 03-13-2008, 01:46 AM   #12
Constant Bitrate
 
Join Date: Dec 2006
Posts: 189
My Photos: (9)
Good idea SFiorito, I've got a few questions though:

Firstly, where are the SDI files located? I looked through the "XPeSP2FeaturePack2007" iso that I found all the EWF files in, but without any luck.

Secondly, isn't it supposed to be possible to only protect a single partition? I don't have any need for EWF at all besides to maintain my HORM file. I created a partition (C that has all my static data on it (drivers, frontend, etc) and another partition (D on the same hard drive that should later have settings and music. However, even if EWF is disabled on D, once I resume, all the data is erased and it goes right back to how it was when I hibernated. That's why I'm looking into this, but before I go installing the SDI stuff (assuming I can find it :P) is there any way that I could just unprotect the D drive?

Thanks a lot ahead of time : )

EDIT: Found the SDI files -- for anyone wondering; you have to download the SDI tools installer. When it asks what to download, only get the Tools part (which is like 7 megs). Then extract the files in disk1 and the SDI.* files should be there. To get sdiaut.dll, you need to acutally run the installer, wait for it to create all the files, then copy it out of the /bin directory. I did this while the installer was running and then clicked Cancel so that it automatically erased all the rest of the files. I grabbed sdiloader.exe from the /bin directory too since it's needed to create/manage the SDI disks. It offers to install the drivers for you upon starting, so that may save a few steps. Still want to know if you can just leave a partition unprotected.

Last edited by colin : 03-13-2008 at 02:54 AM.
colin is offline   Reply With Quote
Sponsored Links
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using EWF on regular WinXP SFiorito WinNT Based 193 06-18-2007 07:50 PM
MINLOGON without ewf, easy install with files syfenx WinNT Based 28 06-07-2005 10:48 AM


All times are GMT -5. The time now is 12:58 PM.


Sponsored Links
The MP3car.com Store

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
Copyright © 1999 - 2008 Mp3Car.com Inc.
Ad Management by RedTyger
Message Board Statistics