List of all MTP/PTP cameras with WPD

828 views Asked by At

For my application I need a list of all MTP/PTP cameras connected to the computer. I am generating a list of all WPD devices on the system with the following code:

...
hr = pPortableDeviceManager->GetDevices(pPnpDeviceIDs, &cPnPDeviceIDs);
if (SUCCEEDED(hr)) {
    for (dwIndex = 0; dwIndex < cPnPDeviceIDs; dwIndex++) {
        ...
    }
}

But this list also includes card readers, scanner and other devices. Is there an easy way to filter out those devices, or do I really need to open each device and fetch the device properties etc. ?

1

There are 1 answers

0
Ahmad On

see this page WPD Globally Unique Identifiers-GUIDs it Contains a lot of constants and declarations you can search for storage or camera ect