Fix signed/unsigned comparison warnings.
[wine] / dlls / kernel / powermgnt.c
1 /*
2  * Copyright 1995 Thomas Sandford (tdgsandf@prds-grn.demon.co.uk)
3  * Copyright 2003 Dimitrie O. Paun
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  */
19
20 #include <stdarg.h>
21
22 #include "ntstatus.h"
23 #include "windef.h"
24 #include "winbase.h"
25 #include "wine/debug.h"
26
27 WINE_DEFAULT_DEBUG_CHANNEL(powermgnt);
28
29 /******************************************************************************
30  *           GetDevicePowerState   (KERNEL32.@)
31  */
32 BOOL WINAPI GetDevicePowerState(HANDLE hDevice, BOOL* pfOn)
33 {
34     FIXME("(hDevice %p pfOn %p): stub\n", hDevice, pfOn);
35     return TRUE; /* no information */
36 }
37
38 /***********************************************************************
39  *           GetSystemPowerStatus      (KERNEL32.@)
40  */
41 BOOL WINAPI GetSystemPowerStatus(LPSYSTEM_POWER_STATUS sps_ptr)
42 {
43     FIXME("(): stub, harmless.\n");
44     return FALSE;   /* no power management support */
45 }
46
47 /***********************************************************************
48  *           IsSystemResumeAutomatic   (KERNEL32.@)
49  */
50 BOOL WINAPI IsSystemResumeAutomatic(void)
51 {
52     FIXME("(): stub, harmless.\n");
53     return FALSE;
54 }
55
56 /***********************************************************************
57  *           RequestWakeupLatency      (KERNEL32.@)
58  */
59 BOOL WINAPI RequestWakeupLatency(LATENCY_TIME latency)
60 {
61     FIXME("(): stub, harmless.\n");
62     return TRUE;
63 }
64
65 /***********************************************************************
66  *           SetSystemPowerState      (KERNEL32.@)
67  */
68 BOOL WINAPI SetSystemPowerState(BOOL suspend_or_hibernate,
69                                   BOOL force_flag)
70 {
71     FIXME("(): stub, harmless.\n");
72     /* suspend_or_hibernate flag: w95 does not support
73        this feature anyway */
74
75     for ( ;0; )
76     {
77         if ( force_flag )
78         {
79         }
80         else
81         {
82         }
83     }
84     return TRUE;
85 }
86
87 /***********************************************************************
88  * SetThreadExecutionState (KERNEL32.@)
89  *
90  * Informs the system that activity is taking place for
91  * power management purposes.
92  */
93 EXECUTION_STATE WINAPI SetThreadExecutionState(EXECUTION_STATE flags)
94 {
95     static EXECUTION_STATE current =
96         ES_SYSTEM_REQUIRED | ES_DISPLAY_REQUIRED | ES_USER_PRESENT;
97     EXECUTION_STATE old = current;
98
99     FIXME("(0x%lx): stub, harmless.\n", flags);
100
101     if (!(current & ES_CONTINUOUS) || (flags & ES_CONTINUOUS))
102         current = flags;
103     return old;
104 }