[ofw] [RFC] [PATCH 1/2 v3] work_queue: abstraction to manage small pool of work items

Sean Hefty sean.hefty at intel.com
Tue May 26 21:03:24 PDT 2009


>Isn't this a wee bit dangerous w.r.t. to a future time bomb to use
>IRP.Tail.Overlay.DriverContext?
>Did you not state that MS has claimed the field IRP.Tail.Overlay.DriverContext
>for future use; although it's not used today?
>What did I miss?

IRP.Tail.Overlay.DriverContext is available for driver use, and probably can't
go away without breaking a lot of existing drivers.  (See the WDK docs for IRP.)

The issue is that the WDM framework uses this field.  Drivers using the WDF get
WDFREQUESTs instead of the IRPs that most drivers get, with the request
referencing the underlying IRP location in the stack.  When the IRP gets passed
down the stack, a lower-level driver is free to overwrite the DriverContext
field, so the WDF documentation is likely a little overzealous here.

Additionally, the Tail.Overlay structure is a union, which DriverContext is one
of the members.  The documentation only refers to the DriverContext field, and
not the other union members, which makes it seem like the other union fields are
available.  (DriverContext is an array and the largest accessible union member;
it's possible that the WDF only uses the last entry in the array.)

So, yes, it _could_ be a time bomb.  It could also just be a documentation error
(or something just too confusing to write).  The documentation is at least off
by either not reserving the entire union, reserving other union fields, or
allowing a portion of the DriverContext array to be used.

- Sean




More information about the ofw mailing list