?
Solved

Driver development - power management

Posted on 2001-08-03
2
Medium Priority
?
212 Views
Last Modified: 2013-12-03
I wrote driver for Win2K for radio card. It all works perfect... but I have no idea how to implement awareness of power-management features in W2k.
Let's say system goes to hibernate mode. Radio turns off because of system power loss. But when system comes up again (from hibernation), driver should turn it back on (to same state it was before hibernation).

My problem is that I don't know how to figure out (at kernel mode of course) that system is powering on from hibernate mode.
I searched through almost all DDK docs, but found nothing usefull for my case. Anyone with more serious experiences?

Regards,
    BozzoCage
0
Comment
Question by:BozzoCage
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 1200 total points
ID: 6351872
0
 
LVL 2

Author Comment

by:BozzoCage
ID: 6352733
Thanks!
I was so deep in DDK Help that I though I read EVERYTHING.
Now my driver finally works as I wished :)

For others looking for same solution:
I found it on http://www.microsoft.com/hwdev/desinit/ONNOWwdm.HTM
----
Turning on a Device
When the policy owner decides to turn a device on (due to a received I/O request that requires the device to be on), the following actions occur:

The policy owner calls PoRequestPowerIrp to create an IRP_MJ_POWER/IRP_MN_SET_POWER IRP for the D0 state and send it to the FDO at the top of the device's IRP stack.
When the device driver receives the SET_POWER IRP, it merely fills in a completion routine, then forwards the IRP to its PDO using PoStartNextPowerIrp and PoCallDriver.
When the bus driver receives the SET_POWER IRP at the PDO, it exercises its standard hardware mechanisms to restore power to the device and then completes the IRP.
In its completion routine, the device driver restores all device context to return the device to D0.
The device driver calls PoSetPowerState to tell the operating system that the driver is now fully in the D0 power state.
Summary of key points:


The policy owner decides when to turn on the device and initiates that change by calling PoRequestPowerIrp to request a SET_POWER IRP.
The bus driver turns on the device using industry-standard mechanisms.
The device driver restores device context in the completion routine for the SET_POWER IRP.
---

Thanks,
  BozzoCage
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question