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