- Move SetThreadExecutionState to power.c

- Implement IsSystemResumeAutomatic
- Implement SetThreadExecutionState

svn path=/trunk/; revision=38772
This commit is contained in:
Dmitry Chapyshev 2009-01-15 17:07:01 +00:00
parent 75ee158474
commit a45da19ead
2 changed files with 35 additions and 22 deletions

View file

@ -34,6 +34,19 @@ NtRequestWakeupLatency(
IN LATENCY_TIME latency
);
NTSYSAPI
BOOLEAN
NTAPI
NtIsSystemResumeAutomatic(VOID);
NTSYSAPI
NTSTATUS
NTAPI
NtSetThreadExecutionState(
IN EXECUTION_STATE esFlags,
OUT EXECUTION_STATE *PreviousFlags
);
/* PUBLIC FUNCTIONS ***********************************************************/
/*
@ -181,8 +194,7 @@ BOOL
WINAPI
IsSystemResumeAutomatic(VOID)
{
STUB;
return 0;
return NtIsSystemResumeAutomatic();
}
/*
@ -196,3 +208,24 @@ SetMessageWaitingIndicator(HANDLE hMsgIndicator,
STUB;
return 0;
}
/*
* @implemented
*/
EXECUTION_STATE
WINAPI
SetThreadExecutionState(EXECUTION_STATE esFlags)
{
EXECUTION_STATE OldFlags;
NTSTATUS Status;
Status = NtSetThreadExecutionState(esFlags, &OldFlags);
if (!NT_SUCCESS(Status))
{
SetLastErrorByStatus(Status);
return 0;
}
return OldFlags;
}

View file

@ -561,26 +561,6 @@ RestoreLastError(
STUB;
}
/*
* @unimplemented
*/
EXECUTION_STATE
WINAPI
SetThreadExecutionState(
EXECUTION_STATE esFlags
)
{
static EXECUTION_STATE current =
ES_SYSTEM_REQUIRED | ES_DISPLAY_REQUIRED | ES_USER_PRESENT;
EXECUTION_STATE old = current;
DPRINT1("(0x%x): stub, harmless.\n", esFlags);
if (!(current & ES_CONTINUOUS) || (esFlags & ES_CONTINUOUS))
current = esFlags;
return old;
}
/*
* @implemented
*/