Alexandre Julliard | 234bc24 | 1994-12-10 13:02:28 +0000 | [diff] [blame] | 1 | /* |
Alexandre Julliard | b817f4f | 1996-03-14 18:08:34 +0000 | [diff] [blame] | 2 | * Misc. USER functions |
| 3 | * |
| 4 | * Copyright 1993 Robert J. Amstadt |
Vincent Béron | 9a62491 | 2002-05-31 23:06:46 +0000 | [diff] [blame] | 5 | * 1996 Alex Korobka |
Alexandre Julliard | 0799c1a | 2002-03-09 23:29:33 +0000 | [diff] [blame] | 6 | * |
| 7 | * This library is free software; you can redistribute it and/or |
| 8 | * modify it under the terms of the GNU Lesser General Public |
| 9 | * License as published by the Free Software Foundation; either |
| 10 | * version 2.1 of the License, or (at your option) any later version. |
| 11 | * |
| 12 | * This library is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 | * Lesser General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU Lesser General Public |
| 18 | * License along with this library; if not, write to the Free Software |
| 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Alexandre Julliard | b817f4f | 1996-03-14 18:08:34 +0000 | [diff] [blame] | 20 | */ |
| 21 | |
Alexandre Julliard | e37c6e1 | 2003-09-05 23:08:26 +0000 | [diff] [blame] | 22 | #include <stdarg.h> |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 23 | #include <stdlib.h> |
James Juran | f4d5fef | 2001-01-26 20:43:40 +0000 | [diff] [blame] | 24 | #include <string.h> |
Marcus Meissner | 61afa33 | 1999-02-22 10:16:00 +0000 | [diff] [blame] | 25 | #include "wine/winbase16.h" |
Jeremy White | d3e22d9 | 2000-02-10 19:03:02 +0000 | [diff] [blame] | 26 | #include "windef.h" |
Alexandre Julliard | e37c6e1 | 2003-09-05 23:08:26 +0000 | [diff] [blame] | 27 | #include "winbase.h" |
Jeremy White | d3e22d9 | 2000-02-10 19:03:02 +0000 | [diff] [blame] | 28 | #include "wingdi.h" |
Marcus Meissner | 61afa33 | 1999-02-22 10:16:00 +0000 | [diff] [blame] | 29 | #include "winuser.h" |
Alexandre Julliard | 9fcd89a | 2001-12-17 22:12:23 +0000 | [diff] [blame] | 30 | #include "wine/winuser16.h" |
Alexandre Julliard | f9be2f3 | 2003-11-17 20:31:29 +0000 | [diff] [blame] | 31 | #include "winreg.h" |
| 32 | #include "winternl.h" |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 33 | #include "user.h" |
Alexandre Julliard | 7e56f68 | 1996-01-31 19:02:28 +0000 | [diff] [blame] | 34 | #include "win.h" |
Alexandre Julliard | 91222da | 2000-12-10 23:01:33 +0000 | [diff] [blame] | 35 | #include "controls.h" |
Ulrich Weigand | 1b938b1 | 1999-03-10 14:03:06 +0000 | [diff] [blame] | 36 | #include "cursoricon.h" |
Alexandre Julliard | 2c69f6d | 1996-09-28 18:11:01 +0000 | [diff] [blame] | 37 | #include "message.h" |
Patrik Stridvall | 8d8703c | 1999-02-04 14:05:38 +0000 | [diff] [blame] | 38 | #include "local.h" |
Alexandre Julliard | 0799c1a | 2002-03-09 23:29:33 +0000 | [diff] [blame] | 39 | #include "wine/debug.h" |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 40 | |
Dimitrie O. Paun | 475cdcb | 2004-02-26 05:30:54 +0000 | [diff] [blame] | 41 | WINE_DEFAULT_DEBUG_CHANNEL(user); |
Patrik Stridvall | b4b9fae | 1999-04-19 14:56:29 +0000 | [diff] [blame] | 42 | |
Alexandre Julliard | 19b6a49 | 2003-08-12 23:50:54 +0000 | [diff] [blame] | 43 | static SYSLEVEL USER_SysLevel; |
| 44 | static CRITICAL_SECTION_DEBUG critsect_debug = |
| 45 | { |
| 46 | 0, 0, &USER_SysLevel.crst, |
| 47 | { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, |
| 48 | 0, 0, { 0, (DWORD)(__FILE__ ": USER_SysLevel") } |
| 49 | }; |
| 50 | static SYSLEVEL USER_SysLevel = { { &critsect_debug, -1, 0, 0, 0, 0 }, 2 }; |
Alexandre Julliard | 6837b9c | 2001-08-16 18:14:22 +0000 | [diff] [blame] | 51 | |
Alexandre Julliard | c963e25 | 2003-05-15 23:11:00 +0000 | [diff] [blame] | 52 | /* USER signal proc flags and codes */ |
| 53 | /* See UserSignalProc for comments */ |
| 54 | #define USIG_FLAGS_WIN32 0x0001 |
| 55 | #define USIG_FLAGS_GUI 0x0002 |
| 56 | #define USIG_FLAGS_FEEDBACK 0x0004 |
| 57 | #define USIG_FLAGS_FAULT 0x0008 |
| 58 | |
| 59 | #define USIG_DLL_UNLOAD_WIN16 0x0001 |
| 60 | #define USIG_DLL_UNLOAD_WIN32 0x0002 |
| 61 | #define USIG_FAULT_DIALOG_PUSH 0x0003 |
| 62 | #define USIG_FAULT_DIALOG_POP 0x0004 |
| 63 | #define USIG_DLL_UNLOAD_ORPHANS 0x0005 |
| 64 | #define USIG_THREAD_INIT 0x0010 |
| 65 | #define USIG_THREAD_EXIT 0x0020 |
| 66 | #define USIG_PROCESS_CREATE 0x0100 |
| 67 | #define USIG_PROCESS_INIT 0x0200 |
| 68 | #define USIG_PROCESS_EXIT 0x0300 |
| 69 | #define USIG_PROCESS_DESTROY 0x0400 |
| 70 | #define USIG_PROCESS_RUNNING 0x0500 |
| 71 | #define USIG_PROCESS_LOADED 0x0600 |
| 72 | |
| 73 | |
Alexandre Julliard | e2abbb1 | 1995-03-19 17:39:39 +0000 | [diff] [blame] | 74 | /*********************************************************************** |
Patrik Stridvall | 2ece70e | 2000-12-22 01:38:01 +0000 | [diff] [blame] | 75 | * GetFreeSystemResources (USER.284) |
Alexandre Julliard | e2abbb1 | 1995-03-19 17:39:39 +0000 | [diff] [blame] | 76 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 77 | WORD WINAPI GetFreeSystemResources16( WORD resType ) |
Alexandre Julliard | e2abbb1 | 1995-03-19 17:39:39 +0000 | [diff] [blame] | 78 | { |
Alexandre Julliard | 2a2321b | 2000-08-19 21:38:55 +0000 | [diff] [blame] | 79 | HINSTANCE16 gdi_inst; |
| 80 | WORD gdi_heap; |
Alexandre Julliard | cdcdede | 1996-04-21 14:57:41 +0000 | [diff] [blame] | 81 | int userPercent, gdiPercent; |
Alexandre Julliard | e2abbb1 | 1995-03-19 17:39:39 +0000 | [diff] [blame] | 82 | |
Alexandre Julliard | 2a2321b | 2000-08-19 21:38:55 +0000 | [diff] [blame] | 83 | if ((gdi_inst = LoadLibrary16( "GDI" )) < 32) return 0; |
Alexandre Julliard | 9515336 | 2001-03-23 19:13:23 +0000 | [diff] [blame] | 84 | gdi_heap = gdi_inst | 7; |
Alexandre Julliard | 2a2321b | 2000-08-19 21:38:55 +0000 | [diff] [blame] | 85 | |
Alexandre Julliard | e2abbb1 | 1995-03-19 17:39:39 +0000 | [diff] [blame] | 86 | switch(resType) |
| 87 | { |
| 88 | case GFSR_USERRESOURCES: |
Alexandre Julliard | cdcdede | 1996-04-21 14:57:41 +0000 | [diff] [blame] | 89 | userPercent = (int)LOCAL_CountFree( USER_HeapSel ) * 100 / |
| 90 | LOCAL_HeapSize( USER_HeapSel ); |
| 91 | gdiPercent = 100; |
Alexandre Julliard | e2abbb1 | 1995-03-19 17:39:39 +0000 | [diff] [blame] | 92 | break; |
| 93 | |
| 94 | case GFSR_GDIRESOURCES: |
Alexandre Julliard | 2a2321b | 2000-08-19 21:38:55 +0000 | [diff] [blame] | 95 | gdiPercent = (int)LOCAL_CountFree( gdi_inst ) * 100 / |
| 96 | LOCAL_HeapSize( gdi_inst ); |
Alexandre Julliard | cdcdede | 1996-04-21 14:57:41 +0000 | [diff] [blame] | 97 | userPercent = 100; |
Alexandre Julliard | e2abbb1 | 1995-03-19 17:39:39 +0000 | [diff] [blame] | 98 | break; |
| 99 | |
| 100 | case GFSR_SYSTEMRESOURCES: |
Alexandre Julliard | cdcdede | 1996-04-21 14:57:41 +0000 | [diff] [blame] | 101 | userPercent = (int)LOCAL_CountFree( USER_HeapSel ) * 100 / |
| 102 | LOCAL_HeapSize( USER_HeapSel ); |
Alexandre Julliard | 2a2321b | 2000-08-19 21:38:55 +0000 | [diff] [blame] | 103 | gdiPercent = (int)LOCAL_CountFree( gdi_inst ) * 100 / |
| 104 | LOCAL_HeapSize( gdi_inst ); |
Alexandre Julliard | e2abbb1 | 1995-03-19 17:39:39 +0000 | [diff] [blame] | 105 | break; |
| 106 | |
| 107 | default: |
Alexandre Julliard | 2a2321b | 2000-08-19 21:38:55 +0000 | [diff] [blame] | 108 | userPercent = gdiPercent = 0; |
| 109 | break; |
Alexandre Julliard | e2abbb1 | 1995-03-19 17:39:39 +0000 | [diff] [blame] | 110 | } |
Alexandre Julliard | 2a2321b | 2000-08-19 21:38:55 +0000 | [diff] [blame] | 111 | FreeLibrary16( gdi_inst ); |
Dimitrie O. Paun | 475cdcb | 2004-02-26 05:30:54 +0000 | [diff] [blame] | 112 | TRACE("<- userPercent %d, gdiPercent %d\n", userPercent, gdiPercent); |
Francois Gouget | 6d77d3a | 2000-03-25 21:44:35 +0000 | [diff] [blame] | 113 | return (WORD)min( userPercent, gdiPercent ); |
Alexandre Julliard | e2abbb1 | 1995-03-19 17:39:39 +0000 | [diff] [blame] | 114 | } |
| 115 | |
| 116 | |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 117 | /********************************************************************** |
Patrik Stridvall | 2ece70e | 2000-12-22 01:38:01 +0000 | [diff] [blame] | 118 | * InitApp (USER.5) |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 119 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 120 | INT16 WINAPI InitApp16( HINSTANCE16 hInstance ) |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 121 | { |
Ulrich Weigand | 0be24af | 1999-01-20 13:16:32 +0000 | [diff] [blame] | 122 | /* Create task message queue */ |
Alexandre Julliard | 8afe662 | 2001-07-26 20:12:22 +0000 | [diff] [blame] | 123 | if ( !InitThreadInput16( 0, 0 ) ) return 0; |
Alexandre Julliard | fb9a919 | 1994-03-01 19:48:04 +0000 | [diff] [blame] | 124 | |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 125 | return 1; |
| 126 | } |
Alexandre Julliard | 2ace16a | 1996-04-28 15:09:19 +0000 | [diff] [blame] | 127 | |
Alexandre Julliard | 6837b9c | 2001-08-16 18:14:22 +0000 | [diff] [blame] | 128 | |
| 129 | /*********************************************************************** |
| 130 | * USER_Lock |
| 131 | */ |
| 132 | void USER_Lock(void) |
| 133 | { |
| 134 | _EnterSysLevel( &USER_SysLevel ); |
| 135 | } |
| 136 | |
| 137 | |
| 138 | /*********************************************************************** |
| 139 | * USER_Unlock |
| 140 | */ |
| 141 | void USER_Unlock(void) |
| 142 | { |
| 143 | _LeaveSysLevel( &USER_SysLevel ); |
| 144 | } |
| 145 | |
| 146 | |
| 147 | /*********************************************************************** |
| 148 | * USER_CheckNotLock |
| 149 | * |
| 150 | * Make sure that we don't hold the user lock. |
| 151 | */ |
| 152 | void USER_CheckNotLock(void) |
| 153 | { |
| 154 | _CheckNotSysLevel( &USER_SysLevel ); |
| 155 | } |
| 156 | |
| 157 | |
Ulrich Weigand | e392a0c | 1999-04-01 11:44:52 +0000 | [diff] [blame] | 158 | /*********************************************************************** |
Alexandre Julliard | 19b6a49 | 2003-08-12 23:50:54 +0000 | [diff] [blame] | 159 | * WIN_SuspendWndsLock |
| 160 | * |
| 161 | * Suspend the lock on WND structures. |
| 162 | * Returns the number of locks suspended |
| 163 | * FIXME: should be removed |
| 164 | */ |
| 165 | int WIN_SuspendWndsLock( void ) |
| 166 | { |
| 167 | int isuspendedLocks = _ConfirmSysLevel( &USER_SysLevel ); |
| 168 | int count = isuspendedLocks; |
| 169 | |
| 170 | while ( count-- > 0 ) |
| 171 | _LeaveSysLevel( &USER_SysLevel ); |
| 172 | |
| 173 | return isuspendedLocks; |
| 174 | } |
| 175 | |
| 176 | /*********************************************************************** |
| 177 | * WIN_RestoreWndsLock |
| 178 | * |
| 179 | * Restore the suspended locks on WND structures |
| 180 | * FIXME: should be removed |
| 181 | */ |
| 182 | void WIN_RestoreWndsLock( int ipreviousLocks ) |
| 183 | { |
| 184 | while ( ipreviousLocks-- > 0 ) |
| 185 | _EnterSysLevel( &USER_SysLevel ); |
| 186 | } |
| 187 | |
| 188 | /*********************************************************************** |
Patrik Stridvall | 2ece70e | 2000-12-22 01:38:01 +0000 | [diff] [blame] | 189 | * FinalUserInit (USER.400) |
Ulrich Weigand | 98c3053 | 1999-07-27 17:10:06 +0000 | [diff] [blame] | 190 | */ |
| 191 | void WINAPI FinalUserInit16( void ) |
| 192 | { |
| 193 | /* FIXME: Should chain to FinalGdiInit now. */ |
| 194 | } |
| 195 | |
| 196 | /*********************************************************************** |
Patrik Stridvall | 0c61028 | 2001-01-25 22:22:21 +0000 | [diff] [blame] | 197 | * SignalProc32 (USER.391) |
| 198 | * UserSignalProc (USER32.@) |
Ulrich Weigand | e392a0c | 1999-04-01 11:44:52 +0000 | [diff] [blame] | 199 | * |
Alexandre Julliard | c963e25 | 2003-05-15 23:11:00 +0000 | [diff] [blame] | 200 | * The exact meaning of the USER signals is undocumented, but this |
| 201 | * should cover the basic idea: |
Ulrich Weigand | e392a0c | 1999-04-01 11:44:52 +0000 | [diff] [blame] | 202 | * |
Alexandre Julliard | c963e25 | 2003-05-15 23:11:00 +0000 | [diff] [blame] | 203 | * USIG_DLL_UNLOAD_WIN16 |
| 204 | * This is sent when a 16-bit module is unloaded. |
| 205 | * |
| 206 | * USIG_DLL_UNLOAD_WIN32 |
| 207 | * This is sent when a 32-bit module is unloaded. |
| 208 | * |
| 209 | * USIG_DLL_UNLOAD_ORPHANS |
| 210 | * This is sent after the last Win3.1 module is unloaded, |
| 211 | * to allow removal of orphaned menus. |
| 212 | * |
| 213 | * USIG_FAULT_DIALOG_PUSH |
| 214 | * USIG_FAULT_DIALOG_POP |
| 215 | * These are called to allow USER to prepare for displaying a |
| 216 | * fault dialog, even though the fault might have happened while |
| 217 | * inside a USER critical section. |
| 218 | * |
| 219 | * USIG_THREAD_INIT |
| 220 | * This is called from the context of a new thread, as soon as it |
| 221 | * has started to run. |
| 222 | * |
| 223 | * USIG_THREAD_EXIT |
| 224 | * This is called, still in its context, just before a thread is |
| 225 | * about to terminate. |
| 226 | * |
| 227 | * USIG_PROCESS_CREATE |
| 228 | * This is called, in the parent process context, after a new process |
| 229 | * has been created. |
| 230 | * |
| 231 | * USIG_PROCESS_INIT |
| 232 | * This is called in the new process context, just after the main thread |
| 233 | * has started execution (after the main thread's USIG_THREAD_INIT has |
| 234 | * been sent). |
| 235 | * |
| 236 | * USIG_PROCESS_LOADED |
| 237 | * This is called after the executable file has been loaded into the |
| 238 | * new process context. |
| 239 | * |
| 240 | * USIG_PROCESS_RUNNING |
| 241 | * This is called immediately before the main entry point is called. |
| 242 | * |
| 243 | * USIG_PROCESS_EXIT |
| 244 | * This is called in the context of a process that is about to |
| 245 | * terminate (but before the last thread's USIG_THREAD_EXIT has |
| 246 | * been sent). |
| 247 | * |
| 248 | * USIG_PROCESS_DESTROY |
| 249 | * This is called after a process has terminated. |
| 250 | * |
| 251 | * |
| 252 | * The meaning of the dwFlags bits is as follows: |
| 253 | * |
| 254 | * USIG_FLAGS_WIN32 |
| 255 | * Current process is 32-bit. |
| 256 | * |
| 257 | * USIG_FLAGS_GUI |
| 258 | * Current process is a (Win32) GUI process. |
| 259 | * |
| 260 | * USIG_FLAGS_FEEDBACK |
| 261 | * Current process needs 'feedback' (determined from the STARTUPINFO |
| 262 | * flags STARTF_FORCEONFEEDBACK / STARTF_FORCEOFFFEEDBACK). |
| 263 | * |
| 264 | * USIG_FLAGS_FAULT |
| 265 | * The signal is being sent due to a fault. |
Ulrich Weigand | e392a0c | 1999-04-01 11:44:52 +0000 | [diff] [blame] | 266 | */ |
| 267 | WORD WINAPI UserSignalProc( UINT uCode, DWORD dwThreadOrProcessID, |
| 268 | DWORD dwFlags, HMODULE16 hModule ) |
| 269 | { |
Dimitrie O. Paun | 475cdcb | 2004-02-26 05:30:54 +0000 | [diff] [blame] | 270 | FIXME("(%04x, %08lx, %04lx, %04x)\n", |
| 271 | uCode, dwThreadOrProcessID, dwFlags, hModule ); |
Ulrich Weigand | e392a0c | 1999-04-01 11:44:52 +0000 | [diff] [blame] | 272 | /* FIXME: Should chain to GdiSignalProc now. */ |
Ulrich Weigand | e392a0c | 1999-04-01 11:44:52 +0000 | [diff] [blame] | 273 | return 0; |
| 274 | } |
| 275 | |
Ulrich Weigand | 937f4d3 | 1999-12-05 02:49:59 +0000 | [diff] [blame] | 276 | /*********************************************************************** |
Patrik Stridvall | 2ece70e | 2000-12-22 01:38:01 +0000 | [diff] [blame] | 277 | * ExitWindows (USER.7) |
Alexandre Julliard | 889f742 | 1997-04-15 17:19:52 +0000 | [diff] [blame] | 278 | */ |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 279 | BOOL16 WINAPI ExitWindows16( DWORD dwReturnCode, UINT16 wReserved ) |
Alexandre Julliard | 889f742 | 1997-04-15 17:19:52 +0000 | [diff] [blame] | 280 | { |
| 281 | return ExitWindowsEx( EWX_LOGOFF, 0xffffffff ); |
| 282 | } |
| 283 | |
| 284 | |
| 285 | /*********************************************************************** |
Patrik Stridvall | 2ece70e | 2000-12-22 01:38:01 +0000 | [diff] [blame] | 286 | * ExitWindowsExec (USER.246) |
Alexandre Julliard | d37eb36 | 1997-07-20 16:23:21 +0000 | [diff] [blame] | 287 | */ |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 288 | BOOL16 WINAPI ExitWindowsExec16( LPCSTR lpszExe, LPCSTR lpszParams ) |
Alexandre Julliard | d37eb36 | 1997-07-20 16:23:21 +0000 | [diff] [blame] | 289 | { |
Dimitrie O. Paun | 475cdcb | 2004-02-26 05:30:54 +0000 | [diff] [blame] | 290 | TRACE("Should run the following in DOS-mode: \"%s %s\"\n", |
| 291 | lpszExe, lpszParams); |
Alexandre Julliard | d37eb36 | 1997-07-20 16:23:21 +0000 | [diff] [blame] | 292 | return ExitWindowsEx( EWX_LOGOFF, 0xffffffff ); |
| 293 | } |
| 294 | |
| 295 | |
| 296 | /*********************************************************************** |
Patrik Stridvall | 2ece70e | 2000-12-22 01:38:01 +0000 | [diff] [blame] | 297 | * ExitWindowsEx (USER32.@) |
Alexandre Julliard | 889f742 | 1997-04-15 17:19:52 +0000 | [diff] [blame] | 298 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 299 | BOOL WINAPI ExitWindowsEx( UINT flags, DWORD reserved ) |
Alexandre Julliard | 889f742 | 1997-04-15 17:19:52 +0000 | [diff] [blame] | 300 | { |
| 301 | int i; |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 302 | BOOL result; |
Alexandre Julliard | 4ff32c8 | 2001-08-18 18:08:26 +0000 | [diff] [blame] | 303 | HWND *list, *phwnd; |
| 304 | |
Alexandre Julliard | 889f742 | 1997-04-15 17:19:52 +0000 | [diff] [blame] | 305 | /* We have to build a list of all windows first, as in EnumWindows */ |
| 306 | |
Alexandre Julliard | 9d9dac0 | 2001-08-24 19:28:21 +0000 | [diff] [blame] | 307 | if (!(list = WIN_ListChildren( GetDesktopWindow() ))) return FALSE; |
Alexandre Julliard | 889f742 | 1997-04-15 17:19:52 +0000 | [diff] [blame] | 308 | |
| 309 | /* Send a WM_QUERYENDSESSION message to every window */ |
| 310 | |
Alexandre Julliard | 4ff32c8 | 2001-08-18 18:08:26 +0000 | [diff] [blame] | 311 | for (i = 0; list[i]; i++) |
Alexandre Julliard | 889f742 | 1997-04-15 17:19:52 +0000 | [diff] [blame] | 312 | { |
| 313 | /* Make sure that the window still exists */ |
Alexandre Julliard | 4ff32c8 | 2001-08-18 18:08:26 +0000 | [diff] [blame] | 314 | if (!IsWindow( list[i] )) continue; |
| 315 | if (!SendMessageW( list[i], WM_QUERYENDSESSION, 0, 0 )) break; |
Alexandre Julliard | 889f742 | 1997-04-15 17:19:52 +0000 | [diff] [blame] | 316 | } |
Alexandre Julliard | 4ff32c8 | 2001-08-18 18:08:26 +0000 | [diff] [blame] | 317 | result = !list[i]; |
Alexandre Julliard | 889f742 | 1997-04-15 17:19:52 +0000 | [diff] [blame] | 318 | |
| 319 | /* Now notify all windows that got a WM_QUERYENDSESSION of the result */ |
| 320 | |
Alexandre Julliard | 4ff32c8 | 2001-08-18 18:08:26 +0000 | [diff] [blame] | 321 | for (phwnd = list; i > 0; i--, phwnd++) |
Alexandre Julliard | 889f742 | 1997-04-15 17:19:52 +0000 | [diff] [blame] | 322 | { |
Alexandre Julliard | 4ff32c8 | 2001-08-18 18:08:26 +0000 | [diff] [blame] | 323 | if (!IsWindow( *phwnd )) continue; |
| 324 | SendMessageW( *phwnd, WM_ENDSESSION, result, 0 ); |
Alexandre Julliard | 889f742 | 1997-04-15 17:19:52 +0000 | [diff] [blame] | 325 | } |
Alexandre Julliard | 9d9dac0 | 2001-08-24 19:28:21 +0000 | [diff] [blame] | 326 | HeapFree( GetProcessHeap(), 0, list ); |
Alexandre Julliard | 889f742 | 1997-04-15 17:19:52 +0000 | [diff] [blame] | 327 | |
Ulrich Weigand | c319c66 | 1999-05-22 16:18:36 +0000 | [diff] [blame] | 328 | if (result) ExitKernel16(); |
Rein Klazes | d684777 | 2004-02-05 01:24:48 +0000 | [diff] [blame] | 329 | return TRUE; |
Alexandre Julliard | 889f742 | 1997-04-15 17:19:52 +0000 | [diff] [blame] | 330 | } |
Alexandre Julliard | 60ce85c | 1998-02-01 18:33:27 +0000 | [diff] [blame] | 331 | |
Alexandre Julliard | 829fe32 | 1998-07-26 14:27:39 +0000 | [diff] [blame] | 332 | /*********************************************************************** |
Patrik Stridvall | 2ece70e | 2000-12-22 01:38:01 +0000 | [diff] [blame] | 333 | * ChangeDisplaySettingsA (USER32.@) |
Alexandre Julliard | 829fe32 | 1998-07-26 14:27:39 +0000 | [diff] [blame] | 334 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 335 | LONG WINAPI ChangeDisplaySettingsA( LPDEVMODEA devmode, DWORD flags ) |
Alexandre Julliard | 829fe32 | 1998-07-26 14:27:39 +0000 | [diff] [blame] | 336 | { |
Alex Pasadyn | 330179f | 2003-04-22 00:15:48 +0000 | [diff] [blame] | 337 | return ChangeDisplaySettingsExA(NULL,devmode,NULL,flags,NULL); |
| 338 | } |
Marcus Meissner | 5e2f50f | 1999-11-07 22:26:20 +0000 | [diff] [blame] | 339 | |
Alex Pasadyn | 330179f | 2003-04-22 00:15:48 +0000 | [diff] [blame] | 340 | /*********************************************************************** |
| 341 | * ChangeDisplaySettingsW (USER32.@) |
| 342 | */ |
| 343 | LONG WINAPI ChangeDisplaySettingsW( LPDEVMODEW devmode, DWORD flags ) |
| 344 | { |
| 345 | return ChangeDisplaySettingsExW(NULL,devmode,NULL,flags,NULL); |
Marcus Meissner | 5e2f50f | 1999-11-07 22:26:20 +0000 | [diff] [blame] | 346 | } |
| 347 | |
| 348 | /*********************************************************************** |
Patrik Stridvall | df75e89 | 2001-02-12 03:49:07 +0000 | [diff] [blame] | 349 | * ChangeDisplaySettings (USER.620) |
Eric Pouech | 982e0ce | 2001-01-28 23:44:56 +0000 | [diff] [blame] | 350 | */ |
| 351 | LONG WINAPI ChangeDisplaySettings16( LPDEVMODEA devmode, DWORD flags ) |
| 352 | { |
Eric Pouech | 982e0ce | 2001-01-28 23:44:56 +0000 | [diff] [blame] | 353 | return ChangeDisplaySettingsA(devmode, flags); |
| 354 | } |
| 355 | |
| 356 | /*********************************************************************** |
Patrik Stridvall | 2ece70e | 2000-12-22 01:38:01 +0000 | [diff] [blame] | 357 | * ChangeDisplaySettingsExA (USER32.@) |
Marcus Meissner | 5e2f50f | 1999-11-07 22:26:20 +0000 | [diff] [blame] | 358 | */ |
Vincent Béron | 9a62491 | 2002-05-31 23:06:46 +0000 | [diff] [blame] | 359 | LONG WINAPI ChangeDisplaySettingsExA( |
Marcus Meissner | 5e2f50f | 1999-11-07 22:26:20 +0000 | [diff] [blame] | 360 | LPCSTR devname, LPDEVMODEA devmode, HWND hwnd, DWORD flags, |
Alex Pasadyn | 330179f | 2003-04-22 00:15:48 +0000 | [diff] [blame] | 361 | LPVOID lparam |
Marcus Meissner | 5e2f50f | 1999-11-07 22:26:20 +0000 | [diff] [blame] | 362 | ) { |
Alex Pasadyn | 330179f | 2003-04-22 00:15:48 +0000 | [diff] [blame] | 363 | DEVMODEW devmodeW; |
| 364 | LONG ret; |
| 365 | UNICODE_STRING nameW; |
Alexandre Julliard | 829fe32 | 1998-07-26 14:27:39 +0000 | [diff] [blame] | 366 | |
Alex Pasadyn | 330179f | 2003-04-22 00:15:48 +0000 | [diff] [blame] | 367 | if (devname) RtlCreateUnicodeStringFromAsciiz(&nameW, devname); |
| 368 | else nameW.Buffer = NULL; |
Alexandre Julliard | 829fe32 | 1998-07-26 14:27:39 +0000 | [diff] [blame] | 369 | |
Alex Pasadyn | 330179f | 2003-04-22 00:15:48 +0000 | [diff] [blame] | 370 | if (devmode) |
| 371 | { |
| 372 | devmodeW.dmBitsPerPel = devmode->dmBitsPerPel; |
| 373 | devmodeW.dmPelsHeight = devmode->dmPelsHeight; |
| 374 | devmodeW.dmPelsWidth = devmode->dmPelsWidth; |
| 375 | devmodeW.dmDisplayFlags = devmode->dmDisplayFlags; |
| 376 | devmodeW.dmDisplayFrequency = devmode->dmDisplayFrequency; |
| 377 | devmodeW.dmFields = devmode->dmFields; |
| 378 | ret = ChangeDisplaySettingsExW(nameW.Buffer, &devmodeW, hwnd, flags, lparam); |
| 379 | } |
| 380 | else |
| 381 | { |
| 382 | ret = ChangeDisplaySettingsExW(nameW.Buffer, NULL, hwnd, flags, lparam); |
| 383 | } |
| 384 | |
| 385 | if (devname) RtlFreeUnicodeString(&nameW); |
| 386 | return ret; |
| 387 | } |
| 388 | |
| 389 | /*********************************************************************** |
| 390 | * ChangeDisplaySettingsExW (USER32.@) |
| 391 | */ |
| 392 | LONG WINAPI ChangeDisplaySettingsExW( LPCWSTR devname, LPDEVMODEW devmode, HWND hwnd, |
| 393 | DWORD flags, LPVOID lparam ) |
| 394 | { |
| 395 | /* Pass the request on to the driver */ |
| 396 | if (!USER_Driver.pChangeDisplaySettingsExW) return DISP_CHANGE_FAILED; |
| 397 | return USER_Driver.pChangeDisplaySettingsExW( devname, devmode, hwnd, flags, lparam ); |
Alexandre Julliard | 829fe32 | 1998-07-26 14:27:39 +0000 | [diff] [blame] | 398 | } |
| 399 | |
Alexandre Julliard | a11d7b1 | 1998-03-01 20:05:02 +0000 | [diff] [blame] | 400 | /*********************************************************************** |
Stefan Leichter | 27faf02 | 2002-11-18 19:44:46 +0000 | [diff] [blame] | 401 | * EnumDisplaySettingsW (USER32.@) |
Marcus Meissner | 66cd333 | 1998-10-27 15:41:54 +0000 | [diff] [blame] | 402 | * |
| 403 | * RETURNS |
Stefan Leichter | 27faf02 | 2002-11-18 19:44:46 +0000 | [diff] [blame] | 404 | * TRUE if nth setting exists found (described in the LPDEVMODEW struct) |
Marcus Meissner | 66cd333 | 1998-10-27 15:41:54 +0000 | [diff] [blame] | 405 | * FALSE if we do not have the nth setting |
Alexandre Julliard | a11d7b1 | 1998-03-01 20:05:02 +0000 | [diff] [blame] | 406 | */ |
Stefan Leichter | 27faf02 | 2002-11-18 19:44:46 +0000 | [diff] [blame] | 407 | BOOL WINAPI EnumDisplaySettingsW( |
| 408 | LPCWSTR name, /* [in] huh? */ |
Marcus Meissner | 66cd333 | 1998-10-27 15:41:54 +0000 | [diff] [blame] | 409 | DWORD n, /* [in] nth entry in display settings list*/ |
Stefan Leichter | 27faf02 | 2002-11-18 19:44:46 +0000 | [diff] [blame] | 410 | LPDEVMODEW devmode /* [out] devmode for that setting */ |
Marcus Meissner | 66cd333 | 1998-10-27 15:41:54 +0000 | [diff] [blame] | 411 | ) { |
Alex Pasadyn | 330179f | 2003-04-22 00:15:48 +0000 | [diff] [blame] | 412 | return EnumDisplaySettingsExW(name, n, devmode, 0); |
Alexandre Julliard | a11d7b1 | 1998-03-01 20:05:02 +0000 | [diff] [blame] | 413 | } |
| 414 | |
Juergen Schmied | 8e26b58 | 1998-10-23 12:51:38 +0000 | [diff] [blame] | 415 | /*********************************************************************** |
Stefan Leichter | 27faf02 | 2002-11-18 19:44:46 +0000 | [diff] [blame] | 416 | * EnumDisplaySettingsA (USER32.@) |
Juergen Schmied | 8e26b58 | 1998-10-23 12:51:38 +0000 | [diff] [blame] | 417 | */ |
Stefan Leichter | 27faf02 | 2002-11-18 19:44:46 +0000 | [diff] [blame] | 418 | BOOL WINAPI EnumDisplaySettingsA(LPCSTR name,DWORD n,LPDEVMODEA devmode) |
Alexandre Julliard | 193cf50 | 2002-01-01 00:24:30 +0000 | [diff] [blame] | 419 | { |
Alex Pasadyn | 330179f | 2003-04-22 00:15:48 +0000 | [diff] [blame] | 420 | return EnumDisplaySettingsExA(name, n, devmode, 0); |
Juergen Schmied | 8e26b58 | 1998-10-23 12:51:38 +0000 | [diff] [blame] | 421 | } |
Alexandre Julliard | 60ce85c | 1998-02-01 18:33:27 +0000 | [diff] [blame] | 422 | |
| 423 | /*********************************************************************** |
Patrik Stridvall | df75e89 | 2001-02-12 03:49:07 +0000 | [diff] [blame] | 424 | * EnumDisplaySettings (USER.621) |
Eric Pouech | 982e0ce | 2001-01-28 23:44:56 +0000 | [diff] [blame] | 425 | */ |
| 426 | BOOL16 WINAPI EnumDisplaySettings16( |
| 427 | LPCSTR name, /* [in] huh? */ |
| 428 | DWORD n, /* [in] nth entry in display settings list*/ |
| 429 | LPDEVMODEA devmode /* [out] devmode for that setting */ |
| 430 | ) { |
Eric Pouech | 982e0ce | 2001-01-28 23:44:56 +0000 | [diff] [blame] | 431 | return (BOOL16)EnumDisplaySettingsA(name, n, devmode); |
| 432 | } |
| 433 | |
| 434 | /*********************************************************************** |
Eric Pouech | a862f68 | 2001-02-26 22:33:29 +0000 | [diff] [blame] | 435 | * EnumDisplaySettingsExA (USER32.@) |
| 436 | */ |
| 437 | BOOL WINAPI EnumDisplaySettingsExA(LPCSTR lpszDeviceName, DWORD iModeNum, |
Vincent Béron | 9a62491 | 2002-05-31 23:06:46 +0000 | [diff] [blame] | 438 | LPDEVMODEA lpDevMode, DWORD dwFlags) |
Eric Pouech | a862f68 | 2001-02-26 22:33:29 +0000 | [diff] [blame] | 439 | { |
Alex Pasadyn | 330179f | 2003-04-22 00:15:48 +0000 | [diff] [blame] | 440 | DEVMODEW devmodeW; |
| 441 | BOOL ret; |
| 442 | UNICODE_STRING nameW; |
Eric Pouech | a862f68 | 2001-02-26 22:33:29 +0000 | [diff] [blame] | 443 | |
Alex Pasadyn | 330179f | 2003-04-22 00:15:48 +0000 | [diff] [blame] | 444 | if (lpszDeviceName) RtlCreateUnicodeStringFromAsciiz(&nameW, lpszDeviceName); |
| 445 | else nameW.Buffer = NULL; |
| 446 | |
| 447 | ret = EnumDisplaySettingsExW(nameW.Buffer,iModeNum,&devmodeW,dwFlags); |
| 448 | if (ret) |
| 449 | { |
| 450 | lpDevMode->dmBitsPerPel = devmodeW.dmBitsPerPel; |
| 451 | lpDevMode->dmPelsHeight = devmodeW.dmPelsHeight; |
| 452 | lpDevMode->dmPelsWidth = devmodeW.dmPelsWidth; |
| 453 | lpDevMode->dmDisplayFlags = devmodeW.dmDisplayFlags; |
| 454 | lpDevMode->dmDisplayFrequency = devmodeW.dmDisplayFrequency; |
| 455 | lpDevMode->dmFields = devmodeW.dmFields; |
| 456 | } |
| 457 | if (lpszDeviceName) RtlFreeUnicodeString(&nameW); |
| 458 | return ret; |
Eric Pouech | a862f68 | 2001-02-26 22:33:29 +0000 | [diff] [blame] | 459 | } |
| 460 | |
| 461 | /*********************************************************************** |
| 462 | * EnumDisplaySettingsExW (USER32.@) |
| 463 | */ |
| 464 | BOOL WINAPI EnumDisplaySettingsExW(LPCWSTR lpszDeviceName, DWORD iModeNum, |
Vincent Béron | 9a62491 | 2002-05-31 23:06:46 +0000 | [diff] [blame] | 465 | LPDEVMODEW lpDevMode, DWORD dwFlags) |
Eric Pouech | a862f68 | 2001-02-26 22:33:29 +0000 | [diff] [blame] | 466 | { |
Alex Pasadyn | 330179f | 2003-04-22 00:15:48 +0000 | [diff] [blame] | 467 | /* Pass the request on to the driver */ |
| 468 | if (!USER_Driver.pEnumDisplaySettingsExW) return FALSE; |
| 469 | return USER_Driver.pEnumDisplaySettingsExW(lpszDeviceName, iModeNum, lpDevMode, dwFlags); |
Eric Pouech | a862f68 | 2001-02-26 22:33:29 +0000 | [diff] [blame] | 470 | } |
| 471 | |
| 472 | /*********************************************************************** |
Patrik Stridvall | 2ece70e | 2000-12-22 01:38:01 +0000 | [diff] [blame] | 473 | * EnumDisplayDevicesA (USER32.@) |
Marcus Meissner | 8388f67 | 1999-09-19 12:09:23 +0000 | [diff] [blame] | 474 | */ |
| 475 | BOOL WINAPI EnumDisplayDevicesA( |
| 476 | LPVOID unused,DWORD i,LPDISPLAY_DEVICEA lpDisplayDevice,DWORD dwFlags |
| 477 | ) { |
| 478 | if (i) |
| 479 | return FALSE; |
Dimitrie O. Paun | 475cdcb | 2004-02-26 05:30:54 +0000 | [diff] [blame] | 480 | FIXME("(%p,%ld,%p,0x%08lx), stub!\n",unused,i,lpDisplayDevice,dwFlags); |
Marcus Meissner | 8388f67 | 1999-09-19 12:09:23 +0000 | [diff] [blame] | 481 | strcpy(lpDisplayDevice->DeviceName,"X11"); |
| 482 | strcpy(lpDisplayDevice->DeviceString,"X 11 Windowing System"); |
| 483 | lpDisplayDevice->StateFlags = |
| 484 | DISPLAY_DEVICE_ATTACHED_TO_DESKTOP | |
| 485 | DISPLAY_DEVICE_PRIMARY_DEVICE | |
| 486 | DISPLAY_DEVICE_VGA_COMPATIBLE; |
| 487 | return TRUE; |
| 488 | } |
| 489 | |
| 490 | /*********************************************************************** |
Patrik Stridvall | 2ece70e | 2000-12-22 01:38:01 +0000 | [diff] [blame] | 491 | * EnumDisplayDevicesW (USER32.@) |
Marcus Meissner | 8388f67 | 1999-09-19 12:09:23 +0000 | [diff] [blame] | 492 | */ |
| 493 | BOOL WINAPI EnumDisplayDevicesW( |
| 494 | LPVOID unused,DWORD i,LPDISPLAY_DEVICEW lpDisplayDevice,DWORD dwFlags |
| 495 | ) { |
| 496 | if (i) |
| 497 | return FALSE; |
Dimitrie O. Paun | 475cdcb | 2004-02-26 05:30:54 +0000 | [diff] [blame] | 498 | FIXME("(%p,%ld,%p,0x%08lx), stub!\n",unused,i,lpDisplayDevice,dwFlags); |
Alexandre Julliard | 24a62ab | 2000-11-28 22:40:56 +0000 | [diff] [blame] | 499 | MultiByteToWideChar( CP_ACP, 0, "X11", -1, lpDisplayDevice->DeviceName, |
| 500 | sizeof(lpDisplayDevice->DeviceName)/sizeof(WCHAR) ); |
| 501 | MultiByteToWideChar( CP_ACP, 0, "X11 Windowing System", -1, lpDisplayDevice->DeviceString, |
| 502 | sizeof(lpDisplayDevice->DeviceString)/sizeof(WCHAR) ); |
Marcus Meissner | 8388f67 | 1999-09-19 12:09:23 +0000 | [diff] [blame] | 503 | lpDisplayDevice->StateFlags = |
| 504 | DISPLAY_DEVICE_ATTACHED_TO_DESKTOP | |
| 505 | DISPLAY_DEVICE_PRIMARY_DEVICE | |
| 506 | DISPLAY_DEVICE_VGA_COMPATIBLE; |
| 507 | return TRUE; |
| 508 | } |
| 509 | |
| 510 | /*********************************************************************** |
Patrik Stridvall | 2ece70e | 2000-12-22 01:38:01 +0000 | [diff] [blame] | 511 | * SetEventHook (USER.321) |
Alexandre Julliard | 60ce85c | 1998-02-01 18:33:27 +0000 | [diff] [blame] | 512 | * |
| 513 | * Used by Turbo Debugger for Windows |
| 514 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 515 | FARPROC16 WINAPI SetEventHook16(FARPROC16 lpfnEventHook) |
Alexandre Julliard | 60ce85c | 1998-02-01 18:33:27 +0000 | [diff] [blame] | 516 | { |
Dimitrie O. Paun | 475cdcb | 2004-02-26 05:30:54 +0000 | [diff] [blame] | 517 | FIXME("(lpfnEventHook=%08x): stub\n", (UINT)lpfnEventHook); |
Alexandre Julliard | 60ce85c | 1998-02-01 18:33:27 +0000 | [diff] [blame] | 518 | return NULL; |
| 519 | } |
Alexandre Julliard | a69b88b | 1998-03-15 20:29:56 +0000 | [diff] [blame] | 520 | |
| 521 | /*********************************************************************** |
Patrik Stridvall | 2ece70e | 2000-12-22 01:38:01 +0000 | [diff] [blame] | 522 | * UserSeeUserDo (USER.216) |
Alexandre Julliard | a69b88b | 1998-03-15 20:29:56 +0000 | [diff] [blame] | 523 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 524 | DWORD WINAPI UserSeeUserDo16(WORD wReqType, WORD wParam1, WORD wParam2, WORD wParam3) |
Alexandre Julliard | a69b88b | 1998-03-15 20:29:56 +0000 | [diff] [blame] | 525 | { |
| 526 | switch (wReqType) |
| 527 | { |
| 528 | case USUD_LOCALALLOC: |
| 529 | return LOCAL_Alloc(USER_HeapSel, wParam1, wParam3); |
| 530 | case USUD_LOCALFREE: |
| 531 | return LOCAL_Free(USER_HeapSel, wParam1); |
| 532 | case USUD_LOCALCOMPACT: |
| 533 | return LOCAL_Compact(USER_HeapSel, wParam3, 0); |
| 534 | case USUD_LOCALHEAP: |
| 535 | return USER_HeapSel; |
| 536 | case USUD_FIRSTCLASS: |
Dimitrie O. Paun | 475cdcb | 2004-02-26 05:30:54 +0000 | [diff] [blame] | 537 | FIXME("return a pointer to the first window class.\n"); |
Alexandre Julliard | a69b88b | 1998-03-15 20:29:56 +0000 | [diff] [blame] | 538 | return (DWORD)-1; |
| 539 | default: |
Dimitrie O. Paun | 475cdcb | 2004-02-26 05:30:54 +0000 | [diff] [blame] | 540 | WARN("wReqType %04x (unknown)\n", wReqType); |
Alexandre Julliard | a69b88b | 1998-03-15 20:29:56 +0000 | [diff] [blame] | 541 | return (DWORD)-1; |
| 542 | } |
| 543 | } |
| 544 | |
Marcus Meissner | 9cfe2d5 | 1998-11-01 14:02:57 +0000 | [diff] [blame] | 545 | /*********************************************************************** |
Patrik Stridvall | 2ece70e | 2000-12-22 01:38:01 +0000 | [diff] [blame] | 546 | * GetSystemDebugState (USER.231) |
Alexandre Julliard | 4220b29 | 1999-07-11 17:20:01 +0000 | [diff] [blame] | 547 | */ |
| 548 | WORD WINAPI GetSystemDebugState16(void) |
| 549 | { |
| 550 | return 0; /* FIXME */ |
| 551 | } |
| 552 | |
| 553 | /*********************************************************************** |
Patrik Stridvall | 2ece70e | 2000-12-22 01:38:01 +0000 | [diff] [blame] | 554 | * RegisterLogonProcess (USER32.@) |
Marcus Meissner | 9cfe2d5 | 1998-11-01 14:02:57 +0000 | [diff] [blame] | 555 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 556 | DWORD WINAPI RegisterLogonProcess(HANDLE hprocess,BOOL x) { |
Dimitrie O. Paun | 475cdcb | 2004-02-26 05:30:54 +0000 | [diff] [blame] | 557 | FIXME("(%p,%d),stub!\n",hprocess,x); |
Marcus Meissner | 8143acc | 1998-10-31 12:19:56 +0000 | [diff] [blame] | 558 | return 1; |
| 559 | } |
| 560 | |
Marcus Meissner | 9cfe2d5 | 1998-11-01 14:02:57 +0000 | [diff] [blame] | 561 | /*********************************************************************** |
Patrik Stridvall | 2ece70e | 2000-12-22 01:38:01 +0000 | [diff] [blame] | 562 | * CreateWindowStationW (USER32.@) |
Marcus Meissner | 9cfe2d5 | 1998-11-01 14:02:57 +0000 | [diff] [blame] | 563 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 564 | HWINSTA WINAPI CreateWindowStationW( |
Marcus Meissner | 8143acc | 1998-10-31 12:19:56 +0000 | [diff] [blame] | 565 | LPWSTR winstation,DWORD res1,DWORD desiredaccess, |
| 566 | LPSECURITY_ATTRIBUTES lpsa |
| 567 | ) { |
Dimitrie O. Paun | 475cdcb | 2004-02-26 05:30:54 +0000 | [diff] [blame] | 568 | FIXME("(%s,0x%08lx,0x%08lx,%p),stub!\n",debugstr_w(winstation), |
Marcus Meissner | 8143acc | 1998-10-31 12:19:56 +0000 | [diff] [blame] | 569 | res1,desiredaccess,lpsa |
| 570 | ); |
François Gouget | 54300e5 | 2001-01-09 20:56:06 +0000 | [diff] [blame] | 571 | return (HWINSTA)0xdeadcafe; |
Marcus Meissner | 8143acc | 1998-10-31 12:19:56 +0000 | [diff] [blame] | 572 | } |
| 573 | |
Marcus Meissner | 9cfe2d5 | 1998-11-01 14:02:57 +0000 | [diff] [blame] | 574 | /*********************************************************************** |
Patrik Stridvall | 2ece70e | 2000-12-22 01:38:01 +0000 | [diff] [blame] | 575 | * SetProcessWindowStation (USER32.@) |
Marcus Meissner | 9cfe2d5 | 1998-11-01 14:02:57 +0000 | [diff] [blame] | 576 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 577 | BOOL WINAPI SetProcessWindowStation(HWINSTA hWinSta) { |
Dimitrie O. Paun | 475cdcb | 2004-02-26 05:30:54 +0000 | [diff] [blame] | 578 | FIXME("(%p),stub!\n",hWinSta); |
Marcus Meissner | 8143acc | 1998-10-31 12:19:56 +0000 | [diff] [blame] | 579 | return TRUE; |
| 580 | } |
| 581 | |
Marcus Meissner | 9cfe2d5 | 1998-11-01 14:02:57 +0000 | [diff] [blame] | 582 | /*********************************************************************** |
Patrik Stridvall | 2ece70e | 2000-12-22 01:38:01 +0000 | [diff] [blame] | 583 | * SetUserObjectSecurity (USER32.@) |
Marcus Meissner | 9cfe2d5 | 1998-11-01 14:02:57 +0000 | [diff] [blame] | 584 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 585 | BOOL WINAPI SetUserObjectSecurity( |
| 586 | HANDLE hObj, |
Francois Gouget | 326e2ba | 2000-06-18 17:26:44 +0000 | [diff] [blame] | 587 | PSECURITY_INFORMATION pSIRequested, |
Juergen Schmied | 1ed51af | 1999-02-12 17:47:07 +0000 | [diff] [blame] | 588 | PSECURITY_DESCRIPTOR pSID |
Marcus Meissner | 8143acc | 1998-10-31 12:19:56 +0000 | [diff] [blame] | 589 | ) { |
Dimitrie O. Paun | 475cdcb | 2004-02-26 05:30:54 +0000 | [diff] [blame] | 590 | FIXME("(%p,%p,%p),stub!\n",hObj,pSIRequested,pSID); |
Marcus Meissner | 8143acc | 1998-10-31 12:19:56 +0000 | [diff] [blame] | 591 | return TRUE; |
| 592 | } |
| 593 | |
Marcus Meissner | 9cfe2d5 | 1998-11-01 14:02:57 +0000 | [diff] [blame] | 594 | /*********************************************************************** |
Patrik Stridvall | 2ece70e | 2000-12-22 01:38:01 +0000 | [diff] [blame] | 595 | * CreateDesktopA (USER32.@) |
Peter Ganten | ae3716d | 2000-07-15 15:13:56 +0000 | [diff] [blame] | 596 | */ |
| 597 | HDESK WINAPI CreateDesktopA( |
| 598 | LPSTR lpszDesktop,LPSTR lpszDevice,LPDEVMODEA pDevmode, |
| 599 | DWORD dwFlags,DWORD dwDesiredAccess,LPSECURITY_ATTRIBUTES lpsa |
| 600 | ) { |
Dimitrie O. Paun | 475cdcb | 2004-02-26 05:30:54 +0000 | [diff] [blame] | 601 | FIXME("(%s,%s,%p,0x%08lx,0x%08lx,%p),stub!\n", |
Peter Ganten | ae3716d | 2000-07-15 15:13:56 +0000 | [diff] [blame] | 602 | lpszDesktop,lpszDevice,pDevmode, |
| 603 | dwFlags,dwDesiredAccess,lpsa |
| 604 | ); |
François Gouget | d6515df | 2001-01-03 21:39:33 +0000 | [diff] [blame] | 605 | return (HDESK)0xcafedead; |
Peter Ganten | ae3716d | 2000-07-15 15:13:56 +0000 | [diff] [blame] | 606 | } |
| 607 | |
| 608 | /*********************************************************************** |
Patrik Stridvall | 2ece70e | 2000-12-22 01:38:01 +0000 | [diff] [blame] | 609 | * CreateDesktopW (USER32.@) |
Marcus Meissner | 9cfe2d5 | 1998-11-01 14:02:57 +0000 | [diff] [blame] | 610 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 611 | HDESK WINAPI CreateDesktopW( |
| 612 | LPWSTR lpszDesktop,LPWSTR lpszDevice,LPDEVMODEW pDevmode, |
Marcus Meissner | 8143acc | 1998-10-31 12:19:56 +0000 | [diff] [blame] | 613 | DWORD dwFlags,DWORD dwDesiredAccess,LPSECURITY_ATTRIBUTES lpsa |
| 614 | ) { |
Dimitrie O. Paun | 475cdcb | 2004-02-26 05:30:54 +0000 | [diff] [blame] | 615 | FIXME("(%s,%s,%p,0x%08lx,0x%08lx,%p),stub!\n", |
Marcus Meissner | 8143acc | 1998-10-31 12:19:56 +0000 | [diff] [blame] | 616 | debugstr_w(lpszDesktop),debugstr_w(lpszDevice),pDevmode, |
| 617 | dwFlags,dwDesiredAccess,lpsa |
| 618 | ); |
François Gouget | d6515df | 2001-01-03 21:39:33 +0000 | [diff] [blame] | 619 | return (HDESK)0xcafedead; |
Marcus Meissner | 8143acc | 1998-10-31 12:19:56 +0000 | [diff] [blame] | 620 | } |
| 621 | |
Patrik Stridvall | 2d6457c | 2000-03-28 20:22:59 +0000 | [diff] [blame] | 622 | /*********************************************************************** |
Patrik Stridvall | 2ece70e | 2000-12-22 01:38:01 +0000 | [diff] [blame] | 623 | * EnumDesktopWindows (USER32.@) |
Peter Ganten | ae3716d | 2000-07-15 15:13:56 +0000 | [diff] [blame] | 624 | */ |
| 625 | BOOL WINAPI EnumDesktopWindows( HDESK hDesktop, WNDENUMPROC lpfn, LPARAM lParam ) { |
Dimitrie O. Paun | 475cdcb | 2004-02-26 05:30:54 +0000 | [diff] [blame] | 626 | FIXME("(%p, %p, 0x%08lx), stub!\n", hDesktop, lpfn, lParam ); |
Peter Ganten | ae3716d | 2000-07-15 15:13:56 +0000 | [diff] [blame] | 627 | return TRUE; |
| 628 | } |
| 629 | |
| 630 | |
| 631 | /*********************************************************************** |
Patrik Stridvall | 2ece70e | 2000-12-22 01:38:01 +0000 | [diff] [blame] | 632 | * CloseWindowStation (USER32.@) |
Patrik Stridvall | 2d6457c | 2000-03-28 20:22:59 +0000 | [diff] [blame] | 633 | */ |
Sergey Turchanov | 2f5a152 | 1999-04-10 16:48:46 +0000 | [diff] [blame] | 634 | BOOL WINAPI CloseWindowStation(HWINSTA hWinSta) |
| 635 | { |
Dimitrie O. Paun | 475cdcb | 2004-02-26 05:30:54 +0000 | [diff] [blame] | 636 | FIXME("(%p)\n", hWinSta); |
Sergey Turchanov | 2f5a152 | 1999-04-10 16:48:46 +0000 | [diff] [blame] | 637 | return TRUE; |
| 638 | } |
Patrik Stridvall | 2d6457c | 2000-03-28 20:22:59 +0000 | [diff] [blame] | 639 | |
| 640 | /*********************************************************************** |
Patrik Stridvall | 2ece70e | 2000-12-22 01:38:01 +0000 | [diff] [blame] | 641 | * CloseDesktop (USER32.@) |
Patrik Stridvall | 2d6457c | 2000-03-28 20:22:59 +0000 | [diff] [blame] | 642 | */ |
Sergey Turchanov | 2f5a152 | 1999-04-10 16:48:46 +0000 | [diff] [blame] | 643 | BOOL WINAPI CloseDesktop(HDESK hDesk) |
| 644 | { |
Dimitrie O. Paun | 475cdcb | 2004-02-26 05:30:54 +0000 | [diff] [blame] | 645 | FIXME("(%p)\n", hDesk); |
Sergey Turchanov | 2f5a152 | 1999-04-10 16:48:46 +0000 | [diff] [blame] | 646 | return TRUE; |
| 647 | } |
| 648 | |
Marcus Meissner | 9cfe2d5 | 1998-11-01 14:02:57 +0000 | [diff] [blame] | 649 | /*********************************************************************** |
Patrik Stridvall | 2ece70e | 2000-12-22 01:38:01 +0000 | [diff] [blame] | 650 | * SetWindowStationUser (USER32.@) |
Marcus Meissner | 9cfe2d5 | 1998-11-01 14:02:57 +0000 | [diff] [blame] | 651 | */ |
Marcus Meissner | 8143acc | 1998-10-31 12:19:56 +0000 | [diff] [blame] | 652 | DWORD WINAPI SetWindowStationUser(DWORD x1,DWORD x2) { |
Dimitrie O. Paun | 475cdcb | 2004-02-26 05:30:54 +0000 | [diff] [blame] | 653 | FIXME("(0x%08lx,0x%08lx),stub!\n",x1,x2); |
Marcus Meissner | 8143acc | 1998-10-31 12:19:56 +0000 | [diff] [blame] | 654 | return 1; |
| 655 | } |
Marcus Meissner | 9cfe2d5 | 1998-11-01 14:02:57 +0000 | [diff] [blame] | 656 | |
| 657 | /*********************************************************************** |
Patrik Stridvall | 2ece70e | 2000-12-22 01:38:01 +0000 | [diff] [blame] | 658 | * SetLogonNotifyWindow (USER32.@) |
Marcus Meissner | 9cfe2d5 | 1998-11-01 14:02:57 +0000 | [diff] [blame] | 659 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 660 | DWORD WINAPI SetLogonNotifyWindow(HWINSTA hwinsta,HWND hwnd) { |
Dimitrie O. Paun | 475cdcb | 2004-02-26 05:30:54 +0000 | [diff] [blame] | 661 | FIXME("(%p,%p),stub!\n",hwinsta,hwnd); |
Marcus Meissner | 9cfe2d5 | 1998-11-01 14:02:57 +0000 | [diff] [blame] | 662 | return 1; |
| 663 | } |
| 664 | |
| 665 | /*********************************************************************** |
Patrik Stridvall | 2ece70e | 2000-12-22 01:38:01 +0000 | [diff] [blame] | 666 | * LoadLocalFonts (USER32.@) |
Marcus Meissner | 9cfe2d5 | 1998-11-01 14:02:57 +0000 | [diff] [blame] | 667 | */ |
| 668 | VOID WINAPI LoadLocalFonts(VOID) { |
| 669 | /* are loaded. */ |
| 670 | return; |
| 671 | } |
Juergen Schmied | 8090784 | 1998-11-24 20:26:02 +0000 | [diff] [blame] | 672 | /*********************************************************************** |
Patrik Stridvall | 2ece70e | 2000-12-22 01:38:01 +0000 | [diff] [blame] | 673 | * GetUserObjectInformationA (USER32.@) |
Juergen Schmied | 8090784 | 1998-11-24 20:26:02 +0000 | [diff] [blame] | 674 | */ |
Patrik Stridvall | 8276f69 | 1999-09-23 11:48:02 +0000 | [diff] [blame] | 675 | BOOL WINAPI GetUserObjectInformationA( HANDLE hObj, INT nIndex, LPVOID pvInfo, DWORD nLength, LPDWORD lpnLen ) |
Dimitrie O. Paun | 475cdcb | 2004-02-26 05:30:54 +0000 | [diff] [blame] | 676 | { FIXME("(%p %i %p %ld %p),stub!\n", hObj, nIndex, pvInfo, nLength, lpnLen ); |
Juergen Schmied | 8090784 | 1998-11-24 20:26:02 +0000 | [diff] [blame] | 677 | return TRUE; |
| 678 | } |
| 679 | /*********************************************************************** |
Patrik Stridvall | 2ece70e | 2000-12-22 01:38:01 +0000 | [diff] [blame] | 680 | * GetUserObjectInformationW (USER32.@) |
Juergen Schmied | 8090784 | 1998-11-24 20:26:02 +0000 | [diff] [blame] | 681 | */ |
Patrik Stridvall | 8276f69 | 1999-09-23 11:48:02 +0000 | [diff] [blame] | 682 | BOOL WINAPI GetUserObjectInformationW( HANDLE hObj, INT nIndex, LPVOID pvInfo, DWORD nLength, LPDWORD lpnLen ) |
Dimitrie O. Paun | 475cdcb | 2004-02-26 05:30:54 +0000 | [diff] [blame] | 683 | { FIXME("(%p %i %p %ld %p),stub!\n", hObj, nIndex, pvInfo, nLength, lpnLen ); |
Juergen Schmied | 8090784 | 1998-11-24 20:26:02 +0000 | [diff] [blame] | 684 | return TRUE; |
| 685 | } |
Juergen Schmied | 535f32f | 1999-01-31 09:20:36 +0000 | [diff] [blame] | 686 | /*********************************************************************** |
Patrik Stridvall | 2ece70e | 2000-12-22 01:38:01 +0000 | [diff] [blame] | 687 | * GetUserObjectSecurity (USER32.@) |
Juergen Schmied | 535f32f | 1999-01-31 09:20:36 +0000 | [diff] [blame] | 688 | */ |
Francois Gouget | 326e2ba | 2000-06-18 17:26:44 +0000 | [diff] [blame] | 689 | BOOL WINAPI GetUserObjectSecurity(HANDLE hObj, PSECURITY_INFORMATION pSIRequested, |
Juergen Schmied | 535f32f | 1999-01-31 09:20:36 +0000 | [diff] [blame] | 690 | PSECURITY_DESCRIPTOR pSID, DWORD nLength, LPDWORD lpnLengthNeeded) |
Dimitrie O. Paun | 475cdcb | 2004-02-26 05:30:54 +0000 | [diff] [blame] | 691 | { FIXME("(%p %p %p len=%ld %p),stub!\n", hObj, pSIRequested, pSID, nLength, lpnLengthNeeded); |
Juergen Schmied | 535f32f | 1999-01-31 09:20:36 +0000 | [diff] [blame] | 692 | return TRUE; |
| 693 | } |
Lionel Ulmer | 5f5b576 | 1999-03-28 13:42:12 +0000 | [diff] [blame] | 694 | |
| 695 | /*********************************************************************** |
Patrik Stridvall | 2ece70e | 2000-12-22 01:38:01 +0000 | [diff] [blame] | 696 | * SetSystemCursor (USER32.@) |
Lionel Ulmer | 5f5b576 | 1999-03-28 13:42:12 +0000 | [diff] [blame] | 697 | */ |
| 698 | BOOL WINAPI SetSystemCursor(HCURSOR hcur, DWORD id) |
Dimitrie O. Paun | 475cdcb | 2004-02-26 05:30:54 +0000 | [diff] [blame] | 699 | { FIXME("(%p,%08lx),stub!\n", hcur, id); |
Lionel Ulmer | 5f5b576 | 1999-03-28 13:42:12 +0000 | [diff] [blame] | 700 | return TRUE; |
| 701 | } |
Bertho Stultiens | af50474 | 1999-04-11 12:04:33 +0000 | [diff] [blame] | 702 | |
| 703 | /*********************************************************************** |
Patrik Stridvall | 2ece70e | 2000-12-22 01:38:01 +0000 | [diff] [blame] | 704 | * RegisterSystemThread (USER32.@) |
Bertho Stultiens | af50474 | 1999-04-11 12:04:33 +0000 | [diff] [blame] | 705 | */ |
Marcus Meissner | f203ab6 | 1999-04-15 15:12:40 +0000 | [diff] [blame] | 706 | void WINAPI RegisterSystemThread(DWORD flags, DWORD reserved) |
Bertho Stultiens | af50474 | 1999-04-11 12:04:33 +0000 | [diff] [blame] | 707 | { |
Dimitrie O. Paun | 475cdcb | 2004-02-26 05:30:54 +0000 | [diff] [blame] | 708 | FIXME("(%08lx, %08lx)\n", flags, reserved); |
Bertho Stultiens | af50474 | 1999-04-11 12:04:33 +0000 | [diff] [blame] | 709 | } |
Marcus Meissner | 521c0e4 | 2000-07-10 10:58:16 +0000 | [diff] [blame] | 710 | |
| 711 | /*********************************************************************** |
Patrik Stridvall | 2ece70e | 2000-12-22 01:38:01 +0000 | [diff] [blame] | 712 | * RegisterDeviceNotificationA (USER32.@) |
Robert Shearman | e2b1222 | 2004-03-05 20:44:15 +0000 | [diff] [blame] | 713 | * |
| 714 | * See RegisterDeviceNotificationW. |
Marcus Meissner | 521c0e4 | 2000-07-10 10:58:16 +0000 | [diff] [blame] | 715 | */ |
Dimitrie O. Paun | 475cdcb | 2004-02-26 05:30:54 +0000 | [diff] [blame] | 716 | HDEVNOTIFY WINAPI RegisterDeviceNotificationA(HANDLE hnd, LPVOID notifyfilter, DWORD flags) |
| 717 | { |
| 718 | FIXME("(hwnd=%p, filter=%p,flags=0x%08lx), STUB!\n", hnd,notifyfilter,flags ); |
Alexandre Julliard | aff7dda | 2002-11-22 21:22:14 +0000 | [diff] [blame] | 719 | return 0; |
Marcus Meissner | 521c0e4 | 2000-07-10 10:58:16 +0000 | [diff] [blame] | 720 | } |
Robert Shearman | e2b1222 | 2004-03-05 20:44:15 +0000 | [diff] [blame] | 721 | |
| 722 | /*********************************************************************** |
| 723 | * RegisterDeviceNotificationW (USER32.@) |
| 724 | * |
| 725 | * Registers a window with the system so that it will receive |
| 726 | * notifications about a device. |
| 727 | * |
| 728 | * PARAMS |
| 729 | * hRecepient [I] Window or service status handle that |
| 730 | * will receive notifications. |
| 731 | * pNotificationFilter [I] DEV_BROADCAST_HDR followed by some |
| 732 | * type-specific data. |
| 733 | * dwFlags [I] See notes |
| 734 | * |
| 735 | * RETURNS |
| 736 | * |
| 737 | * A handle to the device notification. |
| 738 | * |
| 739 | * NOTES |
| 740 | * |
| 741 | * The dwFlags parameter can be one of two values: |
| 742 | *| DEVICE_NOTIFY_WINDOW_HANDLE - hRecepient is a window handle |
| 743 | *| DEVICE_NOTIFY_SERVICE_HANDLE - hRecepient is a service status handle |
| 744 | */ |
| 745 | HDEVNOTIFY WINAPI RegisterDeviceNotificationW(HANDLE hRecepient, LPVOID pNotificationFilter, DWORD dwFlags) |
| 746 | { |
| 747 | FIXME("(hwnd=%p, filter=%p,flags=0x%08lx), STUB!\n", hRecepient,pNotificationFilter,dwFlags ); |
| 748 | return 0; |
| 749 | } |