| 380 | } |
| 381 | |
| 382 | static void* hid_internal_get_devnode_property(DEVINST dev_node, const DEVPROPKEY* property_key, DEVPROPTYPE expected_property_type) |
| 383 | { |
| 384 | ULONG len = 0; |
| 385 | CONFIGRET cr; |
| 386 | DEVPROPTYPE property_type; |
| 387 | PBYTE property_value = NULL; |
| 388 | |
| 389 | cr = CM_Get_DevNode_PropertyW(dev_node, property_key, &property_type, NULL, &len, 0); |
| 390 | if (cr != CR_BUFFER_SMALL || property_type != expected_property_type) |
| 391 | return NULL; |
| 392 | |
| 393 | property_value = (PBYTE)calloc(len, sizeof(BYTE)); |
| 394 | cr = CM_Get_DevNode_PropertyW(dev_node, property_key, &property_type, property_value, &len, 0); |
| 395 | if (cr != CR_SUCCESS) { |
| 396 | free(property_value); |
| 397 | return NULL; |
| 398 | } |
| 399 | |
| 400 | return property_value; |
| 401 | } |
| 402 | |
| 403 | static void* hid_internal_get_device_interface_property(const wchar_t* interface_path, const DEVPROPKEY* property_key, DEVPROPTYPE expected_property_type) |
| 404 | { |
no outgoing calls
no test coverage detected