1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 11:08:02 -06:00

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.
This commit is contained in:
Mounir IDRASSI
2024-12-25 17:58:12 +01:00
parent d9e17522ee
commit f3af65b007

View File

@@ -327,7 +327,7 @@ static VOID CompleteIrpWorkItemRoutine(PDEVICE_OBJECT DeviceObject, PVOID Contex
// If no active work items remain, signal the event // If no active work items remain, signal the event
if (InterlockedDecrement(&queue->ActiveWorkItems) == 0) 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 // Return the work item to the free list
@@ -336,7 +336,7 @@ static VOID CompleteIrpWorkItemRoutine(PDEVICE_OBJECT DeviceObject, PVOID Contex
KeReleaseSpinLock(&queue->WorkItemLock, oldIrql); KeReleaseSpinLock(&queue->WorkItemLock, oldIrql);
// Release the semaphore to signal that a work item is available // 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 // Free the item
ReleasePoolBuffer(queue, item); ReleasePoolBuffer(queue, item);