4 * Copyright 1995 Thomas Sandford
5 * Copyright 1997 Marcus Meissner
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
25 #include "wine/windef16.h"
31 #include "wine/debug.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(win);
35 /* USER signal proc flags and codes */
36 /* See UserSignalProc for comments */
37 #define USIG_FLAGS_WIN32 0x0001
38 #define USIG_FLAGS_GUI 0x0002
39 #define USIG_FLAGS_FEEDBACK 0x0004
40 #define USIG_FLAGS_FAULT 0x0008
42 #define USIG_DLL_UNLOAD_WIN16 0x0001
43 #define USIG_DLL_UNLOAD_WIN32 0x0002
44 #define USIG_FAULT_DIALOG_PUSH 0x0003
45 #define USIG_FAULT_DIALOG_POP 0x0004
46 #define USIG_DLL_UNLOAD_ORPHANS 0x0005
47 #define USIG_THREAD_INIT 0x0010
48 #define USIG_THREAD_EXIT 0x0020
49 #define USIG_PROCESS_CREATE 0x0100
50 #define USIG_PROCESS_INIT 0x0200
51 #define USIG_PROCESS_EXIT 0x0300
52 #define USIG_PROCESS_DESTROY 0x0400
53 #define USIG_PROCESS_RUNNING 0x0500
54 #define USIG_PROCESS_LOADED 0x0600
57 /***********************************************************************
58 * SignalProc32 (USER.391)
59 * UserSignalProc (USER32.@)
61 * The exact meaning of the USER signals is undocumented, but this
62 * should cover the basic idea:
64 * USIG_DLL_UNLOAD_WIN16
65 * This is sent when a 16-bit module is unloaded.
67 * USIG_DLL_UNLOAD_WIN32
68 * This is sent when a 32-bit module is unloaded.
70 * USIG_DLL_UNLOAD_ORPHANS
71 * This is sent after the last Win3.1 module is unloaded,
72 * to allow removal of orphaned menus.
74 * USIG_FAULT_DIALOG_PUSH
75 * USIG_FAULT_DIALOG_POP
76 * These are called to allow USER to prepare for displaying a
77 * fault dialog, even though the fault might have happened while
78 * inside a USER critical section.
81 * This is called from the context of a new thread, as soon as it
85 * This is called, still in its context, just before a thread is
89 * This is called, in the parent process context, after a new process
93 * This is called in the new process context, just after the main thread
94 * has started execution (after the main thread's USIG_THREAD_INIT has
98 * This is called after the executable file has been loaded into the
99 * new process context.
101 * USIG_PROCESS_RUNNING
102 * This is called immediately before the main entry point is called.
105 * This is called in the context of a process that is about to
106 * terminate (but before the last thread's USIG_THREAD_EXIT has
109 * USIG_PROCESS_DESTROY
110 * This is called after a process has terminated.
113 * The meaning of the dwFlags bits is as follows:
116 * Current process is 32-bit.
119 * Current process is a (Win32) GUI process.
121 * USIG_FLAGS_FEEDBACK
122 * Current process needs 'feedback' (determined from the STARTUPINFO
123 * flags STARTF_FORCEONFEEDBACK / STARTF_FORCEOFFFEEDBACK).
126 * The signal is being sent due to a fault.
128 WORD WINAPI UserSignalProc( UINT uCode, DWORD dwThreadOrProcessID,
129 DWORD dwFlags, HMODULE16 hModule )
131 FIXME("(%04x, %08lx, %04lx, %04x)\n",
132 uCode, dwThreadOrProcessID, dwFlags, hModule );
133 /* FIXME: Should chain to GdiSignalProc now. */
138 /**********************************************************************
139 * SetLastErrorEx [USER32.@]
141 * Sets the last-error code.
146 void WINAPI SetLastErrorEx(
147 DWORD error, /* [in] Per-thread error code */
148 DWORD type) /* [in] Error type */
150 TRACE("(0x%08lx, 0x%08lx)\n", error,type);
157 /* Fall through for now */
159 FIXME("(error=%08lx, type=%08lx): Unhandled type\n", error,type);
162 SetLastError( error );
165 /******************************************************************************
166 * GetAltTabInfoA [USER32.@]
168 BOOL WINAPI GetAltTabInfoA(HWND hwnd, int iItem, PALTTABINFO pati, LPSTR pszItemText, UINT cchItemText)
170 FIXME("(%p, 0x%08x, %p, %p, 0x%08x)\n", hwnd, iItem, pati, pszItemText, cchItemText);
174 /******************************************************************************
175 * GetAltTabInfoW [USER32.@]
177 BOOL WINAPI GetAltTabInfoW(HWND hwnd, int iItem, PALTTABINFO pati, LPWSTR pszItemText, UINT cchItemText)
179 FIXME("(%p, 0x%08x, %p, %p, 0x%08x)\n", hwnd, iItem, pati, pszItemText, cchItemText);
183 /******************************************************************************
184 * SetDebugErrorLevel [USER32.@]
185 * Sets the minimum error level for generating debugging events
188 * dwLevel [I] Debugging error level
190 VOID WINAPI SetDebugErrorLevel( DWORD dwLevel )
192 FIXME("(%ld): stub\n", dwLevel);
196 /******************************************************************************
197 * GetProcessDefaultLayout [USER32.@]
199 * Gets the default layout for parentless windows.
200 * Right now, just returns 0 (left-to-right).
209 BOOL WINAPI GetProcessDefaultLayout( DWORD *pdwDefaultLayout )
211 if ( !pdwDefaultLayout ) {
212 SetLastError( ERROR_INVALID_PARAMETER );
215 FIXME( "( %p ): No BiDi\n", pdwDefaultLayout );
216 *pdwDefaultLayout = 0;
221 /******************************************************************************
222 * SetProcessDefaultLayout [USER32.@]
224 * Sets the default layout for parentless windows.
225 * Right now, only accepts 0 (left-to-right).
234 BOOL WINAPI SetProcessDefaultLayout( DWORD dwDefaultLayout )
236 if ( dwDefaultLayout == 0 )
238 FIXME( "( %08lx ): No BiDi\n", dwDefaultLayout );
239 SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
244 /***********************************************************************
245 * SetWindowStationUser (USER32.@)
247 DWORD WINAPI SetWindowStationUser(DWORD x1,DWORD x2)
249 FIXME("(0x%08lx,0x%08lx),stub!\n",x1,x2);
253 /***********************************************************************
254 * RegisterLogonProcess (USER32.@)
256 DWORD WINAPI RegisterLogonProcess(HANDLE hprocess,BOOL x)
258 FIXME("(%p,%d),stub!\n",hprocess,x);
262 /***********************************************************************
263 * SetLogonNotifyWindow (USER32.@)
265 DWORD WINAPI SetLogonNotifyWindow(HWINSTA hwinsta,HWND hwnd)
267 FIXME("(%p,%p),stub!\n",hwinsta,hwnd);
271 /***********************************************************************
272 * EnumDisplayDevicesA (USER32.@)
274 BOOL WINAPI EnumDisplayDevicesA( LPVOID unused, DWORD i, LPDISPLAY_DEVICEA lpDisplayDevice,
279 FIXME("(%p,%ld,%p,0x%08lx), stub!\n",unused,i,lpDisplayDevice,dwFlags);
280 strcpy(lpDisplayDevice->DeviceName,"X11");
281 strcpy(lpDisplayDevice->DeviceString,"X 11 Windowing System");
282 lpDisplayDevice->StateFlags =
283 DISPLAY_DEVICE_ATTACHED_TO_DESKTOP |
284 DISPLAY_DEVICE_PRIMARY_DEVICE |
285 DISPLAY_DEVICE_VGA_COMPATIBLE;
289 /***********************************************************************
290 * EnumDisplayDevicesW (USER32.@)
292 BOOL WINAPI EnumDisplayDevicesW( LPVOID unused, DWORD i, LPDISPLAY_DEVICEW lpDisplayDevice,
297 FIXME("(%p,%ld,%p,0x%08lx), stub!\n",unused,i,lpDisplayDevice,dwFlags);
298 MultiByteToWideChar( CP_ACP, 0, "X11", -1, lpDisplayDevice->DeviceName,
299 sizeof(lpDisplayDevice->DeviceName)/sizeof(WCHAR) );
300 MultiByteToWideChar( CP_ACP, 0, "X11 Windowing System", -1, lpDisplayDevice->DeviceString,
301 sizeof(lpDisplayDevice->DeviceString)/sizeof(WCHAR) );
302 lpDisplayDevice->StateFlags =
303 DISPLAY_DEVICE_ATTACHED_TO_DESKTOP |
304 DISPLAY_DEVICE_PRIMARY_DEVICE |
305 DISPLAY_DEVICE_VGA_COMPATIBLE;
309 /***********************************************************************
310 * RegisterSystemThread (USER32.@)
312 void WINAPI RegisterSystemThread(DWORD flags, DWORD reserved)
314 FIXME("(%08lx, %08lx)\n", flags, reserved);
317 /***********************************************************************
318 * RegisterShellHookWindow [USER32.@]
320 BOOL WINAPI RegisterShellHookWindow ( HWND hWnd )
322 FIXME("(%p): stub\n", hWnd);
327 /***********************************************************************
328 * DeregisterShellHookWindow [USER32.@]
330 HRESULT WINAPI DeregisterShellHookWindow ( DWORD u )
332 FIXME("0x%08lx stub\n",u);
338 /***********************************************************************
339 * RegisterTasklist [USER32.@]
341 DWORD WINAPI RegisterTasklist (DWORD x)
343 FIXME("0x%08lx\n",x);
348 /***********************************************************************
349 * RegisterDeviceNotificationA (USER32.@)
351 * See RegisterDeviceNotificationW.
353 HDEVNOTIFY WINAPI RegisterDeviceNotificationA(HANDLE hnd, LPVOID notifyfilter, DWORD flags)
355 FIXME("(hwnd=%p, filter=%p,flags=0x%08lx), STUB!\n", hnd,notifyfilter,flags );
359 /***********************************************************************
360 * RegisterDeviceNotificationW (USER32.@)
362 * Registers a window with the system so that it will receive
363 * notifications about a device.
366 * hRecepient [I] Window or service status handle that
367 * will receive notifications.
368 * pNotificationFilter [I] DEV_BROADCAST_HDR followed by some
369 * type-specific data.
370 * dwFlags [I] See notes
374 * A handle to the device notification.
378 * The dwFlags parameter can be one of two values:
379 *| DEVICE_NOTIFY_WINDOW_HANDLE - hRecepient is a window handle
380 *| DEVICE_NOTIFY_SERVICE_HANDLE - hRecepient is a service status handle
382 HDEVNOTIFY WINAPI RegisterDeviceNotificationW(HANDLE hRecepient, LPVOID pNotificationFilter, DWORD dwFlags)
384 FIXME("(hwnd=%p, filter=%p,flags=0x%08lx), STUB!\n", hRecepient,pNotificationFilter,dwFlags );
388 /***********************************************************************
389 * GetAppCompatFlags (USER32.@)
391 DWORD WINAPI GetAppCompatFlags( HTASK hTask )
398 /***********************************************************************
399 * AlignRects (USER32.@)
401 BOOL WINAPI AlignRects(LPRECT rect, DWORD b, DWORD c, DWORD d)
403 FIXME("(%p, %ld, %ld, %ld): stub\n", rect, b, c, d);
405 FIXME("rect: [[%ld, %ld], [%ld, %ld]]\n", rect->left, rect->top, rect->right, rect->bottom);
406 /* Calls OffsetRect */
411 /***********************************************************************
412 * LoadLocalFonts (USER32.@)
414 VOID WINAPI LoadLocalFonts(VOID)
421 /***********************************************************************
422 * USER_489 (USER.489)
424 LONG WINAPI stub_USER_489(void) { FIXME("stub\n"); return 0; }
426 /***********************************************************************
427 * USER_490 (USER.490)
429 LONG WINAPI stub_USER_490(void) { FIXME("stub\n"); return 0; }
431 /***********************************************************************
432 * USER_492 (USER.492)
434 LONG WINAPI stub_USER_492(void) { FIXME("stub\n"); return 0; }
436 /***********************************************************************
437 * USER_496 (USER.496)
439 LONG WINAPI stub_USER_496(void) { FIXME("stub\n"); return 0; }
441 /***********************************************************************
442 * User32InitializeImmEntryTable
444 BOOL WINAPI User32InitializeImmEntryTable(LPVOID ptr)
446 FIXME("(%p): stub\n", ptr);
450 /**********************************************************************
451 * WINNLSGetIMEHotkey [USER32.@]
454 UINT WINAPI WINNLSGetIMEHotkey(HWND hUnknown1)
456 FIXME("hUnknown1 %p: stub!\n", hUnknown1);
457 return 0; /* unknown */
460 /**********************************************************************
461 * WINNLSEnableIME [USER32.@]
464 BOOL WINAPI WINNLSEnableIME(HWND hUnknown1, BOOL bUnknown2)
466 FIXME("hUnknown1 %p bUnknown2 %d: stub!\n", hUnknown1, bUnknown2);
467 return TRUE; /* success (?) */
470 /**********************************************************************
471 * WINNLSGetEnableStatus [USER32.@]
474 BOOL WINAPI WINNLSGetEnableStatus(HWND hUnknown1)
476 FIXME("hUnknown1 %p: stub!\n", hUnknown1);
477 return TRUE; /* success (?) */
480 /**********************************************************************
481 * SendIMEMessageExA [USER32.@]
484 LRESULT WINAPI SendIMEMessageExA(HWND p1, LPARAM p2)
486 FIXME("(%p,%lx): stub\n", p1, p2);
487 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
491 /**********************************************************************
492 * SendIMEMessageExW [USER32.@]
495 LRESULT WINAPI SendIMEMessageExW(HWND p1, LPARAM p2)
497 FIXME("(%p,%lx): stub\n", p1, p2);
498 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);