[NTOSKRNL]
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Thu, 26 Aug 2010 15:25:33 +0000 (15:25 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Thu, 26 Aug 2010 15:25:33 +0000 (15:25 +0000)
- Fix to PpSetCustomTargetEvent(), not to make caller wait forever in case it provided an event it waits for
- Patch by Pierre Schweitzer

svn path=/trunk/; revision=48626

reactos/ntoskrnl/io/pnpmgr/pnpreport.c

index 18d75ab..165b0b0 100644 (file)
@@ -132,12 +132,25 @@ PpSetCustomTargetEvent(IN PDEVICE_OBJECT DeviceObject,
     ASSERT(NotificationStructure != NULL);
     ASSERT(DeviceObject != NULL);
 
     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);
     /* 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;
 }
 
     return STATUS_SUCCESS;
 }