My device is not exclusive and can have multiple file handles open. I
would like to store an integer that is unique to each file handle.
It seems the recommended method is to store the data in the
WDFFILEOBJECT's device context. However, when new data arrives from
my device, the driver needs to examine and potentially update each
integer that is unique to each file handle. Therefore, I need some
way to enumerate all open WDFFILEOBJECTS. Is this possible?
If not, my alternative would be to store a hash map or linked list
containing all of the WDFFILEOBJECT handles and their corresponding
integers. This map/list would be stored in the device context of my
Device Object and updated in EvtDeviceFileCreate and EvtFileCleanup
callbacks. Are there some built in data structures for hash maps or
linked lists that would be helpful for implementing this?
I'd prefer the first approach (enumerating the WDFFILEOBJECTs) so that
I can let the framework manage the map between file objects and
integer data. Any other solutions are welcomed.
Thanks,
Jonah