diff --git a/dlls/user32/winproc.c b/dlls/user32/winproc.c index b1193773ed2..7d53269dc80 100644 --- a/dlls/user32/winproc.c +++ b/dlls/user32/winproc.c @@ -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) */ diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index 28a2b7d39cc..56a05ba7eac 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -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;