I create work item using WdfWorkItemCreate, and set device as its parent object. According to WDK help, the framework will delete the work-item object when it deletes the device object, so I don’t need to call WdfObjectDelete.
However, if I client calls many requests creating work items, they remain alive until device is unloaded. I want to prevent this, deleting work item myself:
WdfObjectDelete(WorkItem); // in the end of work item callback
Is this correct?
Yes, that is correct.
d
Sent from my phone with no t9, all spilling mistakes are not intentional.
-----Original Message-----
From: xxxxx@yahoo.com
Sent: Sunday, February 22, 2009 6:11 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] WdfWorkItemCreate and WdfObjectDelete
I create work item using WdfWorkItemCreate, and set device as its parent object. According to WDK help, the framework will delete the work-item object when it deletes the device object, so I don’t need to call WdfObjectDelete.
However, if I client calls many requests creating work items, they remain alive until device is unloaded. I want to prevent this, deleting work item myself:
WdfObjectDelete(WorkItem); // in the end of work item callback
Is this correct?
—
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
One thing every KMDF dev should do is run
!wdfkd.wdfdriverinfo 0x290
Before and after your app has run (or after a period of activity where you have gone back to a somewhat idle state). it is very easy to “leak” objects until the WDFDEVICE is deleted and this command will show you all of the objects your driver has created. You should diff the before/after output to make sure you are not leaking objects. For instance on many OCA crash dumps that we analyze, we see drivers who leak driver allocated WDFREQUESTs at a rather regular clip and have 100s of them allocated but unused
d
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@yahoo.com
Sent: Sunday, February 22, 2009 11:01 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] WdfWorkItemCreate and WdfObjectDelete
Thanks.
—
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer