网站首页  词典首页

请输入您要查询的函数:

 

术语 callntpowerinformation
释义 CallNtPowerInformation
语法:
C++
NTSTATUS WINAPI CallNtPowerInformation(
__in POWER_INFORMATION_LEVEL InformationLevel,
__in PVOID lpInputBuffer,
__in ULONG nInputBufferSize,
__out PVOID lpOutputBuffer,
__in ULONG nOutputBufferSize
);
CallNtPowerInformation功能
设置或检索功率信息。
参数
InformationLevel [in]
所要求的信息化Level。此值表示的具体权力资料,设置或检索。此参数必须是以下POWER_INFORMATION_LEVEL枚举类型值之一。
ValueMeaning
AdministratorPowerPolicy
9This信息化Level不支持。
Windows Server 2003中的Windows XP和Windows 2000:如果lpInBuffer不为NULL,而当前用户具有管理员权限,功能适用的ADMINISTRATOR_POWER_POLICY通过lpInBuffer到系统中。
接收缓冲区的lpOutputBuffer现行制度ADMINISTRATOR_POWER_POLICY结构。
应用程序可以使用这个级别选择设置或检索当前管理员覆盖。调用者必须具有管理员权限申请管理员覆盖,否则,该函数返回STATUS_ACCESS_DENIED。
LastSleepTime
第十五lpInBuffer参数必须为NULL,否则,该函数返回ERROR_INVALID_PARAMETER。
在lpOutputBuffer缓冲区接收ULONGLONG指定的中断时间计算,在100个在最后系统睡眠时间,纳秒单位。
Windows 2000中:此值不支持。
LastWakeTime
14The lpInBuffer参数必须为NULL,否则,该函数返回ERROR_INVALID_PARAMETER。
在lpOutputBuffer缓冲区接收ULONGLONG指定的中断时间计算,在100个在最后唤醒系统时,纳秒单位。
Windows 2000中:此值不支持。
ProcessorInformation
至11 lpInBuffer参数必须为NULL,否则该函数返回ERROR_INVALID_PARAMETER。
在lpOutputBuffer收到一个缓冲区为每个系统上安装的处理器PROCESSOR_POWER_INFORMATION结构。使用的GetSystemInfo函数检索处理器的数量。
ProcessorPowerPolicyAc
18This信息化Level不支持。
Windows Server 2003和Windows XP中:在lpInBuffer参数必须为NULL,否则,该函数返回ERROR_INVALID_PARAMETER。
在lpOutputBuffer缓冲区接收PROCESSOR_POWER_POLICY结构,包含当前系统处理器的电力政策时使用该系统使用AC运行(效用)的权力。
ProcessorPowerPolicyCurrent
22This信息化Level不支持。
Windows Server 2003和Windows XP中:在lpInBuffer参数必须为NULL,否则,该函数返回ERROR_INVALID_PARAMETER。
接收缓冲区的lpOutputBuffer在使用PROCESSOR_POWER_POLICY结构,包含当前系统的处理器电源的政策。
ProcessorPowerPolicyDc
19This信息化Level不支持。
Windows Server 2003和Windows XP中:在lpInBuffer参数必须为NULL,否则,该函数返回ERROR_INVALID_PARAMETER。
在lpOutputBuffer缓冲区接收PROCESSOR_POWER_POLICY结构,包含当前系统处理器的电力政策时使用该系统是使用电池电源运行。
SystemBatteryState
调取lpInBuffer参数必须为NULL,否则,该函数返回ERROR_INVALID_PARAMETER。
在lpOutputBuffer缓冲区接收SYSTEM_BATTERY_STATE结构,包含对现有制度的电池信息。
SystemExecutionState
16The lpInBuffer参数必须为NULL,否则该函数返回ERROR_INVALID_PARAMETER。
在lpOutputBuffer缓冲区接收乌龙值包含系统执行状态缓冲区。这个值可以包含任何以下值的组合:ES_SYSTEM_REQUIRED,ES_DISPLAY_REQUIRED,或ES_USER_PRESENT。有关详细信息,请参阅SetThreadExecutionState功能。
Windows 2000中:此值不支持。
SystemPowerCapabilities
4The lpInBuffer参数必须为NULL,否则,该函数返回ERROR_INVALID_PARAMETER。
在lpOutputBuffer缓冲接收SYSTEM_POWER_CAPABILITIES结构,包含当前系统电源功能。
此信息是当前支持的力量的能力。它可能改变驱动程序在系统中安装。例如,传统的设备驱动程序不支持电源管理禁用所有系统睡眠状态。
SystemPowerInformation
第十二lpInBuffer参数必须为NULL,否则,该函数返回ERROR_INVALID_PARAMETER。
在lpOutputBuffer缓冲区接收SYSTEM_POWER_INFORMATION结构。
应用程序可以使用这个Level检索有关系统游手好闲的信息。
SystemPowerPolicyAc
0If lpInBuffer不是NULL,函数适用的SYSTEM_POWER_POLICY值传递lpInBuffer现行政策所用的系统电源在系统运行的交流(效用)的权力。
在lpOutputBuffer缓冲区接收SYSTEM_POWER_POLICY结构,包含当前系统的电源使用的政策,在系统运行的交流(效用)的权力。
SystemPowerPolicyCurrent
8The lpInBuffer参数必须为NULL,否则,该函数返回ERROR_INVALID_PARAMETER。
在lpOutputBuffer缓冲区接收SYSTEM_POWER_POLICY结构,包含当前系统的电源使用的政策,在系统运行的交流(效用)的权力。
SystemPowerPolicyDc
1If lpInBuffer不是NULL,函数适用的SYSTEM_POWER_POLICY值传递lpInBuffer现行政策所用的系统电源在系统使用电池电源运行。
在lpOutputBuffer缓冲区接收SYSTEM_POWER_POLICY结构,包含当前系统的电源使用的政策,在系统使用电池电源运行。
SystemReserveHiberFile
10If lpInBuffer不为NULL,而当前用户有足够的权限,功能提交或可以收回须持有启动卷上的冬眠图像的存储。
该lpInBuffer参数必须指向一个布尔值,表示预期的要求。如果该值为TRUE,休眠文件是保留,如果值为FALSE,休眠文件被删除。
VerifyProcessorPowerPolicyAc
20This信息化Level不支持。
Windows Server 2003和Windows XP:如果lpInBuffer和lpOutputBuffer不是NULL,则函数PROCESSOR_POWER_POLICY结构lpInBuffer传递给lpOutputBuffer和更新它代表处理器的性能和其他要求,同时该系统使用交流电源运行的副本。如果输入的政策也存在着一些无法更新设置,就会出现错误。
VerifyProcessorPowerPolicyDc
21This信息化Level不支持。
Windows Server 2003和Windows XP:如果lpInBuffer和lpOutputBuffer不是NULL,则函数PROCESSOR_POWER_POLICY结构lpInBuffer传递给lpOutputBuffer和更新它代表处理器的性能和其他要求,同时该系统使用电池电源运行的副本。如果输入的政策,也有人认为不能被更新的设置,就会出现错误。
VerifySystemPolicyAc
2This信息化Level不支持。
Windows Server 2003中的Windows XP和Windows 2000:如果lpInBuffer和lpOutputBuffer不是NULL,则函数SYSTEM_POWER_POLICY结构lpInBuffer传递给lpOutputBuffer和更新它代表系统功能和其他要求,同时该系统使用交流电源运行的副本。如果输入的政策,也有人认为不能被更新的设置,就会出现错误。
应用程序可以使用这个层面来验证一切权力行动的政策环境,并更新所有系统,以配合国家的是什么平台的支持。如果管理员重写存在,它是应用于SYSTEM_POWER_POLICY结构返回lpOutputBuffer。
VerifySystemPolicyDc
3This信息化Level不支持。
Windows Server 2003中的Windows XP和Windows 2000:如果lpInBuffer和lpOutputBuffer不是NULL,则函数SYSTEM_POWER_POLICY结构lpInBuffer传递给lpOutputBuffer和更新它代表系统功能和其他要求,同时该系统使用电池电源运行的副本。如果输入的政策,也有人认为不能被更新的设置,就会出现错误。
应用程序可以使用这个层面来验证一切权力行动的政策环境,并更新所有系统,以配合国家的是什么平台的支持。如果管理员重写存在,它是应用于SYSTEM_POWER_POLICY结构返回lpOutputBuffer。
lpInputBuffer [in]
对一个可选的输入缓冲区的指针。此缓冲区的数据类型取决于在InformationLevel参数要求的信息化Level。
nInputBufferSize [in]
在输入缓冲区的大小,以字节为单位。
lpOutputBuffer [out]
对一个可选的输出缓冲区的指针。此缓冲区的数据类型取决于在InformationLevel参数要求的信息化Level。如果缓冲区太小,无法包含的信息,该函数返回STATUS_BUFFER_TOO_SMALL。
nOutputBufferSize [in]
输出缓冲区的大小,以字节为单位。根据不同的信息化Level的要求,这可能是一个variably大小的缓冲区。
返回值
如果函数成功,返回值为了STATUS_SUCCESS。
如果函数失败,返回值可以是下面的状态代码。
StatusMeaning
STATUS_BUFFER_TOO_SMALLThe输出缓冲区是包含要返回的数据不足的大小。
STATUS_ACCESS_DENIEDThe来电者有足够的访问权限来执行所请求的操作。
备注
所做的更改当前系统电源策略使用CallNtPowerInformation是直接的,但并不持久,也就是说,变化不是作为一个电源方案的一部分存储。任何系统电源政策CallNtPowerInformation所做的更改可能会覆盖到的政策计划,在电源选项控制面板程序,或以WritePwrScheme,SetActivePwrScheme,或其他权力计划职能的后续调用用户所做的更改。
有关使用PowrProf.h信息,请参见电源使用方案。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderPowrProf.h
LibraryPowrProf.lib
DLLPowrProf.dll
参见
电源管理功能
ADMINISTRATOR_POWER_POLICY
PROCESSOR_POWER_INFORMATION
PROCESSOR_POWER_POLICY
SYSTEM_BATTERY_STATE
SYSTEM_POWER_CAPABILITIES
SYSTEM_POWER_INFORMATION
SYSTEM_POWER_POLICY
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月30日
==英文原文==CallNtPowerInformation Function
Sets or retrieves power information.
Syntax
C++
NTSTATUS WINAPI CallNtPowerInformation(
__in POWER_INFORMATION_LEVEL InformationLevel,
__in PVOID lpInputBuffer,
__in ULONG nInputBufferSize,
__out PVOID lpOutputBuffer,
__in ULONG nOutputBufferSize
);
Parameters
InformationLevel [in]
The information level requested. This value indicates the specific power information to be set or retrieved. This parameter must be one of the following POWER_INFORMATION_LEVEL enumeration type values.
ValueMeaning
AdministratorPowerPolicy
9This information level is not supported.
Windows Server 2003, Windows XP, and Windows 2000: If lpInBuffer is not NULL and the current user has administrator privileges, the function applies the ADMINISTRATOR_POWER_POLICY passed in lpInBuffer to the system.
The lpOutputBuffer buffer receives the current system ADMINISTRATOR_POWER_POLICY structure.
Applications can use this level to optionally set or retrieve the current administrator overrides. The caller must have administrator rights to apply an administrator override; otherwise, the function returns STATUS_ACCESS_DENIED.
LastSleepTime
15The lpInBuffer parameter must be NULL; otherwise, the function returns ERROR_INVALID_PARAMETER.
The lpOutputBuffer buffer receives a ULONGLONG that specifies the interrupt-time count, in 100-nanosecond units, at the last system sleep time.
Windows 2000: This value is not supported.
LastWakeTime
14The lpInBuffer parameter must be NULL; otherwise, the function returns ERROR_INVALID_PARAMETER.
The lpOutputBuffer buffer receives a ULONGLONG that specifies the interrupt-time count, in 100-nanosecond units, at the last system wake time.
Windows 2000: This value is not supported.
ProcessorInformation
11The lpInBuffer parameter must be NULL; otherwise the function returns ERROR_INVALID_PARAMETER.
The lpOutputBuffer buffer receives one PROCESSOR_POWER_INFORMATION structure for each processor that is installed on the system. Use the GetSystemInfo function to retrieve the number of processors.
ProcessorPowerPolicyAc
18This information level is not supported.
Windows Server 2003 and Windows XP: The lpInBuffer parameter must be NULL, otherwise, the function returns ERROR_INVALID_PARAMETER.
The lpOutputBuffer buffer receives a PROCESSOR_POWER_POLICY structure containing the current system processor power policy used while the system is running on AC (utility) power.
ProcessorPowerPolicyCurrent
22This information level is not supported.
Windows Server 2003 and Windows XP: The lpInBuffer parameter must be NULL; otherwise, the function returns ERROR_INVALID_PARAMETER.
The lpOutputBuffer buffer receives a PROCESSOR_POWER_POLICY structure containing the current system processor power policy in use.
ProcessorPowerPolicyDc
19This information level is not supported.
Windows Server 2003 and Windows XP: The lpInBuffer parameter must be NULL; otherwise, the function returns ERROR_INVALID_PARAMETER.
The lpOutputBuffer buffer receives a PROCESSOR_POWER_POLICY structure containing the current system processor power policy used while the system is running on battery power.
SystemBatteryState
5The lpInBuffer parameter must be NULL; otherwise, the function returns ERROR_INVALID_PARAMETER.
The lpOutputBuffer buffer receives a SYSTEM_BATTERY_STATE structure containing information about the current system battery.
SystemExecutionState
16The lpInBuffer parameter must be NULL; otherwise the function returns ERROR_INVALID_PARAMETER.
The lpOutputBuffer buffer receives a ULONG value containing the system execution state buffer. This value may contain any combination of the following values: ES_SYSTEM_REQUIRED, ES_DISPLAY_REQUIRED, or ES_USER_PRESENT. For more information, see the SetThreadExecutionState function.
Windows 2000: This value is not supported.
SystemPowerCapabilities
4The lpInBuffer parameter must be NULL, otherwise, the function returns ERROR_INVALID_PARAMETER.
The lpOutputBuffer buffer receives a SYSTEM_POWER_CAPABILITIES structure containing the current system power capabilities.
This information represents the currently supported power capabilities. It may change as drivers are installed in the system. For example, installation of legacy device drivers that do not support power management disables all system sleep states.
SystemPowerInformation
12The lpInBuffer parameter must be NULL; otherwise, the function returns ERROR_INVALID_PARAMETER.
The lpOutputBuffer buffer receives a SYSTEM_POWER_INFORMATION structure.
Applications can use this level to retrieve information about the idleness of the system.
SystemPowerPolicyAc
0If lpInBuffer is not NULL, the function applies the SYSTEM_POWER_POLICY values passed in lpInBuffer to the current system power policy used while the system is running on AC (utility) power.
The lpOutputBuffer buffer receives a SYSTEM_POWER_POLICY structure containing the current system power policy used while the system is running on AC (utility) power.
SystemPowerPolicyCurrent
8The lpInBuffer parameter must be NULL; otherwise, the function returns ERROR_INVALID_PARAMETER.
The lpOutputBuffer buffer receives a SYSTEM_POWER_POLICY structure containing the current system power policy used while the system is running on AC (utility) power.
SystemPowerPolicyDc
1If lpInBuffer is not NULL, the function applies the SYSTEM_POWER_POLICY values passed in lpInBuffer to the current system power policy used while the system is running on battery power.
The lpOutputBuffer buffer receives a SYSTEM_POWER_POLICY structure containing the current system power policy used while the system is running on battery power.
SystemReserveHiberFile
10If lpInBuffer is not NULL and the current user has sufficient privileges, the function commits or decommits the storage required to hold the hibernation image on the boot volume.
The lpInBuffer parameter must point to a BOOLEAN value indicating the desired request. If the value is TRUE, the hibernation file is reserved; if the value is FALSE, the hibernation file is removed.
VerifyProcessorPowerPolicyAc
20This information level is not supported.
Windows Server 2003 and Windows XP: If lpInBuffer and lpOutputBuffer are not NULL, the function copies the PROCESSOR_POWER_POLICY structure passed in lpInBuffer to lpOutputBuffer and updates it to represent processor capabilities and other requirements while the system is running on AC power. If the input policy has some setting which cannot be updated, an error occurs.
VerifyProcessorPowerPolicyDc
21This information level is not supported.
Windows Server 2003 and Windows XP: If lpInBuffer and lpOutputBuffer are not NULL, the function copies the PROCESSOR_POWER_POLICY structure passed in lpInBuffer to lpOutputBuffer and updates it to represent processor capabilities and other requirements while the system is running on battery power. If the input policy has some setting that cannot be updated, an error occurs.
VerifySystemPolicyAc
2This information level is not supported.
Windows Server 2003, Windows XP, and Windows 2000: If lpInBuffer and lpOutputBuffer are not NULL, the function copies the SYSTEM_POWER_POLICY structure passed in lpInBuffer to lpOutputBuffer and updates it to represent system capabilities and other requirements while the system is running on AC power. If the input policy has some setting that cannot be updated, an error occurs.
Applications can use this level to verify all power action policy settings, and update all system states to match what is supported by the platform. If an administrator override exists, it is applied to the SYSTEM_POWER_POLICY structure returned in lpOutputBuffer.
VerifySystemPolicyDc
3This information level is not supported.
Windows Server 2003, Windows XP, and Windows 2000: If lpInBuffer and lpOutputBuffer are not NULL, the function copies the SYSTEM_POWER_POLICY structure passed in lpInBuffer to lpOutputBuffer and updates it to represent system capabilities and other requirements while the system is running on battery power. If the input policy has some setting that cannot be updated, an error occurs.
Applications can use this level to verify all power action policy settings, and update all system states to match what is supported by the platform. If an administrator override exists, it is applied to the SYSTEM_POWER_POLICY structure returned in lpOutputBuffer.

