Changeset 80480 in vbox
- Timestamp:
- Aug 28, 2019 2:16:15 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxUSB/win/lib/VBoxUsbLib-win.cpp
r79390 r80480 500 500 } 501 501 502 static int usbLibDevCfgDrGet(HANDLE hHub, ULONG iPort, ULONG iDr, PUSB_CONFIGURATION_DESCRIPTOR *ppDr)502 static int usbLibDevCfgDrGet(HANDLE hHub, LPCSTR lpcszHubName, ULONG iPort, ULONG iDr, PUSB_CONFIGURATION_DESCRIPTOR *ppDr) 503 503 { 504 504 *ppDr = NULL; … … 519 519 { 520 520 DWORD dwErr = GetLastError(); 521 LogRelFunc(("DeviceIoControl 1 fail dwErr (%d) \n", dwErr));521 LogRelFunc(("DeviceIoControl 1 fail dwErr (%d) on hub %s port %d\n", dwErr, lpcszHubName, iPort)); 522 522 #ifdef VBOX_WITH_ANNOYING_USB_ASSERTIONS 523 523 AssertFailed(); … … 556 556 { 557 557 DWORD dwErr = GetLastError(); 558 LogRelFunc(("DeviceIoControl 2 fail dwErr (%d) \n", dwErr));558 LogRelFunc(("DeviceIoControl 2 fail dwErr (%d) on hub %s port %d\n", dwErr, lpcszHubName, iPort)); 559 559 #ifdef VBOX_WITH_ANNOYING_USB_ASSERTIONS 560 560 AssertFailed(); … … 590 590 } 591 591 592 static int usbLibDevStrDrEntryGet(HANDLE hHub, ULONG iPort, ULONG iDr, USHORT idLang, PVBOXUSB_STRING_DR_ENTRY *ppList)592 static int usbLibDevStrDrEntryGet(HANDLE hHub, LPCSTR lpcszHubName, ULONG iPort, ULONG iDr, USHORT idLang, PVBOXUSB_STRING_DR_ENTRY *ppList) 593 593 { 594 594 char szBuf[sizeof (USB_DESCRIPTOR_REQUEST) + MAXIMUM_USB_STRING_LENGTH]; … … 610 610 { 611 611 DWORD dwErr = GetLastError(); 612 LogRel(("Getting USB descriptor (id %u) failed with error %ld \n", iDr, dwErr));612 LogRel(("Getting USB descriptor (id %u) failed with error %ld on hub %s port %d\n", iDr, dwErr, lpcszHubName, iPort)); 613 613 return RTErrConvertFromWin32(dwErr); 614 614 } … … 659 659 } 660 660 661 static int usbLibDevStrDrEntryGetForLangs(HANDLE hHub, ULONG iPort, ULONG iDr, ULONG cIdLang, const USHORT *pIdLang, PVBOXUSB_STRING_DR_ENTRY *ppList)661 static int usbLibDevStrDrEntryGetForLangs(HANDLE hHub, LPCSTR lpcszHubName, ULONG iPort, ULONG iDr, ULONG cIdLang, const USHORT *pIdLang, PVBOXUSB_STRING_DR_ENTRY *ppList) 662 662 { 663 663 for (ULONG i = 0; i < cIdLang; ++i) 664 664 { 665 usbLibDevStrDrEntryGet(hHub, iPort, iDr, pIdLang[i], ppList);665 usbLibDevStrDrEntryGet(hHub, lpcszHubName, iPort, iDr, pIdLang[i], ppList); 666 666 } 667 667 return VINF_SUCCESS; 668 668 } 669 669 670 static int usbLibDevStrDrEntryGetAll(HANDLE hHub, ULONG iPort, PUSB_DEVICE_DESCRIPTOR pDevDr, PUSB_CONFIGURATION_DESCRIPTOR pCfgDr, PVBOXUSB_STRING_DR_ENTRY *ppList)670 static int usbLibDevStrDrEntryGetAll(HANDLE hHub, LPCSTR lpcszHubName, ULONG iPort, PUSB_DEVICE_DESCRIPTOR pDevDr, PUSB_CONFIGURATION_DESCRIPTOR pCfgDr, PVBOXUSB_STRING_DR_ENTRY *ppList) 671 671 { 672 672 /* Read string descriptor zero to determine what languages are available. */ 673 int rc = usbLibDevStrDrEntryGet(hHub, iPort, 0, 0, ppList);673 int rc = usbLibDevStrDrEntryGet(hHub, lpcszHubName, iPort, 0, 0, ppList); 674 674 if (RT_FAILURE(rc)) 675 675 return rc; … … 681 681 if (pDevDr->iManufacturer) 682 682 { 683 rc = usbLibDevStrDrEntryGetForLangs(hHub, iPort, pDevDr->iManufacturer, cIdLang, pIdLang, ppList);683 rc = usbLibDevStrDrEntryGetForLangs(hHub, lpcszHubName, iPort, pDevDr->iManufacturer, cIdLang, pIdLang, ppList); 684 684 AssertRC(rc); 685 685 } … … 687 687 if (pDevDr->iProduct) 688 688 { 689 rc = usbLibDevStrDrEntryGetForLangs(hHub, iPort, pDevDr->iProduct, cIdLang, pIdLang, ppList);689 rc = usbLibDevStrDrEntryGetForLangs(hHub, lpcszHubName, iPort, pDevDr->iProduct, cIdLang, pIdLang, ppList); 690 690 AssertRC(rc); 691 691 } … … 693 693 if (pDevDr->iSerialNumber) 694 694 { 695 rc = usbLibDevStrDrEntryGetForLangs(hHub, iPort, pDevDr->iSerialNumber, cIdLang, pIdLang, ppList);695 rc = usbLibDevStrDrEntryGetForLangs(hHub, lpcszHubName, iPort, pDevDr->iSerialNumber, cIdLang, pIdLang, ppList); 696 696 AssertRC(rc); 697 697 } … … 724 724 if (!pCurCfgDr->iConfiguration) 725 725 break; 726 rc = usbLibDevStrDrEntryGetForLangs(hHub, iPort, pCurCfgDr->iConfiguration, cIdLang, pIdLang, ppList);726 rc = usbLibDevStrDrEntryGetForLangs(hHub, lpcszHubName, iPort, pCurCfgDr->iConfiguration, cIdLang, pIdLang, ppList); 727 727 AssertRC(rc); 728 728 break; … … 738 738 if (!pCurIfDr->iInterface) 739 739 break; 740 rc = usbLibDevStrDrEntryGetForLangs(hHub, iPort, pCurIfDr->iInterface, cIdLang, pIdLang, ppList);740 rc = usbLibDevStrDrEntryGetForLangs(hHub, lpcszHubName, iPort, pCurIfDr->iInterface, cIdLang, pIdLang, ppList); 741 741 AssertRC(rc); 742 742 break; … … 769 769 { 770 770 DWORD dwErr = GetLastError(); NOREF(dwErr); 771 LogRel(("Getting USB connection information failed with error %ld \n", dwErr));771 LogRel(("Getting USB connection information failed with error %ld on hub %s\n", dwErr, lpcszHubName)); 772 772 AssertMsg(dwErr == ERROR_DEVICE_NOT_CONNECTED, (__FUNCTION__": DeviceIoControl failed dwErr (%d)\n", dwErr)); 773 773 return VERR_GENERAL_FAILURE; … … 782 782 if (pConInfo->DeviceIsHub) 783 783 { 784 LPSTR lpsz HubName = NULL;785 rc = usbLibDevStrHubNameGet(hHub, iPort, &lpsz HubName);784 LPSTR lpszChildHubName = NULL; 785 rc = usbLibDevStrHubNameGet(hHub, iPort, &lpszChildHubName); 786 786 AssertRC(rc); 787 787 if (RT_SUCCESS(rc)) 788 788 { 789 rc = usbLibDevGetHubDevices(lpsz HubName, ppDevs, pcDevs);790 usbLibDevStrFree(lpsz HubName);789 rc = usbLibDevGetHubDevices(lpszChildHubName, ppDevs, pcDevs); 790 usbLibDevStrFree(lpszChildHubName); 791 791 AssertRC(rc); 792 792 return rc; … … 803 803 if (!lpszName) 804 804 { 805 LogRelFunc(("warning: no DriverKey on hub %s port %d\n", lpcszHubName, iPort)); 805 806 lpszName = &nameEmptyBuf; 806 807 fFreeNameBuf = false; … … 809 810 PUSB_CONFIGURATION_DESCRIPTOR pCfgDr = NULL; 810 811 PVBOXUSB_STRING_DR_ENTRY pList = NULL; 811 rc = usbLibDevCfgDrGet(hHub, iPort, 0, &pCfgDr);812 rc = usbLibDevCfgDrGet(hHub, lpcszHubName, iPort, 0, &pCfgDr); 812 813 if (pCfgDr) 813 814 { 814 rc = usbLibDevStrDrEntryGetAll(hHub, iPort, &pConInfo->DeviceDescriptor, pCfgDr, &pList);815 rc = usbLibDevStrDrEntryGetAll(hHub, lpcszHubName, iPort, &pConInfo->DeviceDescriptor, pCfgDr, &pList); 815 816 #ifdef VBOX_WITH_ANNOYING_USB_ASSERTIONS 816 817 AssertRC(rc); // this can fail if device suspended … … 878 879 &cbReturned, NULL)) 879 880 { 880 LogRel(("Getting USB node information failed with error %ld \n", GetLastError()));881 LogRel(("Getting USB node information failed with error %ld on hub %s\n", GetLastError(), lpszName)); 881 882 AssertFailed(); 882 883 break;
Note:
See TracChangeset
for help on using the changeset viewer.