+ if (port->usb_serial == NULL) {
+ //composite device, get the parent's serial number
+ char device_id[MAX_DEVICE_ID_LEN];
+ if (CM_Get_Parent(&dev_inst, dev_inst, 0) == CR_SUCCESS) {
+ if (CM_Get_Device_IDA(dev_inst, device_id, sizeof(device_id), 0) == CR_SUCCESS)
+ port->usb_serial = strdup(strrchr(device_id, '\\')+1);
+ }
+ }
+ }