Elizabeth Figura (@zfigura) commented about dlls/ntoskrnl.exe/pnp.c:
- if (notification->NameBufferOffset != -1 && notification->CustomDataBuffer[custom_buf_size - 1] != '\0')
data_size++;
- event_handle = heap_alloc_zero( offsetof( DEV_BROADCAST_HANDLE, dbch_data[data_size] ) );
- if (!event_handle)
- {
heap_free( name_info );
return STATUS_NO_MEMORY;
- }
- event_handle->dbch_size = offsetof( DEV_BROADCAST_HANDLE, dbch_data[data_size] );
- event_handle->dbch_devicetype = DBT_DEVTYP_HANDLE;
- event_handle->dbch_eventguid = notification->Event;
- event_handle->dbch_nameoffset = notification->NameBufferOffset;
- memcpy( event_handle->dbch_data, notification->CustomDataBuffer, custom_buf_size );
- if (notification->NameBufferOffset != -1 && notification->CustomDataBuffer[custom_buf_size - 1] != '\0')
notification->CustomDataBuffer[custom_buf_size++] = '\0';
I think you meant to modify dbch_data here?