Hello, everybody,
I need to do something just before shutdown the computer, so I wonder
whether there is a program (executive file) to carry out the shutdown
function. If so , I can replace it with my own shutdown program (of course
it can do more work than the system-supplied one do)…but I don’t know how
to do it…
Can you tell me ?
Thank you in advance.
KDriver 8/29/2001
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
The only way that I know how to do this would be to write a replacement GINA
(graphical identification and authentication) dll, and place the necessary
code
in the WlxShutdown function. The description of this function form MSDN is:
The WlxShutdown function must be implemented by a replacement GINA DLL.
Winlogon
calls this function just before shutting down, allowing the GINA to perform
any
shutdown tasks, such as ejecting a smart card from a reader.
Be aware that GINA is called by WinLogon to handle all iteractions with a
user
for a session - everything from the initial ‘Welcome to NT’ dialog box to
the
‘it is now safe to shut down your computer’ dialog box. And all of this
functionality
will need to be duplicated somehow. Probably the easiest would be to create
a
‘passthrough’ replacement where all of the function calls (except
WlxShutdown)
are passed to the original GINA dll. There was a series of articles in
Windows
Developer Journal (circa October 1999) in the inside NT column on writting a
replacement GINA. There is also a sample GINA included with the MSDN
library, although I had trouble getting it to work correctly when I ran it.
George Huber
Computer Scientist
SRI, International
phone: 732-427-8064
fax : 732-427-2065
xxxxx@mail1.monmouth.army.mil
-----Original Message-----
From: KDriver [mailto:KDriver@163.com]
Sent: Tuesday, August 28, 2001 11:12 PM
To: NT Developers Interest List
Subject: [ntdev] Re: How to replace shutdown of W2K?
Hello, everybody,
I need to do something just before shutdown the computer, so I wonder
whether there is a program (executive file) to carry out the shutdown
function. If so , I can replace it with my own shutdown program (of course
it can do more work than the system-supplied one do)…but I don’t know how
to do it…
Can you tell me ?
Thank you in advance.
KDriver 8/29/2001
You are currently subscribed to ntdev as:
xxxxx@mail1.monmouth.army.mil
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
KDriver wrote:
I need to do something just before shutdown the computer, so I
wonder
whether there is a program (executive file) to carry out the shutdown
function.
The question is how close to shutdown do you need. User space code will
go before the OS, then drivers will be shutdown, then the system will exit.
So if you don’t need things too close, look at having a service with calls
to SetConsoleCtrlHandler and SetProcessShutdownParameters.
If you need to be closer to the final shutdown look at a small driver with
IoRegisterShutdownNotification to get a callback on shutdown.
Don Burn
Windows 2000 Device Driver and Filesystem consulting
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
Or just put something in System shutdown script in group policy.
Adel.
----- Original Message -----
From: “Don Burn”
To: “NT Developers Interest List”
Sent: Wednesday, August 29, 2001 10:22 AM
Subject: [ntdev] Re: How to replace shutdown of W2K?
> KDriver wrote:
>
> > I need to do something just before shutdown the computer, so I
> wonder
> > whether there is a program (executive file) to carry out the shutdown
> > function.
>
> The question is how close to shutdown do you need. User space code will
> go before the OS, then drivers will be shutdown, then the system will
exit.
>
> So if you don’t need things too close, look at having a service with calls
> to SetConsoleCtrlHandler and SetProcessShutdownParameters.
>
> If you need to be closer to the final shutdown look at a small driver with
> IoRegisterShutdownNotification to get a callback on shutdown.
>
> Don Burn
> Windows 2000 Device Driver and Filesystem consulting
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@cifnet.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
—
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
Hello Don,
I’d like to describe the problem I encountered in detail…
Actually my company develops UPS. And we expect that when the computer
is using the UPS’s battary to supply the power, and when the power of the
battery becomes low enough, the system will at first run my program and then
shut down the computer. And I can set these action in Control
Panael--------Power Option-------Alarm Page , when the power is low ,the
system execute the program and the shut down… The program I assign here is
used to save files for those porgrams which have works not saved ---- for
example, Microsoft Word or a Picture Editor.]
But I 'm so supprised that when the power is low , the system simply
run the program and almost immediately shutdown the computer----it means my
program has no enough time to save the files…
So I expect when the power is low , the system run my program at first
( but don’t close the programs which have works to be saved , and my program
will save files for those programs and then terminate them), and then shut
down the computer, (not shut down computer immediately when the power is
low)…
please help me, and thank you.
KDriver
----- Original Message -----
From: “Don Burn”
To: “NT Developers Interest List”
Sent: Wednesday, August 29, 2001 10:22 PM
Subject: [ntdev] Re: How to replace shutdown of W2K?
> KDriver wrote:
>
> > I need to do something just before shutdown the computer, so I
> wonder
> > whether there is a program (executive file) to carry out the shutdown
> > function.
>
> The question is how close to shutdown do you need. User space code will
> go before the OS, then drivers will be shutdown, then the system will
exit.
>
> So if you don’t need things too close, look at having a service with calls
> to SetConsoleCtrlHandler and SetProcessShutdownParameters.
>
> If you need to be closer to the final shutdown look at a small driver with
> IoRegisterShutdownNotification to get a callback on shutdown.
>
> Don Burn
> Windows 2000 Device Driver and Filesystem consulting
>
>
> —
> You are currently subscribed to ntdev as: KDriver@163.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
—
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com