Can I programmatically stop the shutdown process? Can I make my computer never shut down?

N

networm

Hi all,

I am using a Toshiba M4 Tablet PC and it has a nasty problem on its
standby. Every time I open the lid to resume from standby, it mysteriously
shutdown.

I tried to reinstall the OS and make it minimallly loaded in terms
memory/harddisk/battery... To make a long story short. In the past 25 days
I've fighted with its problems unrestedly and now I am tired.

It was good for a while. For quite a few days I
had only two mysterious shutdown. From this we can see this is a problem
with XP Tablet PC Version. I looked into the Internet but it seems that
there is no workaround in this XP version. Everybody seems to complain about
hibernation/standby problems everywhere. That's why I did not send it back.
The problem is on Windows side, what can I do? I need it for my work,
anyway...

At least before yesterday everything was acceptable to me.

But today I upgrade RAM to 1.5GB. Now these standby problems re-occur
frequently. It mysteriously shuts down all the time. 100% of time. There is
a known bug with XP Tablet PC version that it does not
do well in tablet PCs with 1.5GB RAM... I know that. There is no
workaround...

But I have to deal with my own problem: the mysteriously shutdown.

Every time when it resumes from standby, it mysteriously shutdown. This
basically makes "mobility" and "productivity" a far-away dream...

So I want to ask: how can I intervene the shutdown process and stop it from
happening? Can I have a computer that never shuts down?

If possible, can I program my own process that monitor the whole system and
make sure the shutdown process never works... ? Or can I create a die hard
dead process that the shutdown process does not work at all when it faces
the dead process?

Thanks a lot!
 
A

Alexander Grigoriev

It must be either hardware, or device driver problem. Run memory tests, hook
a remote debugger to it and see what's going on.
You may want to use hiibernation instead of suspend. Try also to disable
"suspend to RAM". You may want to call Toshiba tech support, too.
 
N

networm

Alexander Grigoriev said:
It must be either hardware, or device driver problem. Run memory tests,
hook a remote debugger to it and see what's going on.
You may want to use hiibernation instead of suspend. Try also to disable
"suspend to RAM". You may want to call Toshiba tech support, too.


Thanks a lot! But I just want to stop the shutdown process. Is it possible?
 
A

Alexander Grigoriev

It all depends what kind of shutdown it is. If it's system failure, you
can't stop it. If the OS thinks you run out of batteries, it won't alow you
to cancel it.

What the system even log shows?
 
N

networm

Good question. There is no event at all.

So it is a very normal graceful shutdown. It very patiently close and wait
until all applications finish, then shuts down.

The most normal shutdown as the ones occur on our computers in everyday
life.
 
T

TC

I must be missing something.

If you stop it shutting down, it will run out the battery, & then shut
down anyway!!

Yes? No?

TC
 
N

networm

Hi Alex, you are really great! I have experienced shutdown again. But my
simple app using the method you've suggested stopped it...

The only headache is that it send the query to my simple app quite late.
Many other services and apps have already been shutdown, even my wireless
was gone before my program got the query message.

Is there a way that my program can be the first to be queried so I can stop
the shutdown before it closes all other apps and services?

Thanks a lot!
 
J

Joe Butler

I just found out that Vista will be asking your app if it's okay to shut
down. If you say "No", it will then say 'fuc# you' and shut down anyway.
 
W

Waleri Todorov

Is there a way that my program can be the first to be queried so I can stop
the shutdown before it closes all other apps and services?
No, there isn't for an obvious reason - what will happend if *two* (or
more) applications demand to be first in notification chain?
 
N

networm

TC said:
I must be missing something.

If you stop it shutting down, it will run out the battery, & then shut
down anyway!!

Yes? No?

TC

No!

Because I am talking about a laptop with AC connected all the time. The
mysterious shutdown does not come from battery running out. It comes from
some mechanism inside the setup: if it detects something, it force it
shutdown. However i was not able to find any system events for this
mysterious shutdown.
 
G

Gary Chanson

networm said:
No!

Because I am talking about a laptop with AC connected all the time. The
mysterious shutdown does not come from battery running out. It comes from
some mechanism inside the setup: if it detects something, it force it
shutdown. However i was not able to find any system events for this
mysterious shutdown.

That means that it's probably being initiated by a running program. Start
by looking for spyware and viruses. If that doesn't cure the problem, start
killing off programs and stopping unused services until you figure out which
one is responsible.
 
N

networm

Gary Chanson said:
That means that it's probably being initiated by a running program.
Start by looking for spyware and viruses. If that doesn't cure the
problem, start killing off programs and stopping unused services until you
figure out which one is responsible.

