I’ve been spending time looking at Custom WDF Object Types and Framework Class Extensions recently.
It’s all good, except for one striking omission: There does not seem to be any way to:
- Validate that a given Handle is, in fact, a valid WDF Object Handle
- Determine the type of a WDF Object given its handle… or alternatively, validate that a given handle is associated with a specific Object type
I will be the first to admit that it’s taken me 15 years to discover this “deficiency” – But we’ve only been able to write Class Extensions since Windows 8. And that’s what most particularly drives this need.
One would have thought that, when adding support for creating Custom WDF Object Types (which are basically just child objects of another WDF Object Type), the WDF devs would have taken inspiration from ObReferenceObjectByHandle. Which is basically exactly what I want.
What’s the established programming pattern here? Am I missing something really obvious?
Peter