Commit 0a930890 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

win32u: Move raw input device list management from user32.

parent cbbab655
...@@ -369,8 +369,8 @@ ...@@ -369,8 +369,8 @@
@ stdcall GetRawInputBuffer(ptr ptr long) NtUserGetRawInputBuffer @ stdcall GetRawInputBuffer(ptr ptr long) NtUserGetRawInputBuffer
@ stdcall GetRawInputData(ptr long ptr ptr long) NtUserGetRawInputData @ stdcall GetRawInputData(ptr long ptr ptr long) NtUserGetRawInputData
@ stdcall GetRawInputDeviceInfoA(ptr long ptr ptr) @ stdcall GetRawInputDeviceInfoA(ptr long ptr ptr)
@ stdcall GetRawInputDeviceInfoW(ptr long ptr ptr) @ stdcall GetRawInputDeviceInfoW(ptr long ptr ptr) NtUserGetRawInputDeviceInfo
@ stdcall GetRawInputDeviceList(ptr ptr long) @ stdcall GetRawInputDeviceList(ptr ptr long) NtUserGetRawInputDeviceList
# @ stub GetReasonTitleFromReasonCode # @ stub GetReasonTitleFromReasonCode
@ stdcall GetRegisteredRawInputDevices(ptr ptr long) NtUserGetRegisteredRawInputDevices @ stdcall GetRegisteredRawInputDevices(ptr ptr long) NtUserGetRegisteredRawInputDevices
@ stdcall GetScrollBarInfo(long long ptr) @ stdcall GetScrollBarInfo(long long ptr)
......
...@@ -161,8 +161,6 @@ static const struct user_callbacks user_funcs = ...@@ -161,8 +161,6 @@ static const struct user_callbacks user_funcs =
free_win_ptr, free_win_ptr,
notify_ime, notify_ime,
post_dde_message, post_dde_message,
rawinput_update_device_list,
rawinput_device_get_usages,
SCROLL_SetStandardScrollPainted, SCROLL_SetStandardScrollPainted,
unpack_dde_message, unpack_dde_message,
register_imm, register_imm,
......
...@@ -60,14 +60,8 @@ extern HMODULE user32_module DECLSPEC_HIDDEN; ...@@ -60,14 +60,8 @@ extern HMODULE user32_module DECLSPEC_HIDDEN;
struct dce; struct dce;
struct tagWND; struct tagWND;
struct hardware_msg_data;
extern BOOL rawinput_device_get_usages(HANDLE handle, USAGE *usage_page, USAGE *usage);
extern void CDECL rawinput_update_device_list(void);
extern BOOL post_dde_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, DWORD dest_tid, extern BOOL post_dde_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, DWORD dest_tid,
DWORD type ) DECLSPEC_HIDDEN; DWORD type ) DECLSPEC_HIDDEN;
extern BOOL process_rawinput_message( MSG *msg, UINT hw_id,
const struct hardware_msg_data *msg_data ) DECLSPEC_HIDDEN;
extern BOOL unpack_dde_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lparam, extern BOOL unpack_dde_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lparam,
void **buffer, size_t size ) DECLSPEC_HIDDEN; void **buffer, size_t size ) DECLSPEC_HIDDEN;
extern void free_cached_data( UINT format, HANDLE handle ) DECLSPEC_HIDDEN; extern void free_cached_data( UINT format, HANDLE handle ) DECLSPEC_HIDDEN;
......
...@@ -2381,9 +2381,8 @@ NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, const RAWINPUT *r ...@@ -2381,9 +2381,8 @@ NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, const RAWINPUT *r
hid_usage_page = ((USAGE *)rawinput->data.hid.bRawData)[0]; hid_usage_page = ((USAGE *)rawinput->data.hid.bRawData)[0];
hid_usage = ((USAGE *)rawinput->data.hid.bRawData)[1]; hid_usage = ((USAGE *)rawinput->data.hid.bRawData)[1];
} }
if (input->hi.uMsg == WM_INPUT && user_callbacks && if (input->hi.uMsg == WM_INPUT &&
!user_callbacks->rawinput_device_get_usages( rawinput->header.hDevice, !rawinput_device_get_usages( rawinput->header.hDevice, &hid_usage_page, &hid_usage ))
&hid_usage_page, &hid_usage ))
{ {
WARN( "unable to get HID usages for device %p\n", rawinput->header.hDevice ); WARN( "unable to get HID usages for device %p\n", rawinput->header.hDevice );
return STATUS_INVALID_HANDLE; return STATUS_INVALID_HANDLE;
......
...@@ -40,8 +40,6 @@ struct user_callbacks ...@@ -40,8 +40,6 @@ struct user_callbacks
void (CDECL *notify_ime)( HWND hwnd, UINT param ); void (CDECL *notify_ime)( HWND hwnd, UINT param );
BOOL (CDECL *post_dde_message)( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, DWORD dest_tid, BOOL (CDECL *post_dde_message)( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, DWORD dest_tid,
DWORD type ); DWORD type );
void (CDECL *rawinput_update_device_list)(void);
BOOL (CDECL *rawinput_device_get_usages)(HANDLE handle, USHORT *usage_page, USHORT *usage);
void (WINAPI *set_standard_scroll_painted)( HWND hwnd, INT bar, BOOL visible ); void (WINAPI *set_standard_scroll_painted)( HWND hwnd, INT bar, BOOL visible );
BOOL (CDECL *unpack_dde_message)( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lparam, BOOL (CDECL *unpack_dde_message)( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lparam,
void **buffer, size_t size ); void **buffer, size_t size );
......
...@@ -147,6 +147,8 @@ static void * const syscalls[] = ...@@ -147,6 +147,8 @@ static void * const syscalls[] =
NtUserGetProp, NtUserGetProp,
NtUserGetRawInputBuffer, NtUserGetRawInputBuffer,
NtUserGetRawInputData, NtUserGetRawInputData,
NtUserGetRawInputDeviceInfo,
NtUserGetRawInputDeviceList,
NtUserGetRegisteredRawInputDevices, NtUserGetRegisteredRawInputDevices,
NtUserGetSystemDpiForProcess, NtUserGetSystemDpiForProcess,
NtUserGetThreadDesktop, NtUserGetThreadDesktop,
......
...@@ -985,8 +985,8 @@ ...@@ -985,8 +985,8 @@
@ stub NtUserGetQueueStatusReadonly @ stub NtUserGetQueueStatusReadonly
@ stdcall -syscall NtUserGetRawInputBuffer(ptr ptr long) @ stdcall -syscall NtUserGetRawInputBuffer(ptr ptr long)
@ stdcall -syscall NtUserGetRawInputData(ptr long ptr ptr long) @ stdcall -syscall NtUserGetRawInputData(ptr long ptr ptr long)
@ stub NtUserGetRawInputDeviceInfo @ stdcall -syscall NtUserGetRawInputDeviceInfo(ptr long ptr ptr)
@ stub NtUserGetRawInputDeviceList @ stdcall -syscall NtUserGetRawInputDeviceList(ptr ptr long)
@ stub NtUserGetRawPointerDeviceData @ stub NtUserGetRawPointerDeviceData
@ stdcall -syscall NtUserGetRegisteredRawInputDevices(ptr ptr long) @ stdcall -syscall NtUserGetRegisteredRawInputDevices(ptr ptr long)
@ stub NtUserGetRequiredCursorSizes @ stub NtUserGetRequiredCursorSizes
......
...@@ -437,6 +437,7 @@ extern LRESULT send_message_timeout( HWND hwnd, UINT msg, WPARAM wparam, LPARAM ...@@ -437,6 +437,7 @@ extern LRESULT send_message_timeout( HWND hwnd, UINT msg, WPARAM wparam, LPARAM
/* rawinput.c */ /* rawinput.c */
extern BOOL process_rawinput_message( MSG *msg, UINT hw_id, const struct hardware_msg_data *msg_data ) DECLSPEC_HIDDEN; extern BOOL process_rawinput_message( MSG *msg, UINT hw_id, const struct hardware_msg_data *msg_data ) DECLSPEC_HIDDEN;
extern BOOL rawinput_device_get_usages( HANDLE handle, USHORT *usage_page, USHORT *usage ) DECLSPEC_HIDDEN;
/* sysparams.c */ /* sysparams.c */
extern BOOL enable_thunk_lock DECLSPEC_HIDDEN; extern BOOL enable_thunk_lock DECLSPEC_HIDDEN;
......
...@@ -134,6 +134,8 @@ ...@@ -134,6 +134,8 @@
SYSCALL_ENTRY( NtUserGetProp ) \ SYSCALL_ENTRY( NtUserGetProp ) \
SYSCALL_ENTRY( NtUserGetRawInputBuffer ) \ SYSCALL_ENTRY( NtUserGetRawInputBuffer ) \
SYSCALL_ENTRY( NtUserGetRawInputData ) \ SYSCALL_ENTRY( NtUserGetRawInputData ) \
SYSCALL_ENTRY( NtUserGetRawInputDeviceInfo ) \
SYSCALL_ENTRY( NtUserGetRawInputDeviceList ) \
SYSCALL_ENTRY( NtUserGetRegisteredRawInputDevices ) \ SYSCALL_ENTRY( NtUserGetRegisteredRawInputDevices ) \
SYSCALL_ENTRY( NtUserGetSystemDpiForProcess ) \ SYSCALL_ENTRY( NtUserGetSystemDpiForProcess ) \
SYSCALL_ENTRY( NtUserGetThreadDesktop ) \ SYSCALL_ENTRY( NtUserGetThreadDesktop ) \
......
...@@ -72,6 +72,12 @@ typedef struct ...@@ -72,6 +72,12 @@ typedef struct
UINT32 hwndTarget; UINT32 hwndTarget;
} RAWINPUTDEVICE32; } RAWINPUTDEVICE32;
typedef struct
{
UINT32 hDevice;
DWORD dwType;
} RAWINPUTDEVICELIST32;
static MSG *msg_32to64( MSG *msg, MSG32 *msg32 ) static MSG *msg_32to64( MSG *msg, MSG32 *msg32 )
{ {
if (!msg32) return NULL; if (!msg32) return NULL;
...@@ -1056,3 +1062,52 @@ NTSTATUS WINAPI wow64_NtUserGetRegisteredRawInputDevices( UINT *args ) ...@@ -1056,3 +1062,52 @@ NTSTATUS WINAPI wow64_NtUserGetRegisteredRawInputDevices( UINT *args )
return NtUserGetRegisteredRawInputDevices( NULL, count, sizeof(RAWINPUTDEVICE) ); return NtUserGetRegisteredRawInputDevices( NULL, count, sizeof(RAWINPUTDEVICE) );
} }
} }
NTSTATUS WINAPI wow64_NtUserGetRawInputDeviceInfo( UINT *args )
{
HANDLE handle = get_handle( &args );
UINT command = get_ulong( &args );
void *data = get_ptr( &args );
UINT *data_size = get_ptr( &args );
return NtUserGetRawInputDeviceInfo( handle, command, data, data_size );
}
NTSTATUS WINAPI wow64_NtUserGetRawInputDeviceList( UINT *args )
{
RAWINPUTDEVICELIST32 *devices32 = get_ptr( &args );
UINT *count = get_ptr( &args );
UINT size = get_ulong( &args );
if (size != sizeof(RAWINPUTDEVICELIST32))
{
SetLastError( ERROR_INVALID_PARAMETER );
return ~0u;
}
if (devices32)
{
RAWINPUTDEVICELIST *devices64;
unsigned int ret, i;
if (!(devices64 = Wow64AllocateTemp( (*count) * sizeof(*devices64) )))
{
SetLastError( ERROR_NOT_ENOUGH_MEMORY );
return ~0u;
}
ret = NtUserGetRawInputDeviceList( devices64, count, sizeof(RAWINPUTDEVICELIST) );
if (ret == ~0u) return ret;
for (i = 0; i < *count; ++i)
{
devices32[i].hDevice = (UINT_PTR)devices64[i].hDevice;
devices32[i].dwType = devices64[i].dwType;
}
return ret;
}
else
{
return NtUserGetRawInputDeviceList( NULL, count, sizeof(RAWINPUTDEVICELIST) );
}
}
...@@ -621,6 +621,8 @@ ULONG WINAPI NtUserGetProcessDpiAwarenessContext( HANDLE process ); ...@@ -621,6 +621,8 @@ ULONG WINAPI NtUserGetProcessDpiAwarenessContext( HANDLE process );
DWORD WINAPI NtUserGetQueueStatus( UINT flags ); DWORD WINAPI NtUserGetQueueStatus( UINT flags );
UINT WINAPI NtUserGetRawInputBuffer( RAWINPUT *data, UINT *data_size, UINT header_size ); UINT WINAPI NtUserGetRawInputBuffer( RAWINPUT *data, UINT *data_size, UINT header_size );
UINT WINAPI NtUserGetRawInputData( HRAWINPUT rawinput, UINT command, void *data, UINT *data_size, UINT header_size ); UINT WINAPI NtUserGetRawInputData( HRAWINPUT rawinput, UINT command, void *data, UINT *data_size, UINT header_size );
UINT WINAPI NtUserGetRawInputDeviceInfo( HANDLE handle, UINT command, void *data, UINT *data_size );
UINT WINAPI NtUserGetRawInputDeviceList( RAWINPUTDEVICELIST *devices, UINT *device_count, UINT size );
UINT WINAPI NtUserGetRegisteredRawInputDevices( RAWINPUTDEVICE *devices, UINT *device_count, UINT size ); UINT WINAPI NtUserGetRegisteredRawInputDevices( RAWINPUTDEVICE *devices, UINT *device_count, UINT size );
ULONG WINAPI NtUserGetSystemDpiForProcess( HANDLE process ); ULONG WINAPI NtUserGetSystemDpiForProcess( HANDLE process );
HMENU WINAPI NtUserGetSystemMenu( HWND hwnd, BOOL revert ); HMENU WINAPI NtUserGetSystemMenu( HWND hwnd, BOOL revert );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment