Related question then, do we have tests that the filter applies to properties that weren't requested?
Yes, this one: https://gitlab.winehq.org/wine/wine/-/blob/c495af87400e5b3f978ebfb06ec53ded2...
I have added additional code to make sure that no properties have actually been fetched as well.
What about, instead of having to optionally cache all properties for filtering even when only some were requested, always request all properties here, then hide the undesired ones before the callback? This could be made efficient by keeping undesired properties at the end of the array and changing obj.cPropertyCount.
The latest revision does this, but also sorts the properties by their `DEVPROPCOMPKEY *` value to make filter evaluation a little more performant. I don't know of any applications that rely on the order of the property keys, so it shouldn't affect compatibility.