IMHO the reason that you are getting these ‘helpful’ replies is that you are
asking how to do something that can’t / shouldn’t be done. Delaying power
actions is bad in any general purpose driver and only ‘acceptable’ in
embedded applications.
“Wang, Zhongsheng” wrote in message news:xxxxx@ntdev…
pa, thanks for a great suggestion! I hope it is useful for somebody!
What I really want is to figure out when the user has pressed the power
button in all conditions. It is just as simple as that. Even though I have
more than 10 years kernel development experience, I did not realize how hard
this is, so I turn to you guys for some clues.
The reason I mentioned power button press delay (as Doron has asked) is that
if somebody can tell me how to delay the power button action, I can probably
figure out how to read information about the power button press event. Sorry
if I confused anybody.
Thanks,
zhongsheng
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Pavel A
Sent: Thursday, March 15, 2012 9:59 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] How to track the power button press event in kernel?
On 15-Mar-2012 18:35, Wang, Zhongsheng wrote:
So it sounds like the only way to handle this is to write an ACPI
Fixed Button filter driver. Is that feasible?
There is a simple, quick and effective driver for all these smart buttons.
It is called screwdriver.
Poke it under the plastic thing and pop it out.
No one will disturb your program now.
Or, hack the BIOS and find how to disable the button.
Remember that if your (human) users can press the power button, they can
just hold it a bit longer, and the machine POWERS OFF INSTANTLY. Period.
Regards,
– pa
There is no reference on how to
write a ACPI device driver in WDK. Any samples?
Thanks,
zhongsheng
*From:*xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] *On Behalf Of *Doron Holan
*Sent:* Wednesday, March 14, 2012 3:58 PM
*To:* Windows System Software Devs Interest List
*Subject:* RE: [ntdev] How to track the power button press event in
kernel?
The button devices are opened exclusively by the kernel. None of the
drivers that support this ioctl allow for multiple instances of this
request to be sent,s o you are competing with the kernel and will lose.
d
*From:*xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] *On Behalf Of *Wang,
Zhongsheng
*Sent:* Wednesday, March 14, 2012 3:44 PM
*Subject:* RE: [ntdev] How to track the power button press event in
kernel?
Doron,
I read your blog:
http://blogs.msdn.com/b/doronh/archive/2006/09/08/746834.aspx
How can I use IOCTL_GET_SYS_BUTTON_EVENT to read the button event? I
could not find any information on how to do this. Will this event be
cleared by OS automatically?
Thanks,
zhongsheng
*From:*xxxxx@lists.osr.com
mailto:xxxxx
> [mailto:xxxxx@lists.osr.com]
> mailto: *On Behalf Of
> *Doron Holan
> Sent: Wednesday, March 14, 2012 12:21 PM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] How to track the power button press event in
> kernel?
>
> For how long? Until your hardware is done with some action ?
>
> d
>
> debt from my phone
>
> ----------------------------------------------------------------------
> –
>
> *From: *Wang, Zhongsheng
> *Sent: *3/14/2012 12:00 PM
> *Subject: *RE: [ntdev] How to track the power button press event in
> kernel?
>
> Just delay the power action.
>
> Thanks,
>
> zhongsheng
>
> *From:*xxxxx@lists.osr.com
> mailto:xxxxx
> [mailto:xxxxx@lists.osr.com]
> mailto: *On Behalf Of
> *Doron Holan
> Sent: Wednesday, March 14, 2012 11:39 AM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] How to track the power button press event in
> kernel?
>
> No. Do you want to delay the power action or make it disappear entirely?
>
> d
>
> debt from my phone
>
> ----------------------------------------------------------------------
> –
>
> *From: *Wang, Zhongsheng
> *Sent: *3/14/2012 11:37 AM
> *To: *Windows System Software Devs Interest List
> *Subject: *RE:[ntdev] How to track the power button press event in kernel?
>
> Thanks Doron,
>
> In certain situation, I don’t want the system to go down or sleep when
> the user presses the power button. Please don’t ask me why:-(.
>
> Is there any way to query the state of power button press, such as
> from a registry location, ACPI.sys, or directly read from ACPI using
> GetSystemFirmwareTable() if there is no event to track asynchronously?
>
> zhongsheng
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> mailto:xxxxx
> [mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
> Sent: Wednesday, March 14, 2012 11:19 AM
> To: Windows System Software Devs Interest List
> Subject: RE:[ntdev] How to track the power button press event in kernel?
>
> There really isn’t a way to get the button press. What problem are you
> trying to solve?
>
> d
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> mailto:xxxxx
> [mailto:xxxxx@lists.osr.com] On Behalf Of Wang,
> Zhongsheng
> Sent: Wednesday, March 14, 2012 11:01 AM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] How to track the power button press event in kernel?
>
> Hi Gurus,
>
> I am wondering if there is any way to track the power button press
> event in the kernel device driver?
>
> Normally the user would know the power button press event by looking
> at the power broadcast message and wake reasons. However, if the user
> selects “Do nothing” for power button press in Power Option, OS will
> not generate any power broadcast message. In this case, I could not
> find a way to track whether the power button has been pressed.
>
> Thanks,
> zhongsheng
>
>
—
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx></mailto:></mailto:xxxxx></mailto:></mailto:xxxxx>