From 75850abcbbad5d37416044d4a1be432770f1cad1 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sat, 30 Dec 2017 11:45:03 +0100 Subject: [PATCH] [NTOS] Use KeClearEvent instead of KeResetEvent where the previous state is not needed. --- ntoskrnl/fstub/disksup.c | 6 +++--- ntoskrnl/io/iomgr/rawfs.c | 2 +- ntoskrnl/lpc/reply.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ntoskrnl/fstub/disksup.c b/ntoskrnl/fstub/disksup.c index 62986aed4b4..ef5630d0ee2 100644 --- a/ntoskrnl/fstub/disksup.c +++ b/ntoskrnl/fstub/disksup.c @@ -1014,7 +1014,7 @@ HalpGetFullGeometry(IN PDEVICE_OBJECT DeviceObject, } /* Reset event */ - KeResetEvent(Event); + KeClearEvent(Event); /* Call the driver and check if it's pending */ Status = IoCallDriver(DeviceObject, Irp); @@ -1847,7 +1847,7 @@ xHalIoSetPartitionInformation(IN PDEVICE_OBJECT DeviceObject, do { /* Reset the event since we reuse it */ - KeResetEvent(&Event); + KeClearEvent(&Event); /* Build the read IRP */ Irp = IoBuildSynchronousFsdRequest(IRP_MJ_READ, @@ -1912,7 +1912,7 @@ xHalIoSetPartitionInformation(IN PDEVICE_OBJECT DeviceObject, PartitionDescriptor->PartitionType = (UCHAR)PartitionType; /* Reset the reusable event */ - KeResetEvent(&Event); + KeClearEvent(&Event); /* Build the write IRP */ Irp = IoBuildSynchronousFsdRequest(IRP_MJ_WRITE, diff --git a/ntoskrnl/io/iomgr/rawfs.c b/ntoskrnl/io/iomgr/rawfs.c index 8ade9a7db5c..062c1fb42ee 100644 --- a/ntoskrnl/io/iomgr/rawfs.c +++ b/ntoskrnl/io/iomgr/rawfs.c @@ -833,7 +833,7 @@ RawQueryFsSizeInfo(IN PVCB Vcb, else { /* Setup query IRP */ - KeResetEvent(&Event); + KeClearEvent(&Event); Irp = IoBuildDeviceIoControlRequest(IOCTL_DISK_GET_PARTITION_INFO, RealDevice, NULL, diff --git a/ntoskrnl/lpc/reply.c b/ntoskrnl/lpc/reply.c index d9fa834be0d..8454754c3aa 100644 --- a/ntoskrnl/lpc/reply.c +++ b/ntoskrnl/lpc/reply.c @@ -608,7 +608,7 @@ NtReplyWaitReceivePortEx(IN HANDLE PortHandle, if (ReceivePort->Flags & LPCP_WAITABLE_PORT) { /* Reset its event */ - KeResetEvent(&ReceivePort->WaitEvent); + KeClearEvent(&ReceivePort->WaitEvent); } /* Release the lock and fail */ @@ -630,7 +630,7 @@ NtReplyWaitReceivePortEx(IN HANDLE PortHandle, if (ReceivePort->Flags & LPCP_WAITABLE_PORT) { /* Reset its event */ - KeResetEvent(&ReceivePort->WaitEvent); + KeClearEvent(&ReceivePort->WaitEvent); } } -- 2.17.1