From 3d8bbde4fa6bbfa90497e140bcfc964212a48e31 Mon Sep 17 00:00:00 2001 From: Dmitry Chapyshev Date: Fri, 16 Jan 2009 06:44:40 +0000 Subject: [PATCH] - Implement RequestDeviceWakeup - Implement CancelDeviceWakeupRequest svn path=/trunk/; revision=38782 --- reactos/dll/win32/kernel32/misc/power.c | 48 ++++++++++++++++++++----- 1 file changed, 39 insertions(+), 9 deletions(-) diff --git a/reactos/dll/win32/kernel32/misc/power.c b/reactos/dll/win32/kernel32/misc/power.c index c02691597fb..5543546271d 100644 --- a/reactos/dll/win32/kernel32/misc/power.c +++ b/reactos/dll/win32/kernel32/misc/power.c @@ -54,6 +54,20 @@ NtInitiatePowerAction( IN BOOLEAN Asynchronous ); +NTSYSAPI +NTSTATUS +NTAPI +NtRequestDeviceWakeup( + IN HANDLE Device +); + +NTSYSAPI +NTSTATUS +NTAPI +NtCancelDeviceWakeupRequest( + IN HANDLE Device +); + /* PUBLIC FUNCTIONS ***********************************************************/ /* @@ -167,15 +181,23 @@ GetDevicePowerState(HANDLE hDevice, BOOL *pfOn) } /* - * @unimplemented + * @implemented */ BOOL WINAPI RequestDeviceWakeup(HANDLE hDevice) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - DPRINT1("RequestDeviceWakeup is UNIMPLEMENTED!\n"); - return 0; + NTSTATUS Status; + + Status = NtRequestDeviceWakeup(hDevice); + + if (!NT_SUCCESS(Status)) + { + SetLastErrorByStatus(Status); + return FALSE; + } + + return TRUE; } /* @@ -199,19 +221,27 @@ RequestWakeupLatency(LATENCY_TIME latency) } /* - * @unimplemented + * @implemented */ BOOL WINAPI CancelDeviceWakeupRequest(HANDLE hDevice) { - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - DPRINT1("CancelDeviceWakeupRequest is UNIMPLEMENTED!\n"); - return 0; + NTSTATUS Status; + + Status = NtCancelDeviceWakeupRequest(hDevice); + + if (!NT_SUCCESS(Status)) + { + SetLastErrorByStatus(Status); + return FALSE; + } + + return TRUE; } /* - * @unimplemented + * @implemented */ BOOL WINAPI