Author: dchapyshev
Date: Thu Jan 15 11:07:01 2009
New Revision: 38772
URL:
http://svn.reactos.org/svn/reactos?rev=38772&view=rev
Log:
- Move SetThreadExecutionState to power.c
- Implement IsSystemResumeAutomatic
- Implement SetThreadExecutionState
Modified:
trunk/reactos/dll/win32/kernel32/misc/power.c
trunk/reactos/dll/win32/kernel32/misc/stubs.c
Modified: trunk/reactos/dll/win32/kernel32/misc/power.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/po…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/misc/power.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/misc/power.c [iso-8859-1] Thu Jan 15 11:07:01 2009
@@ -34,6 +34,19 @@
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 @@
WINAPI
IsSystemResumeAutomatic(VOID)
{
- STUB;
- return 0;
+ return NtIsSystemResumeAutomatic();
}
/*
@@ -196,3 +208,24 @@
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;
+}
Modified: trunk/reactos/dll/win32/kernel32/misc/stubs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/st…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/misc/stubs.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/misc/stubs.c [iso-8859-1] Thu Jan 15 11:07:01 2009
@@ -559,26 +559,6 @@
)
{
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;
}
/*