[DRIVERS] Use KeClearEvent instead of KeResetEvent where the previous state is not needed.

This commit is contained in:
Thomas Faber 2017-12-30 11:44:25 +01:00
parent bad1c03529
commit 4f8379a02b
No known key found for this signature in database
GPG key ID: 076E7C3D44720826
9 changed files with 12 additions and 12 deletions

View file

@ -872,7 +872,7 @@ MountMgrUnload(IN struct _DRIVER_OBJECT *DriverObject)
NextEntry = RemoveHeadList(&(DeviceExtension->UniqueIdWorkerItemListHead));
WorkItem = CONTAINING_RECORD(NextEntry, UNIQUE_ID_WORK_ITEM, UniqueIdWorkerItemListEntry);
KeResetEvent(&UnloadEvent);
KeClearEvent(&UnloadEvent);
WorkItem->Event = &UnloadEvent;
KeReleaseSemaphore(&(DeviceExtension->DeviceLock), IO_NO_INCREMENT,

View file

@ -289,7 +289,7 @@ KbdHid_Create(
DeviceExtension->FileObject = IoStack->FileObject;
/* reset event */
KeResetEvent(&DeviceExtension->ReadCompletionEvent);
KeClearEvent(&DeviceExtension->ReadCompletionEvent);
/* initiating read */
Status = KbdHid_InitiateRead(DeviceExtension);

View file

@ -497,7 +497,7 @@ MouHid_Create(
DeviceExtension->FileObject = IoStack->FileObject;
/* reset event */
KeResetEvent(&DeviceExtension->ReadCompletionEvent);
KeClearEvent(&DeviceExtension->ReadCompletionEvent);
/* initiating read */
Status = MouHid_InitiateRead(DeviceExtension);

View file

@ -137,7 +137,7 @@ SermouseDeviceWorker(
if (Status != STATUS_TIMEOUT)
{
/* we need to stop the worker thread */
KeResetEvent(&DeviceExtension->StopWorkerThreadEvent);
KeClearEvent(&DeviceExtension->StopWorkerThreadEvent);
break;
}

View file

@ -261,7 +261,7 @@ NdisResetEvent(
* Event = Pointer to the initialized event object to be reset
*/
{
KeResetEvent(&Event->Event);
KeClearEvent(&Event->Event);
}

View file

@ -416,7 +416,7 @@ NdisMAllocateMapRegisters(
NDIS_DbgPrint(MAX_TRACE, ("resetting event\n"));
KeResetEvent(&AllocationEvent);
KeClearEvent(&AllocationEvent);
}
NDIS_DbgPrint(MAX_TRACE, ("returning success\n"));

View file

@ -2315,7 +2315,7 @@ USBH_ChangeIndication(IN PDEVICE_OBJECT DeviceObject,
if (InterlockedIncrement(&HubExtension->ResetRequestCount) == 1)
{
KeResetEvent(&HubExtension->ResetEvent);
KeClearEvent(&HubExtension->ResetEvent);
}
HubWorkItemBuffer->HubExtension = HubExtension;
@ -2415,7 +2415,7 @@ USBH_SubmitStatusChangeTransfer(IN PUSBHUB_FDO_EXTENSION HubExtension)
TRUE,
TRUE);
KeResetEvent(&HubExtension->StatusChangeEvent);
KeClearEvent(&HubExtension->StatusChangeEvent);
Status = IoCallDriver(HubExtension->LowerDevice, Irp);
@ -2915,7 +2915,7 @@ USBD_RegisterRootHubCallBack(IN PUSBHUB_FDO_EXTENSION HubExtension)
return STATUS_NOT_IMPLEMENTED;
}
KeResetEvent(&HubExtension->RootHubNotificationEvent);
KeClearEvent(&HubExtension->RootHubNotificationEvent);
return RootHubInitNotification(HubExtension->BusInterface.BusContext,
HubExtension,
@ -3828,7 +3828,7 @@ return; //HACK: delete it line after fixing Power Manager!!!
if (IsHubCheck &&
!(HubExtension->HubFlags & USBHUB_FDO_FLAG_WAIT_IDLE_REQUEST))
{
KeResetEvent(&HubExtension->IdleEvent);
KeClearEvent(&HubExtension->IdleEvent);
HubExtension->HubFlags |= USBHUB_FDO_FLAG_WAIT_IDLE_REQUEST;
IsHubIdle = TRUE;
}

View file

@ -1393,7 +1393,7 @@ USBPORT_WorkerThread(IN PVOID StartContext)
KeQuerySystemTime(&NewTime);
KeAcquireSpinLock(&FdoExtension->WorkerThreadEventSpinLock, &OldIrql);
KeResetEvent(&FdoExtension->WorkerThreadEvent);
KeClearEvent(&FdoExtension->WorkerThreadEvent);
KeReleaseSpinLock(&FdoExtension->WorkerThreadEventSpinLock, OldIrql);
DPRINT_CORE("USBPORT_WorkerThread: run \n");

View file

@ -413,7 +413,7 @@ StreamClassStartDevice(
/* Setup get stream info struct */
RequestBlock->Block.Command = SRB_GET_STREAM_INFO;
RequestBlock->Block.CommandData.StreamBuffer = StreamDescriptor;
KeResetEvent(&RequestBlock->Event);
KeClearEvent(&RequestBlock->Event);
/* send the request */
DriverObjectExtension->Data.HwReceivePacket((PHW_STREAM_REQUEST_BLOCK)RequestBlock);