在设备驱动程序在修改系统的电源状态吗?结贴后再拿100分来发。

AMinfo 2004-04-12 01:44:15
如题:WDM驱动程序中,能修改系统的电源状态吗?如果修改?
...全文
65 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
AMinfo 2004-04-13
  • 打赏
  • 举报
回复
xstring(麻雀),这贴先结,分先加,我们在另外一贴中讨论吧。谢谢您!
xstring 2004-04-12
  • 打赏
  • 举报
回复
ZwSetSystemPowerState
ZwSetSystemPowerState sets the power state of the system.

NTSYSAPI
NTSTATUS
NTAPI
ZwSetSystemPowerState(
IN POWER_ACTION SystemAction,
IN SYSTEM_POWER_STATE MinSystemState,
IN ULONG Flags
);
Parameters
SystemAction
Specifies the power action to perform.The permitted values are drawn from the enumeration POWER_ACTION:

typedef enum _POWER_ACTION {
PowerActionNone,
PowerActionReserved,
PowerActionSleep,
PowerActionHibernate,
PowerActionShutdown,
PowerActionShutdownReset,
PowerActionShutdownOff
} POWER_ACTION, *PPOWER_ACTION;

MinSystemState
Specifies the minimum power state to enter as a result of performing the action. The permitted values are drawn from the enumeration SYSTEM_POWER_STATE:

typedef enum _SYSTEM_POWER_STATE {
PowerSystemUnspecified = 0,
PowerSystemWorking,
PowerSystemSleeping1,
PowerSystemSleeping2,
PowerSystemSleeping3,
PowerSystemHibernate,
PowerSystemShutdown
} SYSTEM_POWER_STATE, *PSYSTEM_POWER_STATE;

Flags
Qualifies the SystemAction. Defined values include:

POWER_ACTION_QUERY_ALLOWED
POWER_ACTION_UI_ALLOWED
POWER_ACTION_OVERRIDE_APPS
POWER_ACTION_LOCK_CONSOLE
POWER_ACTION_DISABLE_WAKES
POWER_ACTION_CRITICAL

Return Value
Returns STATUS_SUCCESS or an error status, such as STATUS_PRIVILEGE_NOT_HELD, STATUS_ALREADY_COMMITTED, or STATUS_CANCELLED.

2,640

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 硬件/系统
社区管理员
  • 硬件/系统社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