/* * Copyright 2021 Jacek Caban for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef _NTUSER_ #define _NTUSER_ #include #include #include /* KernelCallbackTable codes, not compatible with Windows */ enum { NtUserCallEnumDisplayMonitor, NtUserCallVulkanDebugReportCallback, NtUserCallVulkanDebugUtilsCallback, NtUserCallCount }; /* NtUserCallEnumDisplayMonitor params */ struct enum_display_monitor_params { MONITORENUMPROC proc; HMONITOR monitor; HDC hdc; RECT rect; LPARAM lparam; }; /* process DPI awareness contexts */ #define NTUSER_DPI_UNAWARE 0x00006010 #define NTUSER_DPI_SYSTEM_AWARE 0x00006011 #define NTUSER_DPI_PER_MONITOR_AWARE 0x00000012 #define NTUSER_DPI_PER_MONITOR_AWARE_V2 0x00000022 #define NTUSER_DPI_PER_UNAWARE_GDISCALED 0x40006010 /* NtUserCallOneParam codes, not compatible with Windows */ enum { NtUserGetSysColor, NtUserGetSysColorBrush, NtUserGetSysColorPen, NtUserGetSystemMetrics, NtUserRealizePalette, /* temporary exports */ NtUserGetDeskPattern, }; /* NtUserCallTwoParam codes, not compatible with Windows */ enum { NtUserGetMonitorInfo, NtUserGetSystemMetricsForDpi, NtUserMirrorRgn, }; /* color index used to retrieve system 55aa brush */ #define COLOR_55AA_BRUSH 0x100 /* this is the structure stored in TEB->Win32ClientInfo */ /* no attempt is made to keep the layout compatible with the Windows one */ struct user_thread_info { HANDLE server_queue; /* Handle to server-side queue */ DWORD wake_mask; /* Current queue wake mask */ DWORD changed_mask; /* Current queue changed mask */ WORD recursion_count; /* SendMessage recursion counter */ WORD message_count; /* Get/PeekMessage loop counter */ WORD hook_call_depth; /* Number of recursively called hook procs */ WORD hook_unicode; /* Is current hook unicode? */ HHOOK hook; /* Current hook */ UINT active_hooks; /* Bitmap of active hooks */ DPI_AWARENESS dpi_awareness; /* DPI awareness */ INPUT_MESSAGE_SOURCE msg_source; /* Message source for current message */ struct received_message_info *receive_info; /* Message being currently received */ struct wm_char_mapping_data *wmchar_data; /* Data for WM_CHAR mappings */ DWORD GetMessageTimeVal; /* Value for GetMessageTime */ DWORD GetMessagePosVal; /* Value for GetMessagePos */ ULONG_PTR GetMessageExtraInfoVal; /* Value for GetMessageExtraInfo */ struct user_key_state_info *key_state; /* Cache of global key state */ HKL kbd_layout; /* Current keyboard layout */ DWORD kbd_layout_id; /* Current keyboard layout ID */ HWND top_window; /* Desktop window */ HWND msg_window; /* HWND_MESSAGE parent window */ struct rawinput_thread_data *rawinput; /* RawInput thread local data / buffer */ }; C_ASSERT( sizeof(struct user_thread_info) <= sizeof(((TEB *)0)->Win32ClientInfo) ); HKL WINAPI NtUserActivateKeyboardLayout( HKL layout, UINT flags ); BOOL WINAPI NtUserAddClipboardFormatListener( HWND hwnd ); BOOL WINAPI NtUserAttachThreadInput( DWORD from, DWORD to, BOOL attach ); NTSTATUS WINAPI NtUserBuildHwndList( HDESK desktop, ULONG unk2, ULONG unk3, ULONG unk4, ULONG thread_id, ULONG count, HWND *buffer, ULONG *size ); ULONG_PTR WINAPI NtUserCallOneParam( ULONG_PTR arg, ULONG code ); ULONG_PTR WINAPI NtUserCallTwoParam( ULONG_PTR arg1, ULONG_PTR arg2, ULONG code ); LONG WINAPI NtUserChangeDisplaySettings( UNICODE_STRING *devname, DEVMODEW *devmode, HWND hwnd, DWORD flags, void *lparam ); BOOL WINAPI NtUserCloseDesktop( HDESK handle ); BOOL WINAPI NtUserCloseWindowStation( HWINSTA handle ); INT WINAPI NtUserCountClipboardFormats(void); HDESK WINAPI NtUserCreateDesktopEx( OBJECT_ATTRIBUTES *attr, UNICODE_STRING *device, DEVMODEW *devmode, DWORD flags, ACCESS_MASK access, ULONG heap_size ); HWINSTA WINAPI NtUserCreateWindowStation( OBJECT_ATTRIBUTES *attr, ACCESS_MASK mask, ULONG arg3, ULONG arg4, ULONG arg5, ULONG arg6, ULONG arg7 ); NTSTATUS WINAPI NtUserEnumDisplayDevices( UNICODE_STRING *device, DWORD index, DISPLAY_DEVICEW *info, DWORD flags ); BOOL WINAPI NtUserEnumDisplayMonitors( HDC hdc, RECT *rect, MONITORENUMPROC proc, LPARAM lp ); BOOL WINAPI NtUserEnumDisplaySettings( UNICODE_STRING *device, DWORD mode, DEVMODEW *dev_mode, DWORD flags ); INT WINAPI NtUserGetClipboardFormatName( UINT format, WCHAR *buffer, INT maxlen ); HWND WINAPI NtUserGetClipboardOwner(void); DWORD WINAPI NtUserGetClipboardSequenceNumber(void); HWND WINAPI NtUserGetClipboardViewer(void); HCURSOR WINAPI NtUserGetCursor(void); LONG WINAPI NtUserGetDisplayConfigBufferSizes( UINT32 flags, UINT32 *num_path_info, UINT32 *num_mode_info ); UINT WINAPI NtUserGetDoubleClickTime(void); BOOL WINAPI NtUserGetDpiForMonitor( HMONITOR monitor, UINT type, UINT *x, UINT *y ); INT WINAPI NtUserGetKeyNameText( LONG lparam, WCHAR *buffer, INT size ); SHORT WINAPI NtUserGetKeyState( INT vkey ); HKL WINAPI NtUserGetKeyboardLayout( DWORD thread_id ); UINT WINAPI NtUserGetKeyboardLayoutList( INT size, HKL *layouts ); BOOL WINAPI NtUserGetKeyboardLayoutName( WCHAR *name ); BOOL WINAPI NtUserGetKeyboardState( BYTE *state ); BOOL WINAPI NtUserGetLayeredWindowAttributes( HWND hwnd, COLORREF *key, BYTE *alpha, DWORD *flags ); int WINAPI NtUserGetMouseMovePointsEx( UINT size, MOUSEMOVEPOINT *ptin, MOUSEMOVEPOINT *ptout, int count, DWORD resolution ); BOOL WINAPI NtUserGetObjectInformation( HANDLE handle, INT index, void *info, DWORD len, DWORD *needed ); HWND WINAPI NtUserGetOpenClipboardWindow(void); INT WINAPI NtUserGetPriorityClipboardFormat( UINT *list, INT count ); HWINSTA WINAPI NtUserGetProcessWindowStation(void); HANDLE WINAPI NtUserGetProp( HWND hwnd, const WCHAR *str ); ULONG WINAPI NtUserGetProcessDpiAwarenessContext( HANDLE process ); ULONG WINAPI NtUserGetSystemDpiForProcess( HANDLE process ); HDESK WINAPI NtUserGetThreadDesktop( DWORD thread ); BOOL WINAPI NtUserGetUpdatedClipboardFormats( UINT *formats, UINT size, UINT *out_size ); BOOL WINAPI NtUserIsClipboardFormatAvailable( UINT format ); UINT WINAPI NtUserMapVirtualKeyEx( UINT code, UINT type, HKL layout ); HWINSTA WINAPI NtUserOpenWindowStation( OBJECT_ATTRIBUTES *attr, ACCESS_MASK access ); BOOL WINAPI NtUserSetObjectInformation( HANDLE handle, INT index, void *info, DWORD len ); HDESK WINAPI NtUserOpenDesktop( OBJECT_ATTRIBUTES *attr, DWORD flags, ACCESS_MASK access ); HDESK WINAPI NtUserOpenInputDesktop( DWORD flags, BOOL inherit, ACCESS_MASK access ); BOOL WINAPI NtUserRemoveClipboardFormatListener( HWND hwnd ); HANDLE WINAPI NtUserRemoveProp( HWND hwnd, const WCHAR *str ); BOOL WINAPI NtUserScrollDC( HDC hdc, INT dx, INT dy, const RECT *scroll, const RECT *clip, HRGN ret_update_rgn, RECT *update_rect ); HPALETTE WINAPI NtUserSelectPalette( HDC hdc, HPALETTE palette, WORD force_background ); BOOL WINAPI NtUserSetKeyboardState( BYTE *state ); BOOL WINAPI NtUserSetProcessDpiAwarenessContext( ULONG awareness, ULONG unknown ); BOOL WINAPI NtUserSetProcessWindowStation( HWINSTA handle ); BOOL WINAPI NtUserSetProp( HWND hwnd, const WCHAR *str, HANDLE handle ); BOOL WINAPI NtUserSetSysColors( INT count, const INT *colors, const COLORREF *values ); BOOL WINAPI NtUserSetThreadDesktop( HDESK handle ); INT WINAPI NtUserShowCursor( BOOL show ); BOOL WINAPI NtUserSystemParametersInfo( UINT action, UINT val, void *ptr, UINT winini ); BOOL WINAPI NtUserSystemParametersInfoForDpi( UINT action, UINT val, PVOID ptr, UINT winini, UINT dpi ); INT WINAPI NtUserToUnicodeEx( UINT virt, UINT scan, const BYTE *state, WCHAR *str, int size, UINT flags, HKL layout ); BOOL WINAPI NtUserUnregisterHotKey( HWND hwnd, INT id ); WORD WINAPI NtUserVkKeyScanEx( WCHAR chr, HKL layout ); #endif /* _NTUSER_ */