I am trying to implement a win32 console application using C++ that takes an ON/OFF input for a specific camera which determines the state its torchlight. The camera is integrated to my laptop and the device description states its a USB Video Camera.
In my first attempts I tried researching the DirectShow and Media Foundation frameworks if they support such functionality, but from what I found - they do not.
I came to the conclusion that I must use DeviceIOControl to send a specific IOCTL control code to the device driver, indicating it to turn the light of the camera. The camera uses some common drivers like ksthunk.sys and usbvideo.sys but I am unable to find such control codes and from what I understood the only solution is to refer to the specific device documentation or contact the manufacturers for answers.
Yet this raises a question: How does .NET know which control code to send to the device?
The UWP class VideoDeviceController can turn the light of a camera using TorchControl and FlashControl and from what I researched this functionality does use DeviceIoControl.
Is there any other way to determine the control codes or my solution for the task is wrong?