[ofw] WDFREQUEST seeking IRP DriverContext for short-term commitment

Sean Hefty sean.hefty at intel.com
Tue May 26 13:18:39 PDT 2009


I found the following restriction regarding IRP context usage:

	http://msdn.microsoft.com/en-us/library/aa490306.aspx

	WDM Interface Restrictions

	If your framework-based driver accesses WDM interfaces, you
	must be aware of the following restrictions:

	* Framework-based drivers must not use the Tail.Overlay.DriverContext
	  member of the IRP structure, because the framework uses this member.

Last Friday, I modified winverbs to use this structure and ran over the week-end
without any noticeable problems.  I found this same restriction listed under
WdfRequestCreateFromIrp, but not other calls, which makes me question how strict
this rule is.

The DriverContext isn't kept as the IRP travels the stack, so I would think that
as long as the framework doesn't 'own' the IRP, it should be safe to use the
DriverContext.  And I assume that ownership of the IRP is transferred away from
the framework after a successful call to WdfIoQueueRetrieveNextRequest.

Does anyone have any idea if this is a correct assumption?




More information about the ofw mailing list