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