From e04ebf1980ce2cb806a7ccefa6644ff519cc5d7d Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 26 Aug 2010 15:25:33 +0000 Subject: [PATCH] [NTOSKRNL] - 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 | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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; }