Gary, once I have stopped all services/processes and counted only 23
processes left.

Then it still occur. I notice this happens more frequently when the
following 2 cases occur:

1. The battery is fully charged; But the AC is stil connected; then the
harddisk portion of the laptop will become hoter and hoter. Then I know this
mysterious shutdown problem will almost surely occur.

2. I have some big abrupt motion when closing the lid and lifting the lid.
Then I know this mysterious shutdown problem will almost surely occur.

Now using the programming approach, I did stop it successfully. The only
problem was many services/processes were shutdown already before my program
was able to get the query mesage and stop the shutdown.

With the shutdown problem partially cured, now another problem is after
resuming from standby, the wireless network does not work. This occurs 25%
of time. I run Intel Proset software, it says: another application is using
the wireless card. But I have stopped the Microsoft ZeroConfigure Wireless
service already. But it seems that MS is still controlling the wireless
card, but it failed to connect...
 
G

Gary Chanson

networm said:
Gary, once I have stopped all services/processes and counted only 23
processes left.

Then it still occur. I notice this happens more frequently when the
following 2 cases occur:

1. The battery is fully charged; But the AC is stil connected; then the
harddisk portion of the laptop will become hoter and hoter. Then I know this
mysterious shutdown problem will almost surely occur.

2. I have some big abrupt motion when closing the lid and lifting the lid.
Then I know this mysterious shutdown problem will almost surely occur.

Now using the programming approach, I did stop it successfully. The only
problem was many services/processes were shutdown already before my program
was able to get the query mesage and stop the shutdown.

With the shutdown problem partially cured, now another problem is after
resuming from standby, the wireless network does not work. This occurs 25%
of time. I run Intel Proset software, it says: another application is using
the wireless card. But I have stopped the Microsoft ZeroConfigure Wireless
service already. But it seems that MS is still controlling the wireless
card, but it failed to connect...

Then it's likely to be a hardware problem and curing it by blocking the
shutdown is the wrong approach. If it's shutting down because it's
overheating, you may have a failed fan. If abrupt motion causes it, you may
have a bad connection somewhere in the unit.

Whatever is causing this problem is not normal and fixing it via a special
program is just hiding the problem instead of solving it.
 
N

networm

Hi all,

Here is the latest update about my program. I really need your desperately.

I have used the window message WM_QUERYENDSESSION, and make my
application returns Zeros to stop ending the session.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/wm_queryendsession.asp

It stops shutdown successfully. I was very happy, until I found its
ordering:

I found out that all processes/applications which were loaded into memory
later than my "ShutDownPrevention" process, will respond to the above QUERY
message later than my program, so these applications are saved from the
shutdown.

But all those services/processes before my program was loaded, they will
respond to the Query message earlier than my program, so when my program
stopped the shutdown, these processes have already been shutdown already.
For example, the screen zooming utility, the Fn-keys of my laptop, screen
rotation utilities, all these things are gone. Because they install services
when startup and they stay in the notification area of the system tray. I
guess they have higher priority than my "ShutDownPrevention" program...

Anybody has thoughts on how to move my program above them?

One solution might be to load my program as service and make it load into
system as early as possible. How can I do that?

Thanks a lot!
 
T

TC

networm wrote:

(snip)
Then it still occur. I notice this happens more frequently when the
following 2 cases occur:

1. The battery is fully charged; But the AC is stil connected; then the
harddisk portion of the laptop will become hoter and hoter.


Try control panel Power Management & see what it says about the hard
disk's powerdown time?

HTH,
TC
 
R

Roman Green

Try SetProcessShutdownParameters.

networm said:
Hi all,

Here is the latest update about my program. I really need your
desperately.

I have used the window message WM_QUERYENDSESSION, and make my
application returns Zeros to stop ending the session.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/wm_queryendsession.asp

It stops shutdown successfully. I was very happy, until I found its
ordering:

I found out that all processes/applications which were loaded into memory
later than my "ShutDownPrevention" process, will respond to the above
QUERY message later than my program, so these applications are saved from
the shutdown.

But all those services/processes before my program was loaded, they will
respond to the Query message earlier than my program, so when my program
stopped the shutdown, these processes have already been shutdown already.
For example, the screen zooming utility, the Fn-keys of my laptop, screen
rotation utilities, all these things are gone. Because they install
services when startup and they stay in the notification area of the system
tray. I guess they have higher priority than my "ShutDownPrevention"
program...

Anybody has thoughts on how to move my program above them?

One solution might be to load my program as service and make it load into
system as early as possible. How can I do that?

Thanks a lot!
 

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