/* * @implemented */ BOOL WINAPI GetDevicePowerState(IN HANDLE hDevice, OUT BOOL *pfOn) { DEVICE_POWER_STATE DevicePowerState; NTSTATUS Status; Status = NtGetDevicePowerState(hDevice, &DevicePowerState); if (NT_SUCCESS(Status)) { *pfOn = (DevicePowerState == PowerDeviceUnspecified) || (DevicePowerState == PowerDeviceD0); return TRUE; } BaseSetLastNTError(Status); return FALSE; }
/* * @implemented */ BOOL WINAPI GetDevicePowerState(HANDLE hDevice, BOOL *pfOn) { DEVICE_POWER_STATE DevicePowerState; NTSTATUS Status; Status = NtGetDevicePowerState(hDevice, &DevicePowerState); if (NT_SUCCESS(Status)) { if ((DevicePowerState != PowerDeviceUnspecified) && (DevicePowerState != PowerDeviceD0)) *pfOn = FALSE; else *pfOn = TRUE; return TRUE; } SetLastErrorByStatus(Status); return FALSE; }