You don’t need to delete the event, it is reusable. The bigger question is why you are not using WdfRequestSend instead of messing with the raw IRP’s?
Don Burn
Windows Driver Consulting
Website: http://www.windrvr.com
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Randy Lewis
Sent: Saturday, March 19, 2016 11:50 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Does a KMDF driver need to delete a KEVENT that it creates?
I create an event for use in a synchronous request to a device. The following is the pertinent code:
KEVENT event;
IO_STATUS_BLOCK iosb;
KeInitializeEvent(&event, NotificationEvent, FALSE);
irp = IoBuildSynchronousFsdRequest(IRP_MJ_READ, DEVICE_OBJ, readBuffer, 17, 0, &event, &iosb);
timeout.QuadPart = Int32x32To64(-1, 1000 * 100 * 10); // should be 0.1 sec (relative)
KeWaitForSingleObject(&event, Executive, KernelMode, FALSE, &timeout);
Do I need to delete this event after completion of the request or can it be reused each time the associated function is called?
Randy
— NTDEV is sponsored by OSR Visit the list online at: MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers! Details at To unsubscribe, visit the List Server section of OSR Online at