lpInputBuffer [in]
A pointer to an optional input buffer. The data type of this buffer depends on the information level requested in the InformationLevel parameter.
nInputBufferSize [in]
The size of the input buffer, in bytes.
lpOutputBuffer [out]
A pointer to an optional output buffer. The data type of this buffer depends on the information level requested in the InformationLevel parameter. If the buffer is too small to contain the information, the function returns STATUS_BUFFER_TOO_SMALL.
nOutputBufferSize [in]
The size of the output buffer, in bytes. Depending on the information level requested, this may be a variably sized buffer.
Return Value
If the function succeeds, the return value is STATUS_SUCCESS.
If the function fails, the return value can be one the following status codes.
StatusMeaning
STATUS_BUFFER_TOO_SMALLThe output buffer is of insufficient size to contain the data to be returned.
STATUS_ACCESS_DENIEDThe caller had insufficient access rights to perform the requested action.

Remarks
Changes made to the current system power policy using CallNtPowerInformation are immediate, but they are not persistent; that is, the changes are not stored as part of a power scheme. Any changes to system power policy made with CallNtPowerInformation may be overwritten by changes to a policy scheme made by the user in the Power Options control panel program, or by subsequent calls to WritePwrScheme , SetActivePwrScheme , or other power scheme functions.
For more information on using PowrProf.h, see Power Schemes .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderPowrProf.h
LibraryPowrProf.lib
DLLPowrProf.dll
See Also
Power Management Functions
ADMINISTRATOR_POWER_POLICY
PROCESSOR_POWER_INFORMATION
PROCESSOR_POWER_POLICY
SYSTEM_BATTERY_STATE
SYSTEM_POWER_CAPABILITIES
SYSTEM_POWER_INFORMATION
SYSTEM_POWER_POLICY
Send comments about this topic to Microsoft
Build date: 7/30/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa372675(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:31:04