| 243 | } |
| 244 | |
| 245 | bool CDShowHelper::EnumDevice(const GUID &type, IMoniker *deviceInfo, |
| 246 | IBaseFilter** outfilter, const wchar_t *name, const wchar_t *path) |
| 247 | { |
| 248 | IPropertyBag* propertyData = nullptr; |
| 249 | IBaseFilter* filter = nullptr; |
| 250 | HRESULT hr; |
| 251 | |
| 252 | hr = deviceInfo->BindToStorage(0, 0, IID_IPropertyBag, |
| 253 | (void**)&propertyData); |
| 254 | if (FAILED(hr)) |
| 255 | return true; |
| 256 | |
| 257 | VARIANT deviceName, devicePath; |
| 258 | deviceName.vt = VT_BSTR; |
| 259 | devicePath.vt = VT_BSTR; |
| 260 | devicePath.bstrVal = NULL; |
| 261 | |
| 262 | hr = propertyData->Read(L"FriendlyName", &deviceName, NULL); |
| 263 | if (FAILED(hr)) |
| 264 | return true; |
| 265 | |
| 266 | |
| 267 | propertyData->Read(L"DevicePath", &devicePath, NULL); |
| 268 | |
| 269 | hr = deviceInfo->BindToObject(NULL, 0, IID_IBaseFilter, |
| 270 | (void**)&filter); |
| 271 | if (SUCCEEDED(hr)) { |
| 272 | if (deviceName.bstrVal && name && wcscmp(name, deviceName.bstrVal) != 0) |
| 273 | return true; |
| 274 | |
| 275 | // if (!devicePath.bstrVal || wcscmp(path, devicePath.bstrVal) != 0) |
| 276 | // return true; |
| 277 | |
| 278 | *outfilter = filter; |
| 279 | return false; |
| 280 | } |
| 281 | |
| 282 | return true; |
| 283 | } |
| 284 | |
| 285 | bool CDShowHelper::EnumDevices(const GUID &type, IBaseFilter** outFilter, const wchar_t *name, const wchar_t *path) |
| 286 | { |
nothing calls this directly
no outgoing calls
no test coverage detected