win32u: Use user message packing for WM_DEVICECHANGE.

This commit is contained in:
Jacek Caban 2023-07-19 00:35:31 +02:00 committed by Alexandre Julliard
parent c1a5b42cdc
commit 140f9e82f9
2 changed files with 11 additions and 3 deletions

View file

@ -851,10 +851,7 @@ BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lparam,
case WM_MOVING:
case CB_GETCOMBOBOXINFO:
case WM_MDIGETACTIVE:
break;
case WM_DEVICECHANGE:
if (!(*wparam & 0x8000)) return TRUE;
minsize = sizeof(DEV_BROADCAST_HDR);
break;
case WM_NOTIFY:
/* WM_NOTIFY cannot be sent across processes (MSDN) */

View file

@ -876,6 +876,10 @@ static BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lpa
if (!*lparam) return TRUE;
if (!get_buffer_space( buffer, sizeof(BOOL), size )) return FALSE;
break;
case WM_DEVICECHANGE:
if (!(*wparam & 0x8000)) return TRUE;
minsize = sizeof(DEV_BROADCAST_HDR);
break;
default:
return TRUE; /* message doesn't need any unpacking */
}
@ -1704,6 +1708,13 @@ size_t user_message_size( HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam,
case WM_MDIGETACTIVE:
if (lparam) size = sizeof(BOOL);
break;
case WM_DEVICECHANGE:
if ((wparam & 0x8000) && lparam)
{
const DEV_BROADCAST_HDR *header = lparam_ptr;
size = header->dbch_size;
}
break;
}
return size;