EWF API Questions

S

Slobodan Brcin

My product works in an industrial environment, connected to a UPS. When
the
power goes off, and we're running from the UPS, I want to COMMIT the
system's current status to the EWF-protected CF and continue running in a
"standby" mode. All this works now.

Problem is, if the power stays off, the UPS goes dead and the system goes
down without the graceful shutdown that EWF COMMIT needs. So the COMMIT is
futile.

How can I do everything that SHUTDOWN does (save Registry & whatever else),
but not actually re-boot? My apps are written in C++.

First is this RAM or DISK based EWF?

If it is RAM, then only thing you can do is to wake and shutdown device few
moments before power is cut off.

Or you can change your app:
You can create unprotected partition, and use RegLoadKey, RegSaveKey to
temporary save and restore some hives that are vital to you.
Or you can save and restore data in your temp(or config) file on unprotected
partition. Than when XPE loads if exists will be loaded by your app to
appropriate places.


Best regards,
Slobodan
 
T

Tom Salicos

My product works in an industrial environment, connected to a UPS. When the
power goes off, and we're running from the UPS, I want to COMMIT the
system's current status to the EWF-protected CF and continue running in a
"standby" mode. All this works now.

Problem is, if the power stays off, the UPS goes dead and the system goes
down without the graceful shutdown that EWF COMMIT needs. So the COMMIT is
futile.

How can I do everything that SHUTDOWN does (save Registry & whatever else),
but not actually re-boot? My apps are written in C++.

Thankful for help,

Tom Salicos
(e-mail address removed)
 
S

Slobodan Brcin

It's RAM based. My problem is that the UPS may last an hour, or a minute,
depending on its size, condition, and how long since the last outage.

I know, but do you have RS232 or some other feedback on power state? If not
then you can't use this method.

Maybe I am not understanding how EWF works. What happens at SHUTDOWN that
tells EWF to COMMIT the overlay data at re-boot time? I was assuming it was
some Registry settings, that would be saved in the process of a graceful
SHUTDOWN.

For RAM ewf it works as follow.

When you say commit. EWF driver set its state in memory that it should
commit all data after the file system if closed.
This is only safe point in time where all data are consistent, registry
closed, and dirty bit is cleared. This happens few moments before actual
shutdown.

So info you read about data being committed during the boot are wrong in
case of RAM EWF.
RAM EWF is stateless and it can save only info that you provide it before
actual commit happens to disk.
So on boot you can use only saved info (that you committed), not info that
you had before during the work.

If you have small EWF partition for RAM EWF. Then you can disable EWF and
reboot device without committing, since info on disabled EWF is preserved in
this partition. But this is not useful to you.


Regards,
Slobodan
 
T

Tom Salicos

Slobodan Brcin said:
First is this RAM or DISK based EWF?
If it is RAM, then only thing you can do is to wake and shutdown device few
moments before power is cut off.

It's RAM based. My problem is that the UPS may last an hour, or a minute,
depending on its size, condition, and how long since the last outage.


Maybe I am not understanding how EWF works. What happens at SHUTDOWN that
tells EWF to COMMIT the overlay data at re-boot time? I was assuming it was
some Registry settings, that would be saved in the process of a graceful
SHUTDOWN.

Thanks Slobodan.

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top