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