[DRIVERS] Use KeClearEvent instead of KeResetEvent where the previous state is not...
authorThomas Faber <thomas.faber@reactos.org>
Sat, 30 Dec 2017 10:44:25 +0000 (11:44 +0100)
committerThomas Faber <thomas.faber@reactos.org>
Sat, 30 Dec 2017 10:44:25 +0000 (11:44 +0100)
drivers/filters/mountmgr/mountmgr.c
drivers/hid/kbdhid/kbdhid.c
drivers/hid/mouhid/mouhid.c
drivers/input/sermouse/readmouse.c
drivers/network/ndis/ndis/control.c
drivers/network/ndis/ndis/io.c
drivers/usb/usbhub_new/usbhub.c
drivers/usb/usbport/usbport.c
drivers/wdm/audio/legacy/stream/pnp.c

index 54487a4..1852dfc 100644 (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,
index 4b240a4..bacf72a 100644 (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);
index 193cf79..0450909 100644 (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);
index 6142e9b..7526af1 100644 (file)
@@ -137,7 +137,7 @@ SermouseDeviceWorker(
                if (Status != STATUS_TIMEOUT)
                {
                        /* we need to stop the worker thread */
-                       KeResetEvent(&DeviceExtension->StopWorkerThreadEvent);
+                       KeClearEvent(&DeviceExtension->StopWorkerThreadEvent);
                        break;
                }
 
index 614bf39..7aa51ef 100644 (file)
@@ -261,7 +261,7 @@ NdisResetEvent(
  *     Event = Pointer to the initialized event object to be reset
  */
 {
-  KeResetEvent(&Event->Event);
+  KeClearEvent(&Event->Event);
 }
 
 
index faee64a..1775716 100644 (file)
@@ -416,7 +416,7 @@ NdisMAllocateMapRegisters(
 
       NDIS_DbgPrint(MAX_TRACE, ("resetting event\n"));
 
-      KeResetEvent(&AllocationEvent);
+      KeClearEvent(&AllocationEvent);
     }
 
   NDIS_DbgPrint(MAX_TRACE, ("returning success\n"));
index ab60b45..354e286 100644 (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;
     }
index ad421d4..0928646 100644 (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");
 
index 67f1878..b8814cd 100644 (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);