|
From: Alex F on 19 Apr 2008 07:57 IN KMDF driver, I have KEVENT member of DEVICE_CONTEXT. It is initialized in EvtDevicePrepareHardware function: KeInitializeEvent(&pDeviceContext->MyEvent, NotificationEvent, FALSE); I think that I must release it in the EvtDeviceReleaseHardware function, what function should be used for this?
From: Don Burn on 19 Apr 2008 08:26 There is no converse for Initialize for Events or other Ke objects these Initialize calls are just set the memory that was already allocated to an initial state. Note: Ex calls do have a Delete call for their resources, but those are a higher level abstraction. -- Don Burn (MVP, Windows DDK) Windows 2k/XP/2k3 Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr Remove StopSpam to reply "Alex F" <AlexF(a)discussions.microsoft.com> wrote in message news:71904F11-37D0-4762-9A4F-D05A13048A96(a)microsoft.com... > IN KMDF driver, I have KEVENT member of DEVICE_CONTEXT. It is initialized > in > EvtDevicePrepareHardware function: > > KeInitializeEvent(&pDeviceContext->MyEvent, NotificationEvent, FALSE); > > I think that I must release it in the EvtDeviceReleaseHardware function, > what function should be used for this?
From: Alex F on 19 Apr 2008 09:27 Thank you. Does this mean that only allocation in my case is done by framework which creates DEVICE_CONTEXT with KEVENT member? Though I call KeInitializeEvent every time EvtDevicePrepareHardware and don't release anything in EvtDeviceReleaseHardware, this doesn't create memory and resource leak. Sorry for annoying questions, but this is not described in documentation, and I want to understand this.
From: Don Burn on 19 Apr 2008 09:32 Yes, you have the gist of it. You allocate the space for the event or other Ke object where you want to and free it as appropriate. KeInitializeEvent call is only for the initialization of the already allocated memory. -- Don Burn (MVP, Windows DDK) Windows 2k/XP/2k3 Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr Remove StopSpam to reply "Alex F" <AlexF(a)discussions.microsoft.com> wrote in message news:62E95052-0DC0-4756-BAD5-6F86CAB6A46E(a)microsoft.com... > Thank you. Does this mean that only allocation in my case is done by > framework which creates DEVICE_CONTEXT with KEVENT member? Though I call > KeInitializeEvent every time EvtDevicePrepareHardware and don't release > anything in EvtDeviceReleaseHardware, this doesn't create memory and > resource > leak. > Sorry for annoying questions, but this is not described in documentation, > and I want to understand this.
From: Alex F on 19 Apr 2008 10:00
Thank you. |