Use _WINNT_ as exclusion define for source compatibility.
[wine/hacks.git] / windows / user.c
blob612ef1e427cb22634ebb8fd80337f7d2c7d8e986
1 /*
2 * Misc. USER functions
4 * Copyright 1993 Robert J. Amstadt
5 * 1996 Alex Korobka
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.
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.
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
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 "tlhelp32.h"
34 #include "user.h"
35 #include "win.h"
36 #include "controls.h"
37 #include "cursoricon.h"
38 #include "message.h"
39 #include "local.h"
40 #include "wine/debug.h"
42 WINE_DEFAULT_DEBUG_CHANNEL(user);
44 static SYSLEVEL USER_SysLevel;
45 static CRITICAL_SECTION_DEBUG critsect_debug =
47 0, 0, &USER_SysLevel.crst,
48 { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList },
49 0, 0, { 0, (DWORD)(__FILE__ ": USER_SysLevel") }
51 static SYSLEVEL USER_SysLevel = { { &critsect_debug, -1, 0, 0, 0, 0 }, 2 };
53 /* USER signal proc flags and codes */
54 /* See UserSignalProc for comments */
55 #define USIG_FLAGS_WIN32 0x0001
56 #define USIG_FLAGS_GUI 0x0002
57 #define USIG_FLAGS_FEEDBACK 0x0004
58 #define USIG_FLAGS_FAULT 0x0008
60 #define USIG_DLL_UNLOAD_WIN16 0x0001
61 #define USIG_DLL_UNLOAD_WIN32 0x0002
62 #define USIG_FAULT_DIALOG_PUSH 0x0003
63 #define USIG_FAULT_DIALOG_POP 0x0004
64 #define USIG_DLL_UNLOAD_ORPHANS 0x0005
65 #define USIG_THREAD_INIT 0x0010
66 #define USIG_THREAD_EXIT 0x0020
67 #define USIG_PROCESS_CREATE 0x0100
68 #define USIG_PROCESS_INIT 0x0200
69 #define USIG_PROCESS_EXIT 0x0300
70 #define USIG_PROCESS_DESTROY 0x0400
71 #define USIG_PROCESS_RUNNING 0x0500
72 #define USIG_PROCESS_LOADED 0x0600
75 /***********************************************************************
76 * GetFreeSystemResources (USER.284)
78 WORD WINAPI GetFreeSystemResources16( WORD resType )
80 HINSTANCE16 gdi_inst;
81 WORD gdi_heap;
82 int userPercent, gdiPercent;
84 if ((gdi_inst = LoadLibrary16( "GDI" )) < 32) return 0;
85 gdi_heap = gdi_inst | 7;
87 switch(resType)
89 case GFSR_USERRESOURCES:
90 userPercent = (int)LOCAL_CountFree( USER_HeapSel ) * 100 /
91 LOCAL_HeapSize( USER_HeapSel );
92 gdiPercent = 100;
93 break;
95 case GFSR_GDIRESOURCES:
96 gdiPercent = (int)LOCAL_CountFree( gdi_inst ) * 100 /
97 LOCAL_HeapSize( gdi_inst );
98 userPercent = 100;
99 break;
101 case GFSR_SYSTEMRESOURCES:
102 userPercent = (int)LOCAL_CountFree( USER_HeapSel ) * 100 /
103 LOCAL_HeapSize( USER_HeapSel );
104 gdiPercent = (int)LOCAL_CountFree( gdi_inst ) * 100 /
105 LOCAL_HeapSize( gdi_inst );
106 break;
108 default:
109 userPercent = gdiPercent = 0;
110 break;
112 FreeLibrary16( gdi_inst );
113 TRACE("<- userPercent %d, gdiPercent %d\n", userPercent, gdiPercent);
114 return (WORD)min( userPercent, gdiPercent );
118 /**********************************************************************
119 * InitApp (USER.5)
121 INT16 WINAPI InitApp16( HINSTANCE16 hInstance )
123 /* Create task message queue */
124 if ( !InitThreadInput16( 0, 0 ) ) return 0;
126 return 1;
130 /***********************************************************************
131 * USER_Lock
133 void USER_Lock(void)
135 _EnterSysLevel( &USER_SysLevel );
139 /***********************************************************************
140 * USER_Unlock
142 void USER_Unlock(void)
144 _LeaveSysLevel( &USER_SysLevel );
148 /***********************************************************************
149 * USER_CheckNotLock
151 * Make sure that we don't hold the user lock.
153 void USER_CheckNotLock(void)
155 _CheckNotSysLevel( &USER_SysLevel );
159 /***********************************************************************
160 * WIN_SuspendWndsLock
162 * Suspend the lock on WND structures.
163 * Returns the number of locks suspended
164 * FIXME: should be removed
166 int WIN_SuspendWndsLock( void )
168 int isuspendedLocks = _ConfirmSysLevel( &USER_SysLevel );
169 int count = isuspendedLocks;
171 while ( count-- > 0 )
172 _LeaveSysLevel( &USER_SysLevel );
174 return isuspendedLocks;
177 /***********************************************************************
178 * WIN_RestoreWndsLock
180 * Restore the suspended locks on WND structures
181 * FIXME: should be removed
183 void WIN_RestoreWndsLock( int ipreviousLocks )
185 while ( ipreviousLocks-- > 0 )
186 _EnterSysLevel( &USER_SysLevel );
189 /***********************************************************************
190 * FinalUserInit (USER.400)
192 void WINAPI FinalUserInit16( void )
194 /* FIXME: Should chain to FinalGdiInit now. */
197 /***********************************************************************
198 * SignalProc32 (USER.391)
199 * UserSignalProc (USER32.@)
201 * The exact meaning of the USER signals is undocumented, but this
202 * should cover the basic idea:
204 * USIG_DLL_UNLOAD_WIN16
205 * This is sent when a 16-bit module is unloaded.
207 * USIG_DLL_UNLOAD_WIN32
208 * This is sent when a 32-bit module is unloaded.
210 * USIG_DLL_UNLOAD_ORPHANS
211 * This is sent after the last Win3.1 module is unloaded,
212 * to allow removal of orphaned menus.
214 * USIG_FAULT_DIALOG_PUSH
215 * USIG_FAULT_DIALOG_POP
216 * These are called to allow USER to prepare for displaying a
217 * fault dialog, even though the fault might have happened while
218 * inside a USER critical section.
220 * USIG_THREAD_INIT
221 * This is called from the context of a new thread, as soon as it
222 * has started to run.
224 * USIG_THREAD_EXIT
225 * This is called, still in its context, just before a thread is
226 * about to terminate.
228 * USIG_PROCESS_CREATE
229 * This is called, in the parent process context, after a new process
230 * has been created.
232 * USIG_PROCESS_INIT
233 * This is called in the new process context, just after the main thread
234 * has started execution (after the main thread's USIG_THREAD_INIT has
235 * been sent).
237 * USIG_PROCESS_LOADED
238 * This is called after the executable file has been loaded into the
239 * new process context.
241 * USIG_PROCESS_RUNNING
242 * This is called immediately before the main entry point is called.
244 * USIG_PROCESS_EXIT
245 * This is called in the context of a process that is about to
246 * terminate (but before the last thread's USIG_THREAD_EXIT has
247 * been sent).
249 * USIG_PROCESS_DESTROY
250 * This is called after a process has terminated.
253 * The meaning of the dwFlags bits is as follows:
255 * USIG_FLAGS_WIN32
256 * Current process is 32-bit.
258 * USIG_FLAGS_GUI
259 * Current process is a (Win32) GUI process.
261 * USIG_FLAGS_FEEDBACK
262 * Current process needs 'feedback' (determined from the STARTUPINFO
263 * flags STARTF_FORCEONFEEDBACK / STARTF_FORCEOFFFEEDBACK).
265 * USIG_FLAGS_FAULT
266 * The signal is being sent due to a fault.
268 WORD WINAPI UserSignalProc( UINT uCode, DWORD dwThreadOrProcessID,
269 DWORD dwFlags, HMODULE16 hModule )
271 FIXME("(%04x, %08lx, %04lx, %04x)\n",
272 uCode, dwThreadOrProcessID, dwFlags, hModule );
273 /* FIXME: Should chain to GdiSignalProc now. */
274 return 0;
277 /***********************************************************************
278 * ExitWindows (USER.7)
280 BOOL16 WINAPI ExitWindows16( DWORD dwReturnCode, UINT16 wReserved )
282 return ExitWindowsEx( EWX_LOGOFF, 0xffffffff );
286 /***********************************************************************
287 * ExitWindowsExec (USER.246)
289 BOOL16 WINAPI ExitWindowsExec16( LPCSTR lpszExe, LPCSTR lpszParams )
291 TRACE("Should run the following in DOS-mode: \"%s %s\"\n",
292 lpszExe, lpszParams);
293 return ExitWindowsEx( EWX_LOGOFF, 0xffffffff );
297 /***********************************************************************
298 * USER_GetProcessHandleList(Internal)
300 static HANDLE *USER_GetProcessHandleList(void)
302 DWORD count, i, n;
303 HANDLE *list;
304 PROCESSENTRY32 pe;
305 HANDLE hSnapshot;
306 BOOL r;
308 hSnapshot = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );
309 if (!hSnapshot)
311 ERR("cannot create snapshot\n");
312 return FALSE;
315 /* count the number of processes plus one */
316 for (count=0; ;count++)
318 pe.dwSize = sizeof pe;
319 if (count)
320 r = Process32Next( hSnapshot, &pe );
321 else
322 r = Process32First( hSnapshot, &pe );
323 if (!r)
324 break;
327 /* allocate memory make a list of the process handles */
328 list = HeapAlloc( GetProcessHeap(), 0, (count+1)*sizeof(HANDLE) );
329 n=0;
330 for (i=0; i<count; i++)
332 pe.dwSize = sizeof pe;
333 if (i)
334 r = Process32Next( hSnapshot, &pe );
335 else
336 r = Process32First( hSnapshot, &pe );
337 if (!r)
338 break;
340 /* don't kill outselves */
341 if (GetCurrentProcessId() == pe.th32ProcessID )
342 continue;
344 /* open the process so we don't can track it */
345 list[n] = OpenProcess( PROCESS_QUERY_INFORMATION|
346 PROCESS_TERMINATE,
347 FALSE, pe.th32ProcessID );
349 /* check it didn't terminate already */
350 if( list[n] )
351 n++;
353 list[n]=0;
354 CloseHandle( hSnapshot );
356 if (!r)
357 ERR("Error enumerating processes\n");
359 TRACE("return %lu processes\n", n);
361 return list;
364 /***********************************************************************
365 * USER_KillProcesses (Internal)
367 static DWORD USER_KillProcesses(void)
369 DWORD n, r, i;
370 HANDLE *handles;
371 const DWORD dwShutdownTimeout = 10000;
373 TRACE("terminating other processes\n");
375 /* kill it and add it to our list of object to wait on */
376 handles = USER_GetProcessHandleList();
377 for (n=0; handles && handles[n]; n++)
378 TerminateProcess( handles[n], 0 );
380 /* wait for processes to exit */
381 for (i=0; i<n; i+=MAXIMUM_WAIT_OBJECTS)
383 int n_objs = ((n-i)>MAXIMUM_WAIT_OBJECTS) ? MAXIMUM_WAIT_OBJECTS : (n-i);
384 r = WaitForMultipleObjects( n_objs, &handles[i], TRUE, dwShutdownTimeout );
385 if (r==WAIT_TIMEOUT)
386 ERR("wait failed!\n");
389 /* close the handles */
390 for (i=0; i<n; i++)
391 CloseHandle( handles[i] );
393 HeapFree( GetProcessHeap(), 0, handles );
395 return n;
398 /***********************************************************************
399 * USER_DoShutdown (Internal)
401 static void USER_DoShutdown(void)
403 DWORD i, n;
404 const DWORD nRetries = 10;
406 for (i=0; i<nRetries; i++)
408 n = USER_KillProcesses();
409 TRACE("Killed %ld processes, attempt %ld\n", n, i);
410 if(!n)
411 break;
415 /***********************************************************************
416 * USER_StartRebootProcess (Internal)
418 static BOOL USER_StartRebootProcess(void)
420 WCHAR winebootW[] = { 'w','i','n','e','b','o','o','t',0 };
421 PROCESS_INFORMATION pi;
422 STARTUPINFOW si;
423 BOOL r;
425 memset( &si, 0, sizeof si );
426 si.cb = sizeof si;
428 r = CreateProcessW( NULL, winebootW, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi );
429 if (r)
431 CloseHandle( pi.hProcess );
432 CloseHandle( pi.hThread );
434 else
435 MESSAGE("wine: Failed to start wineboot\n");
437 return r;
440 /***********************************************************************
441 * ExitWindowsEx (USER32.@)
443 BOOL WINAPI ExitWindowsEx( UINT flags, DWORD reserved )
445 int i;
446 BOOL result;
447 HWND *list, *phwnd;
449 /* We have to build a list of all windows first, as in EnumWindows */
451 if (!(list = WIN_ListChildren( GetDesktopWindow() ))) return FALSE;
453 /* Send a WM_QUERYENDSESSION message to every window */
455 for (i = 0; list[i]; i++)
457 /* Make sure that the window still exists */
458 if (!IsWindow( list[i] )) continue;
459 if (!SendMessageW( list[i], WM_QUERYENDSESSION, 0, 0 )) break;
461 result = !list[i];
463 /* Now notify all windows that got a WM_QUERYENDSESSION of the result */
465 for (phwnd = list; i > 0; i--, phwnd++)
467 if (!IsWindow( *phwnd )) continue;
468 SendMessageW( *phwnd, WM_ENDSESSION, result, 0 );
470 HeapFree( GetProcessHeap(), 0, list );
472 /* USER_DoShutdown will kill all processes except the current process */
473 USER_DoShutdown();
475 if (flags & EWX_REBOOT)
476 USER_StartRebootProcess();
478 if (result) ExitKernel16();
479 return TRUE;
482 /***********************************************************************
483 * ChangeDisplaySettingsA (USER32.@)
485 LONG WINAPI ChangeDisplaySettingsA( LPDEVMODEA devmode, DWORD flags )
487 return ChangeDisplaySettingsExA(NULL,devmode,NULL,flags,NULL);
490 /***********************************************************************
491 * ChangeDisplaySettingsW (USER32.@)
493 LONG WINAPI ChangeDisplaySettingsW( LPDEVMODEW devmode, DWORD flags )
495 return ChangeDisplaySettingsExW(NULL,devmode,NULL,flags,NULL);
498 /***********************************************************************
499 * ChangeDisplaySettings (USER.620)
501 LONG WINAPI ChangeDisplaySettings16( LPDEVMODEA devmode, DWORD flags )
503 return ChangeDisplaySettingsA(devmode, flags);
506 /***********************************************************************
507 * ChangeDisplaySettingsExA (USER32.@)
509 LONG WINAPI ChangeDisplaySettingsExA(
510 LPCSTR devname, LPDEVMODEA devmode, HWND hwnd, DWORD flags,
511 LPVOID lparam
513 DEVMODEW devmodeW;
514 LONG ret;
515 UNICODE_STRING nameW;
517 if (devname) RtlCreateUnicodeStringFromAsciiz(&nameW, devname);
518 else nameW.Buffer = NULL;
520 if (devmode)
522 devmodeW.dmBitsPerPel = devmode->dmBitsPerPel;
523 devmodeW.dmPelsHeight = devmode->dmPelsHeight;
524 devmodeW.dmPelsWidth = devmode->dmPelsWidth;
525 devmodeW.dmDisplayFlags = devmode->dmDisplayFlags;
526 devmodeW.dmDisplayFrequency = devmode->dmDisplayFrequency;
527 devmodeW.dmFields = devmode->dmFields;
528 ret = ChangeDisplaySettingsExW(nameW.Buffer, &devmodeW, hwnd, flags, lparam);
530 else
532 ret = ChangeDisplaySettingsExW(nameW.Buffer, NULL, hwnd, flags, lparam);
535 if (devname) RtlFreeUnicodeString(&nameW);
536 return ret;
539 /***********************************************************************
540 * ChangeDisplaySettingsExW (USER32.@)
542 LONG WINAPI ChangeDisplaySettingsExW( LPCWSTR devname, LPDEVMODEW devmode, HWND hwnd,
543 DWORD flags, LPVOID lparam )
545 /* Pass the request on to the driver */
546 if (!USER_Driver.pChangeDisplaySettingsExW) return DISP_CHANGE_FAILED;
547 return USER_Driver.pChangeDisplaySettingsExW( devname, devmode, hwnd, flags, lparam );
550 /***********************************************************************
551 * EnumDisplaySettingsW (USER32.@)
553 * RETURNS
554 * TRUE if nth setting exists found (described in the LPDEVMODEW struct)
555 * FALSE if we do not have the nth setting
557 BOOL WINAPI EnumDisplaySettingsW(
558 LPCWSTR name, /* [in] huh? */
559 DWORD n, /* [in] nth entry in display settings list*/
560 LPDEVMODEW devmode /* [out] devmode for that setting */
562 return EnumDisplaySettingsExW(name, n, devmode, 0);
565 /***********************************************************************
566 * EnumDisplaySettingsA (USER32.@)
568 BOOL WINAPI EnumDisplaySettingsA(LPCSTR name,DWORD n,LPDEVMODEA devmode)
570 return EnumDisplaySettingsExA(name, n, devmode, 0);
573 /***********************************************************************
574 * EnumDisplaySettings (USER.621)
576 BOOL16 WINAPI EnumDisplaySettings16(
577 LPCSTR name, /* [in] huh? */
578 DWORD n, /* [in] nth entry in display settings list*/
579 LPDEVMODEA devmode /* [out] devmode for that setting */
581 return (BOOL16)EnumDisplaySettingsA(name, n, devmode);
584 /***********************************************************************
585 * EnumDisplaySettingsExA (USER32.@)
587 BOOL WINAPI EnumDisplaySettingsExA(LPCSTR lpszDeviceName, DWORD iModeNum,
588 LPDEVMODEA lpDevMode, DWORD dwFlags)
590 DEVMODEW devmodeW;
591 BOOL ret;
592 UNICODE_STRING nameW;
594 if (lpszDeviceName) RtlCreateUnicodeStringFromAsciiz(&nameW, lpszDeviceName);
595 else nameW.Buffer = NULL;
597 ret = EnumDisplaySettingsExW(nameW.Buffer,iModeNum,&devmodeW,dwFlags);
598 if (ret)
600 lpDevMode->dmBitsPerPel = devmodeW.dmBitsPerPel;
601 lpDevMode->dmPelsHeight = devmodeW.dmPelsHeight;
602 lpDevMode->dmPelsWidth = devmodeW.dmPelsWidth;
603 lpDevMode->dmDisplayFlags = devmodeW.dmDisplayFlags;
604 lpDevMode->dmDisplayFrequency = devmodeW.dmDisplayFrequency;
605 lpDevMode->dmFields = devmodeW.dmFields;
607 if (lpszDeviceName) RtlFreeUnicodeString(&nameW);
608 return ret;
611 /***********************************************************************
612 * EnumDisplaySettingsExW (USER32.@)
614 BOOL WINAPI EnumDisplaySettingsExW(LPCWSTR lpszDeviceName, DWORD iModeNum,
615 LPDEVMODEW lpDevMode, DWORD dwFlags)
617 /* Pass the request on to the driver */
618 if (!USER_Driver.pEnumDisplaySettingsExW) return FALSE;
619 return USER_Driver.pEnumDisplaySettingsExW(lpszDeviceName, iModeNum, lpDevMode, dwFlags);
622 /***********************************************************************
623 * EnumDisplayDevicesA (USER32.@)
625 BOOL WINAPI EnumDisplayDevicesA(
626 LPVOID unused,DWORD i,LPDISPLAY_DEVICEA lpDisplayDevice,DWORD dwFlags
628 if (i)
629 return FALSE;
630 FIXME("(%p,%ld,%p,0x%08lx), stub!\n",unused,i,lpDisplayDevice,dwFlags);
631 strcpy(lpDisplayDevice->DeviceName,"X11");
632 strcpy(lpDisplayDevice->DeviceString,"X 11 Windowing System");
633 lpDisplayDevice->StateFlags =
634 DISPLAY_DEVICE_ATTACHED_TO_DESKTOP |
635 DISPLAY_DEVICE_PRIMARY_DEVICE |
636 DISPLAY_DEVICE_VGA_COMPATIBLE;
637 return TRUE;
640 /***********************************************************************
641 * EnumDisplayDevicesW (USER32.@)
643 BOOL WINAPI EnumDisplayDevicesW(
644 LPVOID unused,DWORD i,LPDISPLAY_DEVICEW lpDisplayDevice,DWORD dwFlags
646 if (i)
647 return FALSE;
648 FIXME("(%p,%ld,%p,0x%08lx), stub!\n",unused,i,lpDisplayDevice,dwFlags);
649 MultiByteToWideChar( CP_ACP, 0, "X11", -1, lpDisplayDevice->DeviceName,
650 sizeof(lpDisplayDevice->DeviceName)/sizeof(WCHAR) );
651 MultiByteToWideChar( CP_ACP, 0, "X11 Windowing System", -1, lpDisplayDevice->DeviceString,
652 sizeof(lpDisplayDevice->DeviceString)/sizeof(WCHAR) );
653 lpDisplayDevice->StateFlags =
654 DISPLAY_DEVICE_ATTACHED_TO_DESKTOP |
655 DISPLAY_DEVICE_PRIMARY_DEVICE |
656 DISPLAY_DEVICE_VGA_COMPATIBLE;
657 return TRUE;
660 /***********************************************************************
661 * SetEventHook (USER.321)
663 * Used by Turbo Debugger for Windows
665 FARPROC16 WINAPI SetEventHook16(FARPROC16 lpfnEventHook)
667 FIXME("(lpfnEventHook=%08x): stub\n", (UINT)lpfnEventHook);
668 return NULL;
671 /***********************************************************************
672 * UserSeeUserDo (USER.216)
674 DWORD WINAPI UserSeeUserDo16(WORD wReqType, WORD wParam1, WORD wParam2, WORD wParam3)
676 switch (wReqType)
678 case USUD_LOCALALLOC:
679 return LOCAL_Alloc(USER_HeapSel, wParam1, wParam3);
680 case USUD_LOCALFREE:
681 return LOCAL_Free(USER_HeapSel, wParam1);
682 case USUD_LOCALCOMPACT:
683 return LOCAL_Compact(USER_HeapSel, wParam3, 0);
684 case USUD_LOCALHEAP:
685 return USER_HeapSel;
686 case USUD_FIRSTCLASS:
687 FIXME("return a pointer to the first window class.\n");
688 return (DWORD)-1;
689 default:
690 WARN("wReqType %04x (unknown)\n", wReqType);
691 return (DWORD)-1;
695 /***********************************************************************
696 * GetSystemDebugState (USER.231)
698 WORD WINAPI GetSystemDebugState16(void)
700 return 0; /* FIXME */
703 /***********************************************************************
704 * RegisterLogonProcess (USER32.@)
706 DWORD WINAPI RegisterLogonProcess(HANDLE hprocess,BOOL x) {
707 FIXME("(%p,%d),stub!\n",hprocess,x);
708 return 1;
711 /***********************************************************************
712 * CreateWindowStationW (USER32.@)
714 HWINSTA WINAPI CreateWindowStationW(
715 LPWSTR winstation,DWORD res1,DWORD desiredaccess,
716 LPSECURITY_ATTRIBUTES lpsa
718 FIXME("(%s,0x%08lx,0x%08lx,%p),stub!\n",debugstr_w(winstation),
719 res1,desiredaccess,lpsa
721 return (HWINSTA)0xdeadcafe;
724 /***********************************************************************
725 * SetProcessWindowStation (USER32.@)
727 BOOL WINAPI SetProcessWindowStation(HWINSTA hWinSta) {
728 FIXME("(%p),stub!\n",hWinSta);
729 return TRUE;
732 /***********************************************************************
733 * SetUserObjectSecurity (USER32.@)
735 BOOL WINAPI SetUserObjectSecurity(
736 HANDLE hObj,
737 PSECURITY_INFORMATION pSIRequested,
738 PSECURITY_DESCRIPTOR pSID
740 FIXME("(%p,%p,%p),stub!\n",hObj,pSIRequested,pSID);
741 return TRUE;
744 /***********************************************************************
745 * CreateDesktopA (USER32.@)
747 HDESK WINAPI CreateDesktopA(
748 LPSTR lpszDesktop,LPSTR lpszDevice,LPDEVMODEA pDevmode,
749 DWORD dwFlags,DWORD dwDesiredAccess,LPSECURITY_ATTRIBUTES lpsa
751 FIXME("(%s,%s,%p,0x%08lx,0x%08lx,%p),stub!\n",
752 lpszDesktop,lpszDevice,pDevmode,
753 dwFlags,dwDesiredAccess,lpsa
755 return (HDESK)0xcafedead;
758 /***********************************************************************
759 * CreateDesktopW (USER32.@)
761 HDESK WINAPI CreateDesktopW(
762 LPWSTR lpszDesktop,LPWSTR lpszDevice,LPDEVMODEW pDevmode,
763 DWORD dwFlags,DWORD dwDesiredAccess,LPSECURITY_ATTRIBUTES lpsa
765 FIXME("(%s,%s,%p,0x%08lx,0x%08lx,%p),stub!\n",
766 debugstr_w(lpszDesktop),debugstr_w(lpszDevice),pDevmode,
767 dwFlags,dwDesiredAccess,lpsa
769 return (HDESK)0xcafedead;
772 /***********************************************************************
773 * EnumDesktopWindows (USER32.@)
775 BOOL WINAPI EnumDesktopWindows( HDESK hDesktop, WNDENUMPROC lpfn, LPARAM lParam ) {
776 FIXME("(%p, %p, 0x%08lx), stub!\n", hDesktop, lpfn, lParam );
777 return TRUE;
781 /***********************************************************************
782 * CloseWindowStation (USER32.@)
784 BOOL WINAPI CloseWindowStation(HWINSTA hWinSta)
786 FIXME("(%p)\n", hWinSta);
787 return TRUE;
790 /***********************************************************************
791 * CloseDesktop (USER32.@)
793 BOOL WINAPI CloseDesktop(HDESK hDesk)
795 FIXME("(%p)\n", hDesk);
796 return TRUE;
799 /***********************************************************************
800 * SetWindowStationUser (USER32.@)
802 DWORD WINAPI SetWindowStationUser(DWORD x1,DWORD x2) {
803 FIXME("(0x%08lx,0x%08lx),stub!\n",x1,x2);
804 return 1;
807 /***********************************************************************
808 * SetLogonNotifyWindow (USER32.@)
810 DWORD WINAPI SetLogonNotifyWindow(HWINSTA hwinsta,HWND hwnd) {
811 FIXME("(%p,%p),stub!\n",hwinsta,hwnd);
812 return 1;
815 /***********************************************************************
816 * LoadLocalFonts (USER32.@)
818 VOID WINAPI LoadLocalFonts(VOID) {
819 /* are loaded. */
820 return;
822 /***********************************************************************
823 * GetUserObjectInformationA (USER32.@)
825 BOOL WINAPI GetUserObjectInformationA( HANDLE hObj, INT nIndex, LPVOID pvInfo, DWORD nLength, LPDWORD lpnLen )
826 { FIXME("(%p %i %p %ld %p),stub!\n", hObj, nIndex, pvInfo, nLength, lpnLen );
827 return TRUE;
829 /***********************************************************************
830 * GetUserObjectInformationW (USER32.@)
832 BOOL WINAPI GetUserObjectInformationW( HANDLE hObj, INT nIndex, LPVOID pvInfo, DWORD nLength, LPDWORD lpnLen )
833 { FIXME("(%p %i %p %ld %p),stub!\n", hObj, nIndex, pvInfo, nLength, lpnLen );
834 return TRUE;
836 /***********************************************************************
837 * GetUserObjectSecurity (USER32.@)
839 BOOL WINAPI GetUserObjectSecurity(HANDLE hObj, PSECURITY_INFORMATION pSIRequested,
840 PSECURITY_DESCRIPTOR pSID, DWORD nLength, LPDWORD lpnLengthNeeded)
841 { FIXME("(%p %p %p len=%ld %p),stub!\n", hObj, pSIRequested, pSID, nLength, lpnLengthNeeded);
842 return TRUE;
845 /***********************************************************************
846 * SetSystemCursor (USER32.@)
848 BOOL WINAPI SetSystemCursor(HCURSOR hcur, DWORD id)
849 { FIXME("(%p,%08lx),stub!\n", hcur, id);
850 return TRUE;
853 /***********************************************************************
854 * RegisterSystemThread (USER32.@)
856 void WINAPI RegisterSystemThread(DWORD flags, DWORD reserved)
858 FIXME("(%08lx, %08lx)\n", flags, reserved);
861 /***********************************************************************
862 * RegisterDeviceNotificationA (USER32.@)
864 * See RegisterDeviceNotificationW.
866 HDEVNOTIFY WINAPI RegisterDeviceNotificationA(HANDLE hnd, LPVOID notifyfilter, DWORD flags)
868 FIXME("(hwnd=%p, filter=%p,flags=0x%08lx), STUB!\n", hnd,notifyfilter,flags );
869 return 0;
872 /***********************************************************************
873 * RegisterDeviceNotificationW (USER32.@)
875 * Registers a window with the system so that it will receive
876 * notifications about a device.
878 * PARAMS
879 * hRecepient [I] Window or service status handle that
880 * will receive notifications.
881 * pNotificationFilter [I] DEV_BROADCAST_HDR followed by some
882 * type-specific data.
883 * dwFlags [I] See notes
885 * RETURNS
887 * A handle to the device notification.
889 * NOTES
891 * The dwFlags parameter can be one of two values:
892 *| DEVICE_NOTIFY_WINDOW_HANDLE - hRecepient is a window handle
893 *| DEVICE_NOTIFY_SERVICE_HANDLE - hRecepient is a service status handle
895 HDEVNOTIFY WINAPI RegisterDeviceNotificationW(HANDLE hRecepient, LPVOID pNotificationFilter, DWORD dwFlags)
897 FIXME("(hwnd=%p, filter=%p,flags=0x%08lx), STUB!\n", hRecepient,pNotificationFilter,dwFlags );
898 return 0;