Commit c489356d authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

ntoskrnl.exe: Enforce path case in WM_DEVICECHANGE notifications.

parent 439d126a
......@@ -201,14 +201,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) );
......
......@@ -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 );
}
......
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