| 1103 | |
| 1104 | |
| 1105 | void HID_API_EXPORT HID_API_CALL hid_close(hid_device *device) |
| 1106 | { |
| 1107 | if ( device ) |
| 1108 | { |
| 1109 | LOGV( "hid_close id=%d", device->m_nId ); |
| 1110 | hid_mutex_guard r( &g_DevicesRefCountMutex ); |
| 1111 | LOGD("Decrementing device %d (%p), refCount = %d\n", device->m_nId, device, device->m_nDeviceRefCount - 1); |
| 1112 | if ( --device->m_nDeviceRefCount == 0 ) |
| 1113 | { |
| 1114 | hid_device_ref<CHIDDevice> pDevice = FindDevice( device->m_nId ); |
| 1115 | if ( pDevice ) |
| 1116 | { |
| 1117 | pDevice->Close( true ); |
| 1118 | } |
| 1119 | else |
| 1120 | { |
| 1121 | delete device; |
| 1122 | } |
| 1123 | LOGD("Deleted device %p\n", device); |
| 1124 | } |
| 1125 | } |
| 1126 | } |
| 1127 | |
| 1128 | int HID_API_EXPORT_CALL hid_get_manufacturer_string(hid_device *device, wchar_t *string, size_t maxlen) |
| 1129 | { |
nothing calls this directly
no test coverage detected