Error when coming out of hibernation

N

Nigel Walker

We are set up with RAM REG EWF and have done the necessary steps to make
HORM work.

We run our application, and if we use the run box and run xpepm -hibernate,
the system hibernates and we can resume multiple times with our application
running with no problems.

If we call the hibernate function from within our application by using the
function XPE_Hibernate (true), the system hibernates as before. However,
when we resume, we get an error message from our application: Access
Violation, Read from Address 0.

What could be the difference between using the run command and calling DLL?

Nigel.
 
S

Slobodan Brcin \(eMVP\)

Hi Nigel,

Are you sure that your application is ok. For instance comment the call on XPE_Hibernate and see if you have same error.

Also I would use native API directly to hibernate instead of using wrapper function like XPE_Hibernate.

Use:
SetSystemPowerState(PowerActionHibernate,...


Regards,
Slobodan
 
N

Nigel Walker

Hi Slobodan,

We tried the function you mentioned but got the same message.

We then put xpepm -hibernate in a .bat file and ran that from our program
and that worked ok.

I'm wondering if somehow we're sawing off the branch we are sitting on!

Regards,
Nigel.
 
K

KM

Nigel,

Are you running the batch file with showing its UI? Then it seems like when your app is not in foreground it works fine with the
hibernate.
This is possible behavior and usually considered as the application bug (you will have to debug the app itself).

Any chance for you to change the Hibernate API call by Standby in your application and see if the same error happens again? Just
trying to narrow down the root of the problem.
 
N

Nigel Walker

Hi KM,

Yes, we see a brief flash of the black DOS window when the batch file runs.

Thanks for the idea of calling Standby instead of Hibernate, we will give
that a try.

As an experiment, we tried the same hibernation call in another very simple
application of ours and experienced the same effect.

Regards,
Nigel.
 
S

Slobodan Brcin \(eMVP\)

Hi Nigel,

One important thing. Usually if your application is console based you must ensure that you hibernate in graphic mode. (Make sure
that console IS NOT IN FULL SCREEN).

Hibernation from application is working perfectly I have tried it from console application long time ago. Application also done some
heavy work on hacking hiberfile around MBR. All handles were remaining open and usable after resume.

Apparently in this test I have been using:
HMODULE hm=LoadLibrary("xpepm.dll");
DWORD (WINAPI *XPE_Hibernate)(BOOL)=(DWORD (WINAPI *)(BOOL)) GetProcAddress(hm, "XPE_Hibernate");
DWORD r=XPE_Hibernate(FALSE);

Make sure that your calling convention is WINAPI.
Also what programming language do you use?
What type of application Console, Windows, MFC, etc?

Regards,
Slobodan
 
K

KM

Slobodan,
Hi Nigel,

One important thing. Usually if your application is console based you must ensure that you hibernate in graphic mode. (Make sure
that console IS NOT IN FULL SCREEN).

I was wondering about this bug. Have you ever tried that with "Full screen video driver for console" driver component included in
your image?
Hibernation from application is working perfectly I have tried it from console application long time ago. Application also done some
heavy work on hacking hiberfile around MBR. All handles were remaining open and usable after resume.

Similar worked for me too with no errors.
Apparently in this test I have been using:
HMODULE hm=LoadLibrary("xpepm.dll");
DWORD (WINAPI *XPE_Hibernate)(BOOL)=(DWORD (WINAPI *)(BOOL)) GetProcAddress(hm, "XPE_Hibernate");
DWORD r=XPE_Hibernate(FALSE);

Make sure that your calling convention is WINAPI.

I guess this might not be that important as he mentioned he tried the SetSystemPowerState API and saw the same error.
 
S

Slobodan Brcin \(eMVP\)

I was wondering about this bug. Have you ever tried that with "Full screen video driver for console" driver component included in
your image?

Actually I have not tried this component. Although I do not understand why it is important since console work fine in full screen
mode, until resume from hibernation which hang computer.
I thought that this was related to bad video driver.

This can be tested easily on XPP if someone is willing to use regular hibernation.

Regards,
Slobodan
 
K

KM

Slobodan,
Actually I have not tried this component. Although I do not understand why it is important since console work fine in full screen
mode, until resume from hibernation which hang computer.
I thought that this was related to bad video driver.

Yes. VGA driver may not handle the resume properly if console was in Full screen mode, right?
So I thought that the fsvga driver may not have the bug. But I never tried that on XP Pro or XPe.
 
N

Nigel Walker

Thanks for your comments Slobodan and KM.

Our application is a standard Windows gui and is written in Delphi.

I am at home right now, but we will investigate further on Monday, armed
with the info and suggestions you've given me.

Regards,
Nigel.
 

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

Similar Threads

FP2007 + Horm Issues 3
xpepm -hibernate now causing reboot 2
HORM-Hibernate problem 1
Hibernation protecting other disk?? 4
Unexpected Hibernate 4
HORM 1
xpepm command 3
Yet another Horm Question 1

Top