我运行以下代码以从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。有谁知道为什么?以及如何补救它?