FsContext use by non-PnP and non-FS driver

The doc for FILE_OBJECT only talks about FsContext for file system drivers and those with FDO (which I assume means a PnP driver). But what about WDM drivers that are neither file system nor PnP? This WDM sample driver uses FsContext to store its own data structure but it ASSERT's that FsContext is NULL before setting it. Can a top level driver that does not forward IRPs use FsContext with confidence that nothing else is using it or would use it?

Your driver owns the fscontexts.

1 Like

Hi Marc,

Our plain WDM Audio driver (not based on WDF as the one in the samples) uses the FsContext2 field because when we tried to use the FsContext field it completly messed up the WDM Audio framework. In fact, the FsContext field is used by the WDM Audio framwork for own needs. So you can use the FsContext2 field which is available.

Regards,
Eric.