Consolidate all kernel power management functions.

Provide prototypes and stubs for missing functions.
This commit is contained in:
Dimitrie O. Paun 2003-08-12 18:56:54 +00:00 committed by Alexandre Julliard
parent b5bd66e86f
commit cbefdefb02
7 changed files with 113 additions and 62 deletions

View File

@ -34,6 +34,7 @@ C_SRCS = \
lcformat.c \
local16.c \
locale.c \
powermgnt.c \
process.c \
resource.c \
resource16.c \

View File

@ -573,7 +573,7 @@
@ stdcall IsDBCSLeadByteEx(long long)
@ stub IsLSCallback
@ stub IsSLCallback
@ stub IsSystemResumeAutomatic
@ stdcall IsSystemResumeAutomatic()
@ stdcall IsValidCodePage(long)
@ stub IsValidLanguageGroup
@ stdcall IsValidLocale(long long)
@ -691,7 +691,7 @@
@ stdcall RemoveDirectoryA(str)
@ stdcall RemoveDirectoryW(wstr)
@ stub RequestDeviceWakeup
@ stub RequestWakeupLatency
@ stdcall RequestWakeupLatency(long)
@ stdcall ResetEvent(long)
@ stub ResetWriteWatch
@ stdcall ResumeThread(long)

100
dlls/kernel/powermgnt.c Normal file
View File

@ -0,0 +1,100 @@
/*
* Copyright 1995 Thomas Sandford (tdgsandf@prds-grn.demon.co.uk)
* Copyright 2003 Dimitrie O. Paun
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "winbase.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(powermgnt);
/******************************************************************************
* GetDevicePowerState (KERNEL32.@)
*/
BOOL WINAPI GetDevicePowerState(HANDLE hDevice, BOOL* pfOn)
{
FIXME("(hDevice %p pfOn %p): stub\n", hDevice, pfOn);
return TRUE; /* no information */
}
/***********************************************************************
* GetSystemPowerStatus (KERNEL32.@)
*/
BOOL WINAPI GetSystemPowerStatus(LPSYSTEM_POWER_STATUS sps_ptr)
{
FIXME("(): stub, harmless.\n");
return FALSE; /* no power management support */
}
/***********************************************************************
* IsSystemResumeAutomatic (KERNEL32.@)
*/
BOOL WINAPI IsSystemResumeAutomatic(void)
{
FIXME("(): stub, harmless.\n");
return FALSE;
}
/***********************************************************************
* RequestWakeupLatency (KERNEL32.@)
*/
BOOL WINAPI RequestWakeupLatency(LATENCY_TIME latency)
{
FIXME("(): stub, harmless.\n");
return TRUE;
}
/***********************************************************************
* SetSystemPowerState (KERNEL32.@)
*/
BOOL WINAPI SetSystemPowerState(BOOL suspend_or_hibernate,
BOOL force_flag)
{
FIXME("(): stub, harmless.\n");
/* suspend_or_hibernate flag: w95 does not support
this feature anyway */
for ( ;0; )
{
if ( force_flag )
{
}
else
{
}
}
return TRUE;
}
/***********************************************************************
* SetThreadExecutionState (KERNEL32.@)
*
* Informs the system that activity is taking place for
* power management purposes.
*/
EXECUTION_STATE WINAPI SetThreadExecutionState(EXECUTION_STATE flags)
{
static EXECUTION_STATE current =
ES_SYSTEM_REQUIRED | ES_DISPLAY_REQUIRED | ES_USER_PRESENT;
EXECUTION_STATE old = current;
FIXME("(0x%lx): stub, harmless.\n", flags);
if (!(current & ES_CONTINUOUS) || (flags & ES_CONTINUOUS))
current = flags;
return old;
}

View File

