CallNtPowerInformation API失败,错误代码为STATUS_INVALID_PARAMETER

时间:2012-09-10 20:48:26

标签: c++ windows winapi power-management

我运行以下代码以从Windows操作系统获取视频显示超时:

SYSTEM_POWER_POLICY spp = {0};
DWORD dwRes = CallNtPowerInformation(SystemPowerPolicyAc, NULL, 0, &spp, sizeof(spp));
if(dwRes != STATUS_SUCCESS)
{
    //Error 0xC000000D or STATUS_INVALID_PARAMETER
    //An invalid parameter was passed to a service or function.
}
else
{
    int nTimeout = spp.VideoTimeout;
}

它可以在我的Windows 7上运行,但在另一台运行Windows 7的笔记本电脑上运行它会返回错误代码STATUS_INVALID_PARAMETER。有谁知道为什么?以及如何补救它?

0 个答案:

没有答案