[PATCH 1/5] dinput8/tests: Add some RegisterDeviceNotificationA and hotplug tests.
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> --- dlls/dinput8/tests/hid.c | 388 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 388 insertions(+) diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index 3b88dc4ea21..bd51d27580a 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -44,6 +44,7 @@ #define COBJMACROS #include "wingdi.h" +#include "dbt.h" #include "dinput.h" #include "dinputd.h" #include "mmsystem.h" @@ -9964,6 +9965,391 @@ done: SetCurrentDirectoryW( cwd ); } +static int device_change_count; +static int device_change_expect; +static HWND device_change_hwnd; +static BOOL device_change_all; + +static BOOL all_upper( const WCHAR *str, const WCHAR *end ) +{ + while (str++ != end) if (towupper( str[-1] ) != str[-1]) return FALSE; + return TRUE; +} + +static BOOL all_lower( const WCHAR *str, const WCHAR *end ) +{ + while (str++ != end) if (towlower( str[-1] ) != str[-1]) return FALSE; + return TRUE; +} + +static LRESULT CALLBACK devnotify_wndproc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) +{ + if (msg == WM_DEVICECHANGE) + { + DEV_BROADCAST_HDR *header = (DEV_BROADCAST_HDR *)lparam; + DEV_BROADCAST_DEVICEINTERFACE_W *iface = (DEV_BROADCAST_DEVICEINTERFACE_W *)lparam; + const WCHAR *upper_end, *name_end, *expect_prefix; + GUID expect_guid; + + if (device_change_all && (device_change_count == 0 || device_change_count == 3)) + { + expect_guid = control_class; + expect_prefix = L"\\\\?\\ROOT#"; + } + else + { + expect_guid = GUID_DEVINTERFACE_HID; + expect_prefix = L"\\\\?\\HID#"; + } + + ok( hwnd == device_change_hwnd, "got hwnd %p\n", hwnd ); + ok( header->dbch_devicetype == DBT_DEVTYP_DEVICEINTERFACE, "got dbch_devicetype %u\n", + header->dbch_devicetype ); + + winetest_push_context( "%u", device_change_count ); + + todo_wine_if( IsEqualGUID( &iface->dbcc_classguid, &control_class ) && !device_change_all ) + ok( IsEqualGUID( &iface->dbcc_classguid, &expect_guid ), "got dbch_classguid %s\n", + debugstr_guid( &iface->dbcc_classguid ) ); + ok( iface->dbcc_size >= offsetof( DEV_BROADCAST_DEVICEINTERFACE_W, dbcc_name[wcslen( iface->dbcc_name ) + 1] ), + "got dbcc_size %u\n", iface->dbcc_size ); + todo_wine + ok( !wcsncmp( iface->dbcc_name, expect_prefix, wcslen( expect_prefix ) ), + "got dbcc_name %s\n", debugstr_w(iface->dbcc_name) ); + + upper_end = wcschr( iface->dbcc_name + wcslen( expect_prefix ), '#' ); + name_end = iface->dbcc_name + wcslen( iface->dbcc_name ) + 1; + ok( !!upper_end, "got dbcc_name %s\n", debugstr_w(iface->dbcc_name) ); + todo_wine + ok( all_upper( iface->dbcc_name, upper_end ), "got dbcc_name %s\n", debugstr_w(iface->dbcc_name) ); + ok( all_lower( upper_end, name_end ), "got dbcc_name %s\n", debugstr_w(iface->dbcc_name) ); + + if (device_change_count++ >= device_change_expect / 2) + ok( wparam == DBT_DEVICEREMOVECOMPLETE, "got wparam %#x\n", (DWORD)wparam ); + else + ok( wparam == DBT_DEVICEARRIVAL, "got wparam %#x\n", (DWORD)wparam ); + + winetest_pop_context(); + } + + return DefWindowProcW( hwnd, msg, wparam, lparam ); +} + +static DWORD WINAPI test_gamepad_driver_thread( void *arg ) +{ +#include "psh_hid_macros.h" + static const unsigned char gamepad_desc[] = + { + USAGE_PAGE(1, HID_USAGE_PAGE_GENERIC), + USAGE(1, HID_USAGE_GENERIC_GAMEPAD), + COLLECTION(1, Application), + USAGE(1, HID_USAGE_GENERIC_GAMEPAD), + COLLECTION(1, Physical), + USAGE(1, HID_USAGE_GENERIC_X), + USAGE(1, HID_USAGE_GENERIC_Y), + LOGICAL_MINIMUM(1, 0), + LOGICAL_MAXIMUM(1, 127), + PHYSICAL_MINIMUM(1, 0), + PHYSICAL_MAXIMUM(1, 127), + REPORT_SIZE(1, 8), + REPORT_COUNT(1, 2), + INPUT(1, Data|Var|Abs), + + USAGE_PAGE(1, HID_USAGE_PAGE_BUTTON), + USAGE_MINIMUM(1, 1), + USAGE_MAXIMUM(1, 6), + LOGICAL_MINIMUM(1, 0), + LOGICAL_MAXIMUM(1, 1), + PHYSICAL_MINIMUM(1, 0), + PHYSICAL_MAXIMUM(1, 1), + REPORT_SIZE(1, 1), + REPORT_COUNT(1, 8), + INPUT(1, Data|Var|Abs), + END_COLLECTION, + END_COLLECTION, + }; +#include "pop_hid_macros.h" + static const HID_DEVICE_ATTRIBUTES attributes = + { + .Size = sizeof(HID_DEVICE_ATTRIBUTES), + .VendorID = LOWORD( EXPECT_VIDPID ), + .ProductID = HIWORD( EXPECT_VIDPID ), + .VersionNumber = 0x0100, + }; + static const HIDP_CAPS caps = + { + .InputReportByteLength = 3, + }; + + WCHAR cwd[MAX_PATH], tempdir[MAX_PATH]; + DWORD report_id = 1, polled = 0; + HANDLE stop_event = arg; + char context[64]; + LSTATUS status; + HKEY hkey; + + GetCurrentDirectoryW( ARRAY_SIZE(cwd), cwd ); + GetTempPathW( ARRAY_SIZE(tempdir), tempdir ); + SetCurrentDirectoryW( tempdir ); + + status = RegCreateKeyExW( HKEY_LOCAL_MACHINE, L"System\\CurrentControlSet\\Services\\winetest", + 0, NULL, REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &hkey, NULL ); + ok( !status, "RegCreateKeyExW returned %#x\n", status ); + status = RegSetValueExW( hkey, L"ReportID", 0, REG_DWORD, (void *)&report_id, sizeof(report_id) ); + ok( !status, "RegSetValueExW returned %#x\n", status ); + status = RegSetValueExW( hkey, L"PolledMode", 0, REG_DWORD, (void *)&polled, sizeof(polled) ); + ok( !status, "RegSetValueExW returned %#x\n", status ); + status = RegSetValueExW( hkey, L"Descriptor", 0, REG_BINARY, (void *)gamepad_desc, sizeof(gamepad_desc) ); + ok( !status, "RegSetValueExW returned %#x\n", status ); + status = RegSetValueExW( hkey, L"Attributes", 0, REG_BINARY, (void *)&attributes, sizeof(attributes) ); + ok( !status, "RegSetValueExW returned %#x\n", status ); + status = RegSetValueExW( hkey, L"Caps", 0, REG_BINARY, (void *)&caps, sizeof(caps) ); + ok( !status, "RegSetValueExW returned %#x\n", status ); + status = RegSetValueExW( hkey, L"Expect", 0, REG_BINARY, (void *)NULL, 0 ); + ok( !status, "RegSetValueExW returned %#x\n", status ); + status = RegSetValueExW( hkey, L"Input", 0, REG_BINARY, NULL, 0 ); + ok( !status, "RegSetValueExW returned %#x\n", status ); + fill_context( __LINE__, context, ARRAY_SIZE(context) ); + status = RegSetValueExW( hkey, L"Context", 0, REG_BINARY, (void *)context, sizeof(context) ); + ok( !status, "RegSetValueExW returned %#x\n", status ); + + pnp_driver_start( L"driver_hid.dll" ); + WaitForSingleObject( stop_event, INFINITE ); + pnp_driver_stop(); + + SetCurrentDirectoryW( cwd ); + + return 0; +} + +static void test_RegisterDeviceNotification(void) +{ + DEV_BROADCAST_DEVICEINTERFACE_A iface_filter_a = + { + .dbcc_size = sizeof(DEV_BROADCAST_DEVICEINTERFACE_A), + .dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE, + .dbcc_classguid = GUID_DEVINTERFACE_HID, + }; + WNDCLASSEXW class = + { + .cbSize = sizeof(WNDCLASSEXW), + .hInstance = GetModuleHandleW( NULL ), + .lpszClassName = L"devnotify", + .lpfnWndProc = devnotify_wndproc, + }; + char buffer[1024] = {0}; + DEV_BROADCAST_HDR *header = (DEV_BROADCAST_HDR *)buffer; + HANDLE hwnd, thread, stop_event; + HDEVNOTIFY devnotify; + MSG msg; + + RegisterClassExW( &class ); + + hwnd = CreateWindowW( class.lpszClassName, NULL, 0, 0, 0, 0, 0, HWND_MESSAGE, NULL, NULL, NULL ); + ok( !!hwnd, "CreateWindowW failed, error %u\n", GetLastError() ); + + SetLastError( 0xdeadbeef ); + devnotify = RegisterDeviceNotificationA( NULL, NULL, 0 ); + todo_wine + ok( !devnotify, "RegisterDeviceNotificationA succeeded\n" ); + todo_wine + ok( GetLastError() == ERROR_INVALID_PARAMETER, "got error %u\n", GetLastError() ); + if (devnotify) UnregisterDeviceNotification( devnotify ); + + SetLastError( 0xdeadbeef ); + devnotify = RegisterDeviceNotificationA( (HWND)0xdeadbeef, NULL, 0 ); + todo_wine + ok( !devnotify, "RegisterDeviceNotificationA succeeded\n" ); + todo_wine + ok( GetLastError() == ERROR_INVALID_PARAMETER, "got error %u\n", GetLastError() ); + if (devnotify) UnregisterDeviceNotification( devnotify ); + + SetLastError( 0xdeadbeef ); + devnotify = RegisterDeviceNotificationA( hwnd, NULL, 2 ); + todo_wine + ok( !devnotify, "RegisterDeviceNotificationA succeeded\n" ); + todo_wine + ok( GetLastError() == ERROR_INVALID_PARAMETER, "got error %u\n", GetLastError() ); + if (devnotify) UnregisterDeviceNotification( devnotify ); + + SetLastError( 0xdeadbeef ); + memset( header, 0, sizeof(DEV_BROADCAST_OEM) ); + header->dbch_size = sizeof(DEV_BROADCAST_OEM); + header->dbch_devicetype = DBT_DEVTYP_OEM; + devnotify = RegisterDeviceNotificationA( hwnd, header, 0 ); + todo_wine + ok( !devnotify, "RegisterDeviceNotificationA succeeded\n" ); + todo_wine + ok( GetLastError() == ERROR_INVALID_DATA, "got error %u\n", GetLastError() ); + if (devnotify) UnregisterDeviceNotification( devnotify ); + + SetLastError( 0xdeadbeef ); + memset( header, 0, sizeof(DEV_BROADCAST_DEVNODE) ); + header->dbch_size = sizeof(DEV_BROADCAST_DEVNODE); + header->dbch_devicetype = DBT_DEVTYP_DEVNODE; + devnotify = RegisterDeviceNotificationA( hwnd, header, 0 ); + todo_wine + ok( !devnotify, "RegisterDeviceNotificationA succeeded\n" ); + todo_wine + ok( GetLastError() == ERROR_INVALID_DATA, "got error %u\n", GetLastError() ); + if (devnotify) UnregisterDeviceNotification( devnotify ); + + SetLastError( 0xdeadbeef ); + memset( header, 0, sizeof(DEV_BROADCAST_VOLUME) ); + header->dbch_size = sizeof(DEV_BROADCAST_VOLUME); + header->dbch_devicetype = DBT_DEVTYP_VOLUME; + devnotify = RegisterDeviceNotificationA( hwnd, header, 0 ); + todo_wine + ok( !devnotify, "RegisterDeviceNotificationA succeeded\n" ); + todo_wine + ok( GetLastError() == ERROR_INVALID_DATA, "got error %u\n", GetLastError() ); + if (devnotify) UnregisterDeviceNotification( devnotify ); + + SetLastError( 0xdeadbeef ); + memset( header, 0, sizeof(DEV_BROADCAST_PORT_A) ); + header->dbch_size = sizeof(DEV_BROADCAST_PORT_A); + header->dbch_devicetype = DBT_DEVTYP_PORT; + devnotify = RegisterDeviceNotificationA( hwnd, header, 0 ); + todo_wine + ok( !devnotify, "RegisterDeviceNotificationA succeeded\n" ); + todo_wine + ok( GetLastError() == ERROR_INVALID_DATA, "got error %u\n", GetLastError() ); + if (devnotify) UnregisterDeviceNotification( devnotify ); + + SetLastError( 0xdeadbeef ); + memset( header, 0, sizeof(DEV_BROADCAST_NET) ); + header->dbch_size = sizeof(DEV_BROADCAST_NET); + header->dbch_devicetype = DBT_DEVTYP_NET; + devnotify = RegisterDeviceNotificationA( hwnd, header, 0 ); + todo_wine + ok( !devnotify, "RegisterDeviceNotificationA succeeded\n" ); + todo_wine + ok( GetLastError() == ERROR_INVALID_DATA, "got error %u\n", GetLastError() ); + if (devnotify) UnregisterDeviceNotification( devnotify ); + + devnotify = RegisterDeviceNotificationA( hwnd, &iface_filter_a, DEVICE_NOTIFY_WINDOW_HANDLE ); + ok( !!devnotify, "RegisterDeviceNotificationA failed, error %u\n", GetLastError() ); + + device_change_count = 0; + if (!strcmp( winetest_platform, "wine" )) device_change_expect = 4; + else device_change_expect = 2; + device_change_hwnd = hwnd; + device_change_all = FALSE; + stop_event = CreateEventW( NULL, FALSE, FALSE, NULL ); + ok( !!stop_event, "CreateEventW failed, error %u\n", GetLastError() ); + thread = CreateThread( NULL, 0, test_gamepad_driver_thread, stop_event, 0, NULL ); + ok( !!thread, "CreateThread failed, error %u\n", GetLastError() ); + + while (device_change_count < device_change_expect) + { + /* This may happen on a newly created prefix, if rpcss.exe started late and plugplay didn't connect */ + if (MsgWaitForMultipleObjectsEx( 0, NULL, 1000, QS_ALLINPUT, 0 ) == WAIT_TIMEOUT) + { + todo_wine + ok( 0, "Timeout while waiting for WM_DEVICECHANGE message.\n" ); + SetEvent( stop_event ); + break; + } + + while (PeekMessageW( &msg, hwnd, 0, 0, PM_REMOVE )) + { + TranslateMessage( &msg ); + ok( msg.message != WM_DEVICECHANGE, "got WM_DEVICECHANGE\n" ); + DispatchMessageW( &msg ); + } + if (device_change_count == device_change_expect / 2) SetEvent( stop_event ); + } + + WaitForSingleObject( thread, INFINITE ); + CloseHandle( thread ); + CloseHandle( stop_event ); + + UnregisterDeviceNotification( devnotify ); + + memcpy( buffer, &iface_filter_a, sizeof(iface_filter_a) ); + strcpy( ((DEV_BROADCAST_DEVICEINTERFACE_A *)buffer)->dbcc_name, "device name" ); + ((DEV_BROADCAST_DEVICEINTERFACE_A *)buffer)->dbcc_size += strlen( "device name" ) + 1; + devnotify = RegisterDeviceNotificationA( hwnd, buffer, DEVICE_NOTIFY_WINDOW_HANDLE ); + ok( !!devnotify, "RegisterDeviceNotificationA failed, error %u\n", GetLastError() ); + + device_change_count = 0; + if (!strcmp( winetest_platform, "wine" )) device_change_expect = 4; + else device_change_expect = 2; + device_change_hwnd = hwnd; + device_change_all = FALSE; + stop_event = CreateEventW( NULL, FALSE, FALSE, NULL ); + ok( !!stop_event, "CreateEventW failed, error %u\n", GetLastError() ); + thread = CreateThread( NULL, 0, test_gamepad_driver_thread, stop_event, 0, NULL ); + ok( !!thread, "CreateThread failed, error %u\n", GetLastError() ); + + while (device_change_count < device_change_expect) + { + /* This may happen on a newly created prefix, if rpcss.exe started late and plugplay didn't connect */ + if (MsgWaitForMultipleObjectsEx( 0, NULL, 1000, QS_ALLINPUT, 0 ) == WAIT_TIMEOUT) + { + todo_wine + ok( 0, "Timeout while waiting for WM_DEVICECHANGE message.\n" ); + SetEvent( stop_event ); + break; + } + + while (PeekMessageW( &msg, hwnd, 0, 0, PM_REMOVE )) + { + TranslateMessage( &msg ); + ok( msg.message != WM_DEVICECHANGE, "got WM_DEVICECHANGE\n" ); + DispatchMessageW( &msg ); + } + if (device_change_count == device_change_expect / 2) SetEvent( stop_event ); + } + + WaitForSingleObject( thread, INFINITE ); + CloseHandle( thread ); + CloseHandle( stop_event ); + + UnregisterDeviceNotification( devnotify ); + + devnotify = RegisterDeviceNotificationA( hwnd, &iface_filter_a, DEVICE_NOTIFY_ALL_INTERFACE_CLASSES ); + ok( !!devnotify, "RegisterDeviceNotificationA failed, error %u\n", GetLastError() ); + + device_change_count = 0; + device_change_expect = 4; + device_change_hwnd = hwnd; + device_change_all = TRUE; + stop_event = CreateEventW( NULL, FALSE, FALSE, NULL ); + ok( !!stop_event, "CreateEventW failed, error %u\n", GetLastError() ); + thread = CreateThread( NULL, 0, test_gamepad_driver_thread, stop_event, 0, NULL ); + ok( !!thread, "CreateThread failed, error %u\n", GetLastError() ); + + while (device_change_count < device_change_expect) + { + /* This may happen on a newly created prefix, if rpcss.exe started late and plugplay didn't connect */ + if (MsgWaitForMultipleObjectsEx( 0, NULL, 1000, QS_ALLINPUT, 0 ) == WAIT_TIMEOUT) + { + todo_wine + ok( 0, "Timeout while waiting for WM_DEVICECHANGE message.\n" ); + SetEvent( stop_event ); + break; + } + + while (PeekMessageW( &msg, hwnd, 0, 0, PM_REMOVE )) + { + TranslateMessage( &msg ); + ok( msg.message != WM_DEVICECHANGE, "got WM_DEVICECHANGE\n" ); + DispatchMessageW( &msg ); + } + if (device_change_count == device_change_expect / 2) SetEvent( stop_event ); + } + + WaitForSingleObject( thread, INFINITE ); + CloseHandle( thread ); + CloseHandle( stop_event ); + + UnregisterDeviceNotification( devnotify ); + + DestroyWindow( hwnd ); + UnregisterClassW( class.lpszClassName, class.hInstance ); +} + START_TEST( hid ) { HANDLE mapping; @@ -10003,6 +10389,8 @@ START_TEST( hid ) test_hid_driver( 0, TRUE ); test_hid_driver( 1, TRUE ); + test_RegisterDeviceNotification(); + CoInitialize( NULL ); if (test_device_types( 0x800 )) { -- 2.34.1
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> --- dlls/dinput8/tests/hid.c | 24 ------------------------ dlls/sechost/service.c | 5 +++++ dlls/user32/input.c | 39 ++++++++++++++++++++++++++++++++++++++- 3 files changed, 43 insertions(+), 25 deletions(-) diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index bd51d27580a..fea8dc07654 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -10150,82 +10150,58 @@ static void test_RegisterDeviceNotification(void) SetLastError( 0xdeadbeef ); devnotify = RegisterDeviceNotificationA( NULL, NULL, 0 ); - todo_wine ok( !devnotify, "RegisterDeviceNotificationA succeeded\n" ); - todo_wine ok( GetLastError() == ERROR_INVALID_PARAMETER, "got error %u\n", GetLastError() ); - if (devnotify) UnregisterDeviceNotification( devnotify ); SetLastError( 0xdeadbeef ); devnotify = RegisterDeviceNotificationA( (HWND)0xdeadbeef, NULL, 0 ); - todo_wine ok( !devnotify, "RegisterDeviceNotificationA succeeded\n" ); - todo_wine ok( GetLastError() == ERROR_INVALID_PARAMETER, "got error %u\n", GetLastError() ); - if (devnotify) UnregisterDeviceNotification( devnotify ); SetLastError( 0xdeadbeef ); devnotify = RegisterDeviceNotificationA( hwnd, NULL, 2 ); - todo_wine ok( !devnotify, "RegisterDeviceNotificationA succeeded\n" ); - todo_wine ok( GetLastError() == ERROR_INVALID_PARAMETER, "got error %u\n", GetLastError() ); - if (devnotify) UnregisterDeviceNotification( devnotify ); SetLastError( 0xdeadbeef ); memset( header, 0, sizeof(DEV_BROADCAST_OEM) ); header->dbch_size = sizeof(DEV_BROADCAST_OEM); header->dbch_devicetype = DBT_DEVTYP_OEM; devnotify = RegisterDeviceNotificationA( hwnd, header, 0 ); - todo_wine ok( !devnotify, "RegisterDeviceNotificationA succeeded\n" ); - todo_wine ok( GetLastError() == ERROR_INVALID_DATA, "got error %u\n", GetLastError() ); - if (devnotify) UnregisterDeviceNotification( devnotify ); SetLastError( 0xdeadbeef ); memset( header, 0, sizeof(DEV_BROADCAST_DEVNODE) ); header->dbch_size = sizeof(DEV_BROADCAST_DEVNODE); header->dbch_devicetype = DBT_DEVTYP_DEVNODE; devnotify = RegisterDeviceNotificationA( hwnd, header, 0 ); - todo_wine ok( !devnotify, "RegisterDeviceNotificationA succeeded\n" ); - todo_wine ok( GetLastError() == ERROR_INVALID_DATA, "got error %u\n", GetLastError() ); - if (devnotify) UnregisterDeviceNotification( devnotify ); SetLastError( 0xdeadbeef ); memset( header, 0, sizeof(DEV_BROADCAST_VOLUME) ); header->dbch_size = sizeof(DEV_BROADCAST_VOLUME); header->dbch_devicetype = DBT_DEVTYP_VOLUME; devnotify = RegisterDeviceNotificationA( hwnd, header, 0 ); - todo_wine ok( !devnotify, "RegisterDeviceNotificationA succeeded\n" ); - todo_wine ok( GetLastError() == ERROR_INVALID_DATA, "got error %u\n", GetLastError() ); - if (devnotify) UnregisterDeviceNotification( devnotify ); SetLastError( 0xdeadbeef ); memset( header, 0, sizeof(DEV_BROADCAST_PORT_A) ); header->dbch_size = sizeof(DEV_BROADCAST_PORT_A); header->dbch_devicetype = DBT_DEVTYP_PORT; devnotify = RegisterDeviceNotificationA( hwnd, header, 0 ); - todo_wine ok( !devnotify, "RegisterDeviceNotificationA succeeded\n" ); - todo_wine ok( GetLastError() == ERROR_INVALID_DATA, "got error %u\n", GetLastError() ); - if (devnotify) UnregisterDeviceNotification( devnotify ); SetLastError( 0xdeadbeef ); memset( header, 0, sizeof(DEV_BROADCAST_NET) ); header->dbch_size = sizeof(DEV_BROADCAST_NET); header->dbch_devicetype = DBT_DEVTYP_NET; devnotify = RegisterDeviceNotificationA( hwnd, header, 0 ); - todo_wine ok( !devnotify, "RegisterDeviceNotificationA succeeded\n" ); - todo_wine ok( GetLastError() == ERROR_INVALID_DATA, "got error %u\n", GetLastError() ); - if (devnotify) UnregisterDeviceNotification( devnotify ); devnotify = RegisterDeviceNotificationA( hwnd, &iface_filter_a, DEVICE_NOTIFY_WINDOW_HANDLE ); ok( !!devnotify, "RegisterDeviceNotificationA failed, error %u\n", GetLastError() ); diff --git a/dlls/sechost/service.c b/dlls/sechost/service.c index e6f4eb75db0..b2c768f77b7 100644 --- a/dlls/sechost/service.c +++ b/dlls/sechost/service.c @@ -1974,6 +1974,11 @@ struct device_notification_details { DWORD (CALLBACK *cb)(HANDLE handle, DWORD flags, DEV_BROADCAST_HDR *header); HANDLE handle; + union + { + DEV_BROADCAST_HDR header; + DEV_BROADCAST_DEVICEINTERFACE_W iface; + } filter; }; static HANDLE device_notify_thread; diff --git a/dlls/user32/input.c b/dlls/user32/input.c index 7134ab0fbb2..5010fe93bd5 100644 --- a/dlls/user32/input.c +++ b/dlls/user32/input.c @@ -1171,6 +1171,11 @@ struct device_notification_details { DWORD (CALLBACK *cb)(HANDLE handle, DWORD flags, DEV_BROADCAST_HDR *header); HANDLE handle; + union + { + DEV_BROADCAST_HDR header; + DEV_BROADCAST_DEVICEINTERFACE_W iface; + } filter; }; extern HDEVNOTIFY WINAPI I_ScRegisterDeviceNotification( struct device_notification_details *details, @@ -1197,11 +1202,43 @@ HDEVNOTIFY WINAPI RegisterDeviceNotificationA(HANDLE hRecipient, LPVOID pNotific HDEVNOTIFY WINAPI RegisterDeviceNotificationW( HANDLE handle, void *filter, DWORD flags ) { struct device_notification_details details; + DEV_BROADCAST_HDR *header = filter; TRACE("handle %p, filter %p, flags %#x\n", handle, filter, flags); if (flags & ~(DEVICE_NOTIFY_SERVICE_HANDLE | DEVICE_NOTIFY_ALL_INTERFACE_CLASSES)) - FIXME("unhandled flags %#x\n", flags); + { + SetLastError( ERROR_INVALID_PARAMETER ); + return NULL; + } + + if (!(flags & DEVICE_NOTIFY_SERVICE_HANDLE) && !IsWindow( handle )) + { + SetLastError( ERROR_INVALID_PARAMETER ); + return NULL; + } + + if (!header) details.filter.header.dbch_devicetype = 0; + else if (header->dbch_devicetype == DBT_DEVTYP_DEVICEINTERFACE) + { + DEV_BROADCAST_DEVICEINTERFACE_W *iface = (DEV_BROADCAST_DEVICEINTERFACE_W *)header; + details.filter.iface = *iface; + + if (flags & DEVICE_NOTIFY_ALL_INTERFACE_CLASSES) + details.filter.iface.dbcc_size = offsetof( DEV_BROADCAST_DEVICEINTERFACE_W, dbcc_classguid ); + else + details.filter.iface.dbcc_size = offsetof( DEV_BROADCAST_DEVICEINTERFACE_W, dbcc_name ); + } + else if (header->dbch_devicetype == DBT_DEVTYP_HANDLE) + { + FIXME( "DBT_DEVTYP_HANDLE filter type not implemented\n" ); + details.filter.header.dbch_devicetype = 0; + } + else + { + SetLastError( ERROR_INVALID_DATA ); + return NULL; + } details.handle = handle; -- 2.34.1
Hi, While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=104459 Your paranoid android. === w7u_2qxl (32 bit report) === dinput8: hid.c:10173: Test failed: got error 1066 hid.c:10181: Test failed: got error 1066 hid.c:10189: Test failed: got error 1066 hid.c:10197: Test failed: got error 1066 hid.c:10205: Test failed: got error 1066 hid.c:10226: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10268: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10306: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid: Timeout === w7u_el (32 bit report) === dinput8: hid.c:10173: Test failed: got error 1066 hid.c:10181: Test failed: got error 1066 hid.c:10189: Test failed: got error 1066 hid.c:10197: Test failed: got error 1066 hid.c:10205: Test failed: got error 1066 hid.c:10226: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10268: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10306: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid: Timeout === w864 (64 bit report) === dinput8: hid.c:10226: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10268: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10306: Test failed: Timeout while waiting for WM_DEVICECHANGE message. === w1064v1507 (64 bit report) === dinput8: hid.c:10226: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10268: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10306: Test failed: Timeout while waiting for WM_DEVICECHANGE message. === w1064v1809 (64 bit report) === dinput8: hid.c:10226: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10268: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10306: Test failed: Timeout while waiting for WM_DEVICECHANGE message. === w1064 (64 bit report) === dinput8: hid.c:10226: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10268: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10306: Test failed: Timeout while waiting for WM_DEVICECHANGE message. === w1064_2qxl (64 bit report) === dinput8: hid.c:10226: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10268: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10306: Test failed: Timeout while waiting for WM_DEVICECHANGE message. === w10pro64 (64 bit report) === dinput8: hid.c:10226: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10268: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10306: Test failed: Timeout while waiting for WM_DEVICECHANGE message. === w10pro64_ar (64 bit report) === dinput8: hid.c:10226: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10268: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10306: Test failed: Timeout while waiting for WM_DEVICECHANGE message. === w10pro64_he (64 bit report) === dinput8: hid.c:10226: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10268: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10306: Test failed: Timeout while waiting for WM_DEVICECHANGE message. === w10pro64_ja (64 bit report) === dinput8: hid.c:10226: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10268: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10306: Test failed: Timeout while waiting for WM_DEVICECHANGE message. === w10pro64_zh_CN (64 bit report) === dinput8: hid.c:10226: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10268: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10306: Test failed: Timeout while waiting for WM_DEVICECHANGE message. === debian11 (32 bit Chinese:China report) === user32: msg.c:15143: Test failed: bad time 2245f3c
There's no conversion to do, the device name in the filter is ignored. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> --- dlls/user32/input.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/dlls/user32/input.c b/dlls/user32/input.c index 5010fe93bd5..b6b20ce093d 100644 --- a/dlls/user32/input.c +++ b/dlls/user32/input.c @@ -1187,13 +1187,9 @@ extern BOOL WINAPI I_ScUnregisterDeviceNotification( HDEVNOTIFY handle ); * * See RegisterDeviceNotificationW. */ -HDEVNOTIFY WINAPI RegisterDeviceNotificationA(HANDLE hRecipient, LPVOID pNotificationFilter, DWORD dwFlags) +HDEVNOTIFY WINAPI RegisterDeviceNotificationA( HANDLE handle, void *filter, DWORD flags ) { - TRACE("(hwnd=%p, filter=%p,flags=0x%08x)\n", - hRecipient,pNotificationFilter,dwFlags); - if (pNotificationFilter) - FIXME("The notification filter will requires an A->W when filter support is implemented\n"); - return RegisterDeviceNotificationW(hRecipient, pNotificationFilter, dwFlags); + return RegisterDeviceNotificationW( handle, filter, flags ); } /*********************************************************************** -- 2.34.1
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> --- dlls/dinput8/tests/hid.c | 7 ++----- dlls/sechost/service.c | 20 ++++++++++++++++++-- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index fea8dc07654..431dadcb348 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -10008,7 +10008,6 @@ static LRESULT CALLBACK devnotify_wndproc( HWND hwnd, UINT msg, WPARAM wparam, L winetest_push_context( "%u", device_change_count ); - todo_wine_if( IsEqualGUID( &iface->dbcc_classguid, &control_class ) && !device_change_all ) ok( IsEqualGUID( &iface->dbcc_classguid, &expect_guid ), "got dbch_classguid %s\n", debugstr_guid( &iface->dbcc_classguid ) ); ok( iface->dbcc_size >= offsetof( DEV_BROADCAST_DEVICEINTERFACE_W, dbcc_name[wcslen( iface->dbcc_name ) + 1] ), @@ -10207,8 +10206,7 @@ static void test_RegisterDeviceNotification(void) ok( !!devnotify, "RegisterDeviceNotificationA failed, error %u\n", GetLastError() ); device_change_count = 0; - if (!strcmp( winetest_platform, "wine" )) device_change_expect = 4; - else device_change_expect = 2; + device_change_expect = 2; device_change_hwnd = hwnd; device_change_all = FALSE; stop_event = CreateEventW( NULL, FALSE, FALSE, NULL ); @@ -10249,8 +10247,7 @@ static void test_RegisterDeviceNotification(void) ok( !!devnotify, "RegisterDeviceNotificationA failed, error %u\n", GetLastError() ); device_change_count = 0; - if (!strcmp( winetest_platform, "wine" )) device_change_expect = 4; - else device_change_expect = 2; + device_change_expect = 2; device_change_hwnd = hwnd; device_change_all = FALSE; stop_event = CreateEventW( NULL, FALSE, FALSE, NULL ); diff --git a/dlls/sechost/service.c b/dlls/sechost/service.c index b2c768f77b7..1dd053a86d7 100644 --- a/dlls/sechost/service.c +++ b/dlls/sechost/service.c @@ -1990,6 +1990,23 @@ struct device_notify_registration struct device_notification_details details; }; +static BOOL notification_filter_matches( DEV_BROADCAST_HDR *filter, DEV_BROADCAST_HDR *event ) +{ + if (!filter->dbch_devicetype) return TRUE; + if (filter->dbch_devicetype != event->dbch_devicetype) return FALSE; + + if (filter->dbch_devicetype == DBT_DEVTYP_DEVICEINTERFACE) + { + DEV_BROADCAST_DEVICEINTERFACE_W *filter_iface = (DEV_BROADCAST_DEVICEINTERFACE_W *)filter; + DEV_BROADCAST_DEVICEINTERFACE_W *event_iface = (DEV_BROADCAST_DEVICEINTERFACE_W *)event; + if (filter_iface->dbcc_size == offsetof(DEV_BROADCAST_DEVICEINTERFACE_W, dbcc_classguid)) return TRUE; + return IsEqualGUID( &filter_iface->dbcc_classguid, &event_iface->dbcc_classguid ); + } + + FIXME( "Filter dbch_devicetype %u not implemented\n", filter->dbch_devicetype ); + return TRUE; +} + static DWORD WINAPI device_notify_proc( void *arg ) { WCHAR endpoint[] = L"\\pipe\\wine_plugplay"; @@ -2074,6 +2091,7 @@ static DWORD WINAPI device_notify_proc( void *arg ) for (i = 0; i < details_copy_nelems; i++) { + if (!notification_filter_matches( &details_copy[i].filter.header, (DEV_BROADCAST_HDR *)buf )) continue; details_copy[i].cb( details_copy[i].handle, code, (DEV_BROADCAST_HDR *)buf ); } MIDL_user_free(buf); @@ -2104,8 +2122,6 @@ HDEVNOTIFY WINAPI I_ScRegisterDeviceNotification( struct device_notification_det TRACE("callback %p, handle %p, filter %p, flags %#x\n", details->cb, details->handle, filter, flags); - if (filter) FIXME("Notification filters are not yet implemented.\n"); - if (!(registration = heap_alloc(sizeof(struct device_notify_registration)))) { SetLastError(ERROR_NOT_ENOUGH_MEMORY); -- 2.34.1
Hi, While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=104461 Your paranoid android. === w7u_2qxl (32 bit report) === dinput8: hid.c:10172: Test failed: got error 1066 hid.c:10180: Test failed: got error 1066 hid.c:10188: Test failed: got error 1066 hid.c:10196: Test failed: got error 1066 hid.c:10204: Test failed: got error 1066 hid.c:10224: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10265: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10303: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid: Timeout === w7u_el (32 bit report) === dinput8: hid.c:10172: Test failed: got error 1066 hid.c:10180: Test failed: got error 1066 hid.c:10188: Test failed: got error 1066 hid.c:10196: Test failed: got error 1066 hid.c:10204: Test failed: got error 1066 hid.c:10224: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10265: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10303: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid: Timeout === w8 (32 bit report) === dinput8: driver_hid.c:236: Test failed: id 1: hid.c:9255 got spurious packet driver_hid.c:593: Test failed: id 1: hid.c:9255 expect[0]: got 0xb000f, expected 0 driver_hid.c:594: Test failed: id 1: hid.c:9255 expect[0]: got id 6 driver_hid.c:595: Test failed: id 1: hid.c:9255 expect[0]: got len 2 === w864 (64 bit report) === dinput8: hid.c:10224: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10265: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10303: Test failed: Timeout while waiting for WM_DEVICECHANGE message. === w1064v1507 (64 bit report) === dinput8: hid.c:10224: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10265: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10303: Test failed: Timeout while waiting for WM_DEVICECHANGE message. === w1064v1809 (64 bit report) === dinput8: hid.c:10224: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10265: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10303: Test failed: Timeout while waiting for WM_DEVICECHANGE message. === w1064 (64 bit report) === dinput8: hid.c:10224: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10265: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10303: Test failed: Timeout while waiting for WM_DEVICECHANGE message. === w1064_2qxl (64 bit report) === dinput8: hid.c:10224: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10265: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10303: Test failed: Timeout while waiting for WM_DEVICECHANGE message. === w10pro64 (64 bit report) === dinput8: hid.c:10224: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10265: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10303: Test failed: Timeout while waiting for WM_DEVICECHANGE message. === w10pro64_ar (64 bit report) === dinput8: hid.c:10224: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10265: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10303: Test failed: Timeout while waiting for WM_DEVICECHANGE message. === w10pro64_he (64 bit report) === dinput8: hid.c:10224: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10265: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10303: Test failed: Timeout while waiting for WM_DEVICECHANGE message. === w10pro64_ja (64 bit report) === dinput8: hid.c:10224: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10265: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10303: Test failed: Timeout while waiting for WM_DEVICECHANGE message. === w10pro64_zh_CN (64 bit report) === dinput8: hid.c:10224: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10265: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10303: Test failed: Timeout while waiting for WM_DEVICECHANGE message.
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> --- dlls/dinput8/tests/hid.c | 2 -- dlls/ntoskrnl.exe/pnp.c | 8 +++++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index 431dadcb348..03c3ac20905 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -10012,14 +10012,12 @@ static LRESULT CALLBACK devnotify_wndproc( HWND hwnd, UINT msg, WPARAM wparam, L debugstr_guid( &iface->dbcc_classguid ) ); ok( iface->dbcc_size >= offsetof( DEV_BROADCAST_DEVICEINTERFACE_W, dbcc_name[wcslen( iface->dbcc_name ) + 1] ), "got dbcc_size %u\n", iface->dbcc_size ); - todo_wine ok( !wcsncmp( iface->dbcc_name, expect_prefix, wcslen( expect_prefix ) ), "got dbcc_name %s\n", debugstr_w(iface->dbcc_name) ); upper_end = wcschr( iface->dbcc_name + wcslen( expect_prefix ), '#' ); name_end = iface->dbcc_name + wcslen( iface->dbcc_name ) + 1; ok( !!upper_end, "got dbcc_name %s\n", debugstr_w(iface->dbcc_name) ); - todo_wine ok( all_upper( iface->dbcc_name, upper_end ), "got dbcc_name %s\n", debugstr_w(iface->dbcc_name) ); ok( all_lower( upper_end, name_end ), "got dbcc_name %s\n", debugstr_w(iface->dbcc_name) ); diff --git a/dlls/ntoskrnl.exe/pnp.c b/dlls/ntoskrnl.exe/pnp.c index 6d53d79267e..3aa2db46ff0 100644 --- a/dlls/ntoskrnl.exe/pnp.c +++ b/dlls/ntoskrnl.exe/pnp.c @@ -698,11 +698,11 @@ NTSTATUS WINAPI IoSetDeviceInterfaceState( UNICODE_STRING *name, BOOLEAN enable size_t namelen = name->Length / sizeof(WCHAR); DEV_BROADCAST_DEVICEINTERFACE_W *broadcast; + WCHAR *path, *refstr, *p, *upper_end; struct device_interface *iface; HANDLE iface_key, control_key; OBJECT_ATTRIBUTES attr = {0}; struct wine_rb_entry *entry; - WCHAR *path, *refstr, *p; UNICODE_STRING string; DWORD data = enable; NTSTATUS ret; @@ -788,6 +788,12 @@ NTSTATUS WINAPI IoSetDeviceInterfaceState( UNICODE_STRING *name, BOOLEAN enable broadcast->dbcc_classguid = iface->interface_class; lstrcpynW( broadcast->dbcc_name, name->Buffer, namelen + 1 ); if (namelen > 1) broadcast->dbcc_name[1] = '\\'; + + upper_end = wcschr( broadcast->dbcc_name, '#' ); + if (upper_end) upper_end = wcschr( upper_end + 1, '#' ); + while (upper_end && upper_end-- != broadcast->dbcc_name) + *upper_end = towupper( *upper_end ); + send_devicechange( enable ? DBT_DEVICEARRIVAL : DBT_DEVICEREMOVECOMPLETE, broadcast, len ); heap_free( broadcast ); } -- 2.34.1
Hi, While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=104462 Your paranoid android. === w7u_2qxl (32 bit report) === dinput8: hid.c:10170: Test failed: got error 1066 hid.c:10178: Test failed: got error 1066 hid.c:10186: Test failed: got error 1066 hid.c:10194: Test failed: got error 1066 hid.c:10202: Test failed: got error 1066 hid.c:10222: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10263: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10301: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid: Timeout === w7u_el (32 bit report) === dinput8: hid.c:10170: Test failed: got error 1066 hid.c:10178: Test failed: got error 1066 hid.c:10186: Test failed: got error 1066 hid.c:10194: Test failed: got error 1066 hid.c:10202: Test failed: got error 1066 hid.c:10222: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10263: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10301: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid: Timeout === w864 (64 bit report) === dinput8: hid.c:10222: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10263: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10301: Test failed: Timeout while waiting for WM_DEVICECHANGE message. === w1064v1507 (64 bit report) === dinput8: hid.c:10222: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10263: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10301: Test failed: Timeout while waiting for WM_DEVICECHANGE message. === w1064v1809 (64 bit report) === dinput8: hid.c:10222: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10263: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10301: Test failed: Timeout while waiting for WM_DEVICECHANGE message. === w1064 (64 bit report) === dinput8: hid.c:10222: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10263: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10301: Test failed: Timeout while waiting for WM_DEVICECHANGE message. === w1064_2qxl (64 bit report) === dinput8: hid.c:10222: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10263: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10301: Test failed: Timeout while waiting for WM_DEVICECHANGE message. === w10pro64 (64 bit report) === dinput8: hid.c:10222: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10263: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10301: Test failed: Timeout while waiting for WM_DEVICECHANGE message. === w10pro64_ar (64 bit report) === dinput8: hid.c:10222: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10263: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10301: Test failed: Timeout while waiting for WM_DEVICECHANGE message. === w10pro64_he (64 bit report) === dinput8: hid.c:10222: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10263: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10301: Test failed: Timeout while waiting for WM_DEVICECHANGE message. === w10pro64_ja (64 bit report) === dinput8: hid.c:10222: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10263: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10301: Test failed: Timeout while waiting for WM_DEVICECHANGE message. === w10pro64_zh_CN (64 bit report) === dinput8: hid.c:10222: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10263: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10301: Test failed: Timeout while waiting for WM_DEVICECHANGE message.
On 12/24/21 15:49, Rémi Bernon wrote:
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> --- dlls/dinput8/tests/hid.c | 388 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 388 insertions(+)
The implementation is maybe a bit much for the code freeze, but the tests are probably worth having. -- Rémi Bernon <rbernon(a)codeweavers.com>
On 12/24/21 15:51, Rémi Bernon wrote:
On 12/24/21 15:49, Rémi Bernon wrote:
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> --- dlls/dinput8/tests/hid.c | 388 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 388 insertions(+)
The implementation is maybe a bit much for the code freeze, but the tests are probably worth having.
Nevermind, even the tests look more problematic than anticipated. WM_DEVICECHANGE takes some time on Windows too, so we'll probably have to fix rpcss.exe startup order on new prefixes first to get rid of that corner case. -- Rémi Bernon <rbernon(a)codeweavers.com>
Hi, While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=104458 Your paranoid android. === w7u_2qxl (32 bit report) === dinput8: hid.c:10184: Test failed: got error 1066 hid.c:10195: Test failed: got error 1066 hid.c:10206: Test failed: got error 1066 hid.c:10217: Test failed: got error 1066 hid.c:10228: Test failed: got error 1066 hid.c:10250: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10292: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10330: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid: Timeout === w7u_el (32 bit report) === dinput8: hid.c:10184: Test failed: got error 1066 hid.c:10195: Test failed: got error 1066 hid.c:10206: Test failed: got error 1066 hid.c:10217: Test failed: got error 1066 hid.c:10228: Test failed: got error 1066 hid.c:10250: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10292: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10330: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid: Timeout === w8 (32 bit report) === dinput8: hid.c:4455: Test failed: Acquire returned: 0x80070005 hid.c:4457: Test failed: SetCooperativeLevel returned: 0 hid.c:4459: Test failed: Unacquire returned: 0x1 === w864 (64 bit report) === dinput8: hid.c:10250: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10292: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10330: Test failed: Timeout while waiting for WM_DEVICECHANGE message. === w1064v1507 (64 bit report) === dinput8: hid.c:10250: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10292: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10330: Test failed: Timeout while waiting for WM_DEVICECHANGE message. === w1064v1809 (64 bit report) === dinput8: hid.c:10250: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10292: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10330: Test failed: Timeout while waiting for WM_DEVICECHANGE message. === w1064 (64 bit report) === dinput8: hid.c:10250: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10292: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10330: Test failed: Timeout while waiting for WM_DEVICECHANGE message. === w1064_2qxl (64 bit report) === dinput8: hid.c:10250: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10292: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10330: Test failed: Timeout while waiting for WM_DEVICECHANGE message. === w10pro64 (64 bit report) === dinput8: hid.c:10250: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10292: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10330: Test failed: Timeout while waiting for WM_DEVICECHANGE message. === w10pro64_ar (64 bit report) === dinput8: hid.c:10250: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10292: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10330: Test failed: Timeout while waiting for WM_DEVICECHANGE message. === w10pro64_he (64 bit report) === dinput8: hid.c:10250: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10292: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10330: Test failed: Timeout while waiting for WM_DEVICECHANGE message. === w10pro64_ja (64 bit report) === dinput8: hid.c:10250: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10292: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10330: Test failed: Timeout while waiting for WM_DEVICECHANGE message. === w10pro64_zh_CN (64 bit report) === dinput8: hid.c:10250: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10292: Test failed: Timeout while waiting for WM_DEVICECHANGE message. hid.c:10330: Test failed: Timeout while waiting for WM_DEVICECHANGE message.
participants (2)
-
Marvin -
Rémi Bernon