I have several USB capture devices made obsolete/legacy by newer Windows OSes. They date back to the Windows XP era and are still working. As I hate throwing away hardware just because software obsoletes it, I decided to make them work under Windows 10. This is a non profit project and once a bit more mature I intend to host it in github.
One way to achieve my goal was to write a device driver. I never wrote any (or may be once Win98 era, a VxD). So I have no experience with this. Furthermore even if I write one, it will probably never be officially signed and I do not want my machine to be running under test signing mode.
So I took another path. I wrote a Win32 app that loads the official XP device driver in userspace - "manually" loading the respective sys file kind of like a dll, resolving the imports and running the necessary code (driverentry, posting IRPs, etc). Of course "resolving the imports" is actually providing my implementation of a multitude of functions from ntoskrnl, ks, hal, usbd and bda. Then my Win32 app uses libusb to pass-through the driver calls to the actual USB device hardware. So far so good. A 600Kb exe file with 15Mb memory consumption and I succesfully receive and render MJPG and YUY2 frames from the various devices. So VideoDecoder, Crossbar, Tuner etc work properly.
I started to extend the app and want to provide various videoprocamp settings. So far I am up to browsing the KSPROPERTY_SET and the possible values.
First about the MS KSPROPERTY_MEMBERSHEADER docs. The descriptions of MembersFlags and Flags are the same which I think is wrong.
Then when looking at two drivers, both set MembersFlags to 1 (which according to ks.h is KSPROPERTY_MEMBER_RANGES), MembersSize is 16, but the actual members list structure is of type KSPROPERTY_STEPPING_LONG and not KSPROPERTY_BOUNDS_LONG.
One of the drivers is this AVerMedia A827A (to find it search the ms catalog for 3caa9e44-deb4-40b6-8e1e-0fb7d5f79529), signed. Strangely the driver comes with a PDB file. For the contrast videoprocamp it has the ContrastMembersList at offset 40C88 which starts with a MembersFlags value of 1 then at offset 40C98 points to the MembersList structure named ContrastRangeAndStep of type KSPROPERTY_STEPPING_LONG.
So my question - what is wrong? Or what am I interpreting wrong? Is it the ks.h defining wrong constant values for KSPROPERTY_MEMBER_RANGES and KSPROPERTY_MEMBER_STEPPEDRANGES or are the drivers wrongly defining the MembersFlags? Still under XP the property pages for the videoprocamp work fine - so AVStream interpretes the correctly. Or are the docs completly messed up - looking at the 1394dcam sample code (for example the BrightnessMembersList) it is defined just as in the two drivers - KSPROPERTY_MEMBER_RANGES and KSPROPERTY_STEPPING_LONG structure type.
Thank you!
PS. It seems I cannot include links with my posts - so I cannot give a reference to the respective docs and downloads.