Elizabeth Figura (@zfigura) commented about dlls/ntoskrnl.exe/pnp.c:
- }
- 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';
- memcpy( &event_handle->dbch_data[custom_buf_size], name_info->Name.Buffer,
name_info->Name.Length * sizeof( WCHAR ) + 1);
- event_handle->dbch_reserved = custom_buf_size;
- heap_free( name_info );
- /* TODO: Note that this is not really synchronous. This will merely queue up an event in the
* plugplay service, which will be asynchronously broadcast to all listeners. */
Hmm. I know where this TODO is coming from, but is it really meaningful right now? The documentation suggests that the sync/async difference is meaningful for kernel-level listeners [i.e. IoRegisterPlugPlayNotification()], but the test suggests that the window message is sent asynchronously to userspace even for the synchronous function.