From f3af65b0079db68ff5059b66e4fd4e1c76d33b0b Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Wed, 25 Dec 2024 17:58:12 +0100 Subject: Windows driver: Use IO_DISK_INCREMENT for event signaling in IRP completion routine This provides a slight priority boost for waiting threads and maintains standard practice for disk device drivers. --- src/Driver/EncryptedIoQueue.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Driver/EncryptedIoQueue.c') diff --git a/src/Driver/EncryptedIoQueue.c b/src/Driver/EncryptedIoQueue.c index de843339..de1e4fdc 100644 --- a/src/Driver/EncryptedIoQueue.c +++ b/src/Driver/EncryptedIoQueue.c @@ -327,7 +327,7 @@ static VOID CompleteIrpWorkItemRoutine(PDEVICE_OBJECT DeviceObject, PVOID Contex // If no active work items remain, signal the event if (InterlockedDecrement(&queue->ActiveWorkItems) == 0) { - KeSetEvent(&queue->NoActiveWorkItemsEvent, IO_NO_INCREMENT, FALSE); + KeSetEvent(&queue->NoActiveWorkItemsEvent, IO_DISK_INCREMENT, FALSE); } // Return the work item to the free list @@ -336,7 +336,7 @@ static VOID CompleteIrpWorkItemRoutine(PDEVICE_OBJECT DeviceObject, PVOID Contex KeReleaseSpinLock(&queue->WorkItemLock, oldIrql); // Release the semaphore to signal that a work item is available - KeReleaseSemaphore(&queue->WorkItemSemaphore, IO_NO_INCREMENT, 1, FALSE); + KeReleaseSemaphore(&queue->WorkItemSemaphore, IO_DISK_INCREMENT, 1, FALSE); // Free the item ReleasePoolBuffer(queue, item); -- cgit v1.2.3