- Implement SetSystemPowerState

svn path=/trunk/; revision=38781
This commit is contained in:
Dmitry Chapyshev 2009-01-16 06:33:19 +00:00
parent 56f1f5bf69
commit ccd60957e3

View file

@ -15,9 +15,6 @@
#define NDEBUG #define NDEBUG
#include <debug.h> #include <debug.h>
#define STUB \
SetLastError(ERROR_CALL_NOT_IMPLEMENTED); \
DPRINT1("%s() is UNIMPLEMENTED!\n", __FUNCTION__)
NTSYSAPI NTSYSAPI
NTSTATUS NTSTATUS
@ -47,6 +44,16 @@ NtSetThreadExecutionState(
OUT EXECUTION_STATE *PreviousFlags OUT EXECUTION_STATE *PreviousFlags
); );
NTSYSAPI
NTSTATUS
NTAPI
NtInitiatePowerAction(
IN POWER_ACTION SystemAction,
IN SYSTEM_POWER_STATE MinSystemState,
IN ULONG Flags,
IN BOOLEAN Asynchronous
);
/* PUBLIC FUNCTIONS ***********************************************************/ /* PUBLIC FUNCTIONS ***********************************************************/
/* /*
@ -109,13 +116,27 @@ GetSystemPowerStatus(LPSYSTEM_POWER_STATUS PowerStatus)
} }
/* /*
* @unimplemented * @implemented
*/ */
BOOL WINAPI BOOL WINAPI
SetSystemPowerState(BOOL fSuspend, BOOL fForce) SetSystemPowerState(BOOL fSuspend, BOOL fForce)
{ {
STUB; SYSTEM_POWER_STATE MinSystemState = (!fSuspend ? PowerSystemHibernate : PowerSystemSleeping1);
return FALSE; ULONG Flags = (!fForce ? POWER_ACTION_QUERY_ALLOWED : 0);
NTSTATUS Status;
Status = NtInitiatePowerAction(PowerActionSleep,
MinSystemState,
Flags,
FALSE);
if (!NT_SUCCESS(Status))
{
SetLastErrorByStatus(Status);
return FALSE;
}
return TRUE;
} }
/* /*
@ -152,7 +173,8 @@ BOOL
WINAPI WINAPI
RequestDeviceWakeup(HANDLE hDevice) RequestDeviceWakeup(HANDLE hDevice)
{ {
STUB; SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
DPRINT1("RequestDeviceWakeup is UNIMPLEMENTED!\n");
return 0; return 0;
} }
@ -183,7 +205,8 @@ BOOL
WINAPI WINAPI
CancelDeviceWakeupRequest(HANDLE hDevice) CancelDeviceWakeupRequest(HANDLE hDevice)
{ {
STUB; SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
DPRINT1("CancelDeviceWakeupRequest is UNIMPLEMENTED!\n");
return 0; return 0;
} }
@ -205,7 +228,8 @@ WINAPI
SetMessageWaitingIndicator(HANDLE hMsgIndicator, SetMessageWaitingIndicator(HANDLE hMsgIndicator,
ULONG ulMsgCount) ULONG ulMsgCount)
{ {
STUB; SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
DPRINT1("SetMessageWaitingIndicator is UNIMPLEMENTED!\n");
return 0; return 0;
} }