diff --git a/reactos/ntoskrnl/io/pnpmgr/pnpreport.c b/reactos/ntoskrnl/io/pnpmgr/pnpreport.c index 18d75ab4eb7..165b0b06f59 100644 --- a/reactos/ntoskrnl/io/pnpmgr/pnpreport.c +++ b/reactos/ntoskrnl/io/pnpmgr/pnpreport.c @@ -132,12 +132,25 @@ PpSetCustomTargetEvent(IN PDEVICE_OBJECT DeviceObject, ASSERT(NotificationStructure != NULL); ASSERT(DeviceObject != NULL); + if (SyncEvent) + { + ASSERT(SyncStatus); + *SyncStatus = STATUS_PENDING; + } + /* That call is totally wrong but notifications handler must be fixed first */ IopNotifyPlugPlayNotification(DeviceObject, EventCategoryTargetDeviceChange, &GUID_PNP_CUSTOM_NOTIFICATION, NotificationStructure, NULL); + + if (SyncEvent) + { + KeSetEvent(SyncEvent, IO_NO_INCREMENT, FALSE); + *SyncStatus = STATUS_SUCCESS; + } + return STATUS_SUCCESS; }