@ -238,25 +238,6 @@ DWORD WINAPI SetThreadIdealProcessor(
}
/***********************************************************************
* SetThreadExecutionState (KERNEL32.@)
*
* Informs the system that activity is taking place for
* power management purposes.
*/
EXECUTION_STATE WINAPI SetThreadExecutionState(EXECUTION_STATE flags)
{
static EXECUTION_STATE current =
ES_SYSTEM_REQUIRED|ES_DISPLAY_REQUIRED|ES_USER_PRESENT;
EXECUTION_STATE old = current;
if (!(current & ES_CONTINUOUS) || (flags & ES_CONTINUOUS))
current = flags;
FIXME("(0x%lx): stub, harmless (power management).\n", flags);
return old;
}
/* callback for QueueUserAPC */
static void CALLBACK call_user_apc( ULONG_PTR arg1, ULONG_PTR arg2, ULONG_PTR arg3 )
{

View File

@ -1441,6 +1441,7 @@ BOOL WINAPI HeapWalk(HANDLE,LPPROCESS_HEAP_ENTRY);
DWORD WINAPI InitializeAcl(PACL,DWORD,DWORD);
BOOL WINAPI InitializeSecurityDescriptor(PSECURITY_DESCRIPTOR,DWORD);
BOOL WINAPI InitializeSid(PSID,PSID_IDENTIFIER_AUTHORITY,BYTE);
BOOL WINAPI IsSystemResumeAutomatic(void);
BOOL WINAPI IsTextUnicode(CONST LPVOID lpBuffer, int cb, LPINT lpi);
BOOL WINAPI IsValidSecurityDescriptor(PSECURITY_DESCRIPTOR);
BOOL WINAPI IsValidSid(PSID);
@ -1514,6 +1515,7 @@ BOOL WINAPI ReleaseMutex(HANDLE);
BOOL WINAPI ReleaseSemaphore(HANDLE,LONG,LPLONG);
BOOL WINAPI ReportEventA(HANDLE,WORD,WORD,DWORD,PSID,WORD,DWORD,LPCSTR *,LPVOID);
BOOL WINAPI ReportEventW(HANDLE,WORD,WORD,DWORD,PSID,WORD,DWORD,LPCWSTR *,LPVOID);
BOOL WINAPI RequestWakeupLatency(LATENCY_TIME latency);
#define ReportEvent WINELIB_NAME_AW(ReportEvent)
BOOL WINAPI ResetEvent(HANDLE);
DWORD WINAPI ResumeThread(HANDLE);

View File

@ -3375,6 +3375,13 @@ typedef enum tagSID_NAME_USE {
#define REG_QWORD 11 /* QWORD in little endian format */
#define REG_QWORD_LITTLE_ENDIAN 11 /* QWORD in little endian format */
/* ----------------------------- begin power management --------------------- */
typedef enum _LATENCY_TIME {
LT_DONT_CARE,
LT_LOWEST_LATENCY
} LATENCY_TIME, *PLATENCY_TIME;
/* ----------------------------- begin registry ----------------------------- */
/* Registry security values */

View File

@ -42,7 +42,6 @@ at a later date. */
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(win32);
WINE_DECLARE_DEBUG_CHANNEL(debug);
/****************************************************************************
@ -51,37 +50,7 @@ WINE_DECLARE_DEBUG_CHANNEL(debug);
BOOL WINAPI FlushInstructionCache(HANDLE hProcess, LPCVOID lpBaseAddress, SIZE_T dwSize)
{
if (GetVersion() & 0x80000000) return TRUE; /* not NT, always TRUE */
FIXME_(debug)("(0x%08lx,%p,0x%08lx): stub\n",(DWORD)hProcess, lpBaseAddress, dwSize);
return TRUE;
}
/***********************************************************************
* GetSystemPowerStatus (KERNEL32.@)
*/
BOOL WINAPI GetSystemPowerStatus(LPSYSTEM_POWER_STATUS sps_ptr)
{
return FALSE; /* no power management support */
}
/***********************************************************************
* SetSystemPowerState (KERNEL32.@)
*/
BOOL WINAPI SetSystemPowerState(BOOL suspend_or_hibernate,
BOOL force_flag)
{
/* suspend_or_hibernate flag: w95 does not support
this feature anyway */
for ( ;0; )
{
if ( force_flag )
{
}
else
{
}
}
FIXME("(%p,%p,0x%08lx): stub\n",hProcess, lpBaseAddress, dwSize);
return TRUE;
}
@ -201,15 +170,6 @@ BOOL WINAPI GetQueuedCompletionStatus(
return FALSE;
}
/******************************************************************************
* GetDevicePowerState (KERNEL32.@)
*/
BOOL WINAPI GetDevicePowerState(HANDLE hDevice, BOOL* pfOn)
{
FIXME("(hDevice %p pfOn %p): stub\n", hDevice, pfOn);
return TRUE; /* no information */
}
/***********************************************************************
* Beep (KERNEL32.@)
*/