MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / hid_internal_get_devnode_property

Function hid_internal_get_devnode_property

lib/hidapi/windows/hid.c:382–401  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

380}
381
382static 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
403static void* hid_internal_get_device_interface_property(const wchar_t* interface_path, const DEVPROPKEY* property_key, DEVPROPTYPE expected_property_type)
404{

Callers 3

hid_internal_get_infoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected