Free the debug info when making a critical section global.
[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 "winbase.h"
21 #include "wine/debug.h"
22
23 WINE_DEFAULT_DEBUG_CHANNEL(powermgnt);
24
25 /******************************************************************************
26  *           GetDevicePowerState   (KERNEL32.@)
27  */
28 BOOL WINAPI GetDevicePowerState(HANDLE hDevice, BOOL* pfOn)
29 {
30     FIXME("(hDevice %p pfOn %p): stub\n", hDevice, pfOn);
31     return TRUE; /* no information */
32 }
33
34 /***********************************************************************
35  *           GetSystemPowerStatus      (KERNEL32.@)
36  */
37 BOOL WINAPI GetSystemPowerStatus(LPSYSTEM_POWER_STATUS sps_ptr)
38 {
39     FIXME("(): stub, harmless.\n");
40     return FALSE;   /* no power management support */
41 }
42
43 /***********************************************************************
44  *           IsSystemResumeAutomatic   (KERNEL32.@)
45  */
46 BOOL WINAPI IsSystemResumeAutomatic(void)
47 {
48     FIXME("(): stub, harmless.\n");
49     return FALSE;
50 }
51
52 /***********************************************************************
53  *           RequestWakeupLatency      (KERNEL32.@)
54  */
55 BOOL WINAPI RequestWakeupLatency(LATENCY_TIME latency)
56 {
57     FIXME("(): stub, harmless.\n");
58     return TRUE;
59 }
60
61 /***********************************************************************
62  *           SetSystemPowerState      (KERNEL32.@)
63  */
64 BOOL WINAPI SetSystemPowerState(BOOL suspend_or_hibernate,
65                                   BOOL force_flag)
66 {
67     FIXME("(): stub, harmless.\n");
68     /* suspend_or_hibernate flag: w95 does not support
69        this feature anyway */
70
71     for ( ;0; )
72     {
73         if ( force_flag )
74         {
75         }
76         else
77         {
78         }
79     }
80     return TRUE;
81 }
82
83 /***********************************************************************
84  * SetThreadExecutionState (KERNEL32.@)
85  *
86  * Informs the system that activity is taking place for
87  * power management purposes.
88  */
89 EXECUTION_STATE WINAPI SetThreadExecutionState(EXECUTION_STATE flags)
90 {
91     static EXECUTION_STATE current =
92         ES_SYSTEM_REQUIRED | ES_DISPLAY_REQUIRED | ES_USER_PRESENT;
93     EXECUTION_STATE old = current;
94
95     FIXME("(0x%lx): stub, harmless.\n", flags);
96
97     if (!(current & ES_CONTINUOUS) || (flags & ES_CONTINUOUS))
98         current = flags;
99     return old;
100 }