Solved

Driver development - power management

Posted on 2001-08-03
2
204 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 300 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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

732 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