Using KMDF to Power Down System

Hi,

I want to put my computer system in a low-power of “sleep” state using KMDF. The sleep states I want are: S3(Standby-mode), S4(Hibernation) and S5 (Soft Off).

I’ve been reviewing the KMDF framework and I think I found the method to do this in
WdfDeviceAssignS0IdleSettings. However, the layout for this method is as follows:

NTSTATUS
WdfDeviceAssignS0IdleSettings(
WDFDEVICE Device,
PWDF_DEVICE_POWER_POLICY_IDLE_SETTINGS Settings
);

Now, when I look at the WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS_INIT structure which is supposed to contain the appropriate S0 Idle settings, the only parm I see for “states” is the DxState. It almost appears that the method expects a “Dx” state to put the system in.

My question is: how can I specify S3, S4 and S5. Do I have the correct method? Is another Dx state supposed to be used to stand-in for S3, S4 and S5 or do I need another method altogether.

Thanks in advance for any help you can provide.

Min

WdfDeviceAssignS0IdleSettings, as it implies, allows you to specify (among other thnings) the D-state that your device can enter when it’s not being actively used… while the system remains in S0.

So, if you’re looking to actually actively transition the system to an Sx state, x!=0, this DDI doesn’t get you close.

Before we go down this road, can you describe what it is you want to do? What kind of device do you have, and what it is that you’re trying to accomplish?

Peter
OSR

Hi Peter,

Thanks for answering my post. Basically, I’m trying to communicate some information to our users that will be using one of my single board computers that’s running an Windows XP. My users will be developing applications to accomplish whatever task they wish (customized applications, etc.) and I’d like to tell them, “To power down the system from the application side, use this particular function, etc.”

Thanks in advance for any advice you can give.

Min

OK, what am I missing: Aren’t there standard Win32 functions that an application can use (from user mode) to power down a system? Is there a reason you want to initiate a system power state transition from your kernel mode driver and not from a user-mode app??

Peter
OSR

Call SetSuspendState() in user mode,
http://msdn2.microsoft.com/en-us/library/aa373201.aspx

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@yahoo.com
Sent: Thursday, July 26, 2007 2:48 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Using KMDF to Power Down System

Hi Peter,

Thanks for answering my post. Basically, I’m trying to communicate some
information to our users that will be using one of my single board
computers that’s running an Windows XP. My users will be developing
applications to accomplish whatever task they wish (customized
applications, etc.) and I’d like to tell them, “To power down the system
from the application side, use this particular function, etc.”

Thanks in advance for any advice you can give.

Min


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

xxxxx@osr.com wrote:

OK, what am I missing: Aren’t there standard Win32 functions that an application can use (from user mode) to power down a system? Is there a reason you want to initiate a system power state transition from your kernel mode driver and not from a user-mode app??

ExitWindowsEx( EWX_SHUTDOWN, -1 ) or ExitWindowsEx( EWX_POWEROFF, -1 )
should do it.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.