diff options
| author | Adonais Romero González <[email protected]> | 2024-05-06 16:21:31 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-05-06 16:21:31 -0700 |
| commit | a74a241c664c4e1d7c0838287b34076c19d9858a (patch) | |
| tree | 6ff7562612967b122acf8acf8a69c4dcfd5905db /usb/usbview | |
| parent | def8e8e34ed2b7b1deb2fc9112ac4255f1a0f2ba (diff) | |
| parent | 15477ce52bbb6b42ca591ecdfb484cac089f89ab (diff) | |
Merge develop changes prior to upcoming WDK release (May 2024)
Diffstat (limited to 'usb/usbview')
| -rw-r--r-- | usb/usbview/enum.c | 117 | ||||
| -rw-r--r-- | usb/usbview/usbview.sln | 14 | ||||
| -rw-r--r-- | usb/usbview/usbview.vcxproj | 48 | ||||
| -rw-r--r-- | usb/usbview/xmlhelper.cpp | 1 |
4 files changed, 89 insertions, 91 deletions
diff --git a/usb/usbview/enum.c b/usb/usbview/enum.c index fd427f68..297e0d32 100644 --- a/usb/usbview/enum.c +++ b/usb/usbview/enum.c @@ -296,77 +296,74 @@ EnumerateHostControllers ( { deviceInterfaceData.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA); - success = SetupDiEnumDeviceInterfaces(deviceInfo, - 0, - (LPGUID)&GUID_CLASS_USB_HOST_CONTROLLER, - index, - &deviceInterfaceData); - - if (!success) + for (int devInterfaceIndex = 0; + SetupDiEnumDeviceInterfaces(deviceInfo, + &deviceInfoData, + (LPGUID)&GUID_CLASS_USB_HOST_CONTROLLER, + devInterfaceIndex, + &deviceInterfaceData); + devInterfaceIndex++) { - OOPS(); - break; - } + success = SetupDiGetDeviceInterfaceDetail(deviceInfo, + &deviceInterfaceData, + NULL, + 0, + &requiredLength, + NULL); - success = SetupDiGetDeviceInterfaceDetail(deviceInfo, - &deviceInterfaceData, - NULL, - 0, - &requiredLength, - NULL); + if (!success && GetLastError() != ERROR_INSUFFICIENT_BUFFER) + { + OOPS(); + break; + } - if (!success && GetLastError() != ERROR_INSUFFICIENT_BUFFER) - { - OOPS(); - break; - } + deviceDetailData = ALLOC(requiredLength); + if (deviceDetailData == NULL) + { + OOPS(); + break; + } - deviceDetailData = ALLOC(requiredLength); - if (deviceDetailData == NULL) - { - OOPS(); - break; - } + deviceDetailData->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA); - deviceDetailData->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA); + success = SetupDiGetDeviceInterfaceDetail(deviceInfo, + &deviceInterfaceData, + deviceDetailData, + requiredLength, + &requiredLength, + NULL); - success = SetupDiGetDeviceInterfaceDetail(deviceInfo, - &deviceInterfaceData, - deviceDetailData, - requiredLength, - &requiredLength, - NULL); + if (!success) + { + OOPS(); + break; + } - if (!success) - { - OOPS(); - break; - } + hHCDev = CreateFile(deviceDetailData->DevicePath, + GENERIC_WRITE, + FILE_SHARE_WRITE, + NULL, + OPEN_EXISTING, + 0, + NULL); - hHCDev = CreateFile(deviceDetailData->DevicePath, - GENERIC_WRITE, - FILE_SHARE_WRITE, - NULL, - OPEN_EXISTING, - 0, - NULL); + // If the handle is valid, then we've successfully opened a Host + // Controller. Display some info about the Host Controller itself, + // then enumerate the Root Hub attached to the Host Controller. + // + if (hHCDev != INVALID_HANDLE_VALUE) + { + EnumerateHostController(hTreeParent, + hHCDev, + deviceDetailData->DevicePath, + deviceInfo, + &deviceInfoData); - // If the handle is valid, then we've successfully opened a Host - // Controller. Display some info about the Host Controller itself, - // then enumerate the Root Hub attached to the Host Controller. - // - if (hHCDev != INVALID_HANDLE_VALUE) - { - EnumerateHostController(hTreeParent, - hHCDev, - deviceDetailData->DevicePath, - deviceInfo, - &deviceInfoData); + CloseHandle(hHCDev); + } - CloseHandle(hHCDev); + FREE(deviceDetailData); } - - FREE(deviceDetailData); } SetupDiDestroyDeviceInfoList(deviceInfo); diff --git a/usb/usbview/usbview.sln b/usb/usbview/usbview.sln index bc2819c4..7d5a1177 100644 --- a/usb/usbview/usbview.sln +++ b/usb/usbview/usbview.sln @@ -1,4 +1,4 @@ - + Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2013 VisualStudioVersion = 12.0 @@ -7,16 +7,16 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "usbview", "usbview.vcxproj" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 + Debug|ARM64 = Debug|ARM64 + Release|ARM64 = Release|ARM64 Debug|x64 = Debug|x64 Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {287B60C4-636F-4CE7-91C2-04E03A01B9C5}.Debug|Win32.ActiveCfg = Debug|Win32 - {287B60C4-636F-4CE7-91C2-04E03A01B9C5}.Debug|Win32.Build.0 = Debug|Win32 - {287B60C4-636F-4CE7-91C2-04E03A01B9C5}.Release|Win32.ActiveCfg = Release|Win32 - {287B60C4-636F-4CE7-91C2-04E03A01B9C5}.Release|Win32.Build.0 = Release|Win32 + {287B60C4-636F-4CE7-91C2-04E03A01B9C5}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {287B60C4-636F-4CE7-91C2-04E03A01B9C5}.Debug|ARM64.Build.0 = Debug|ARM64 + {287B60C4-636F-4CE7-91C2-04E03A01B9C5}.Release|ARM64.ActiveCfg = Release|ARM64 + {287B60C4-636F-4CE7-91C2-04E03A01B9C5}.Release|ARM64.Build.0 = Release|ARM64 {287B60C4-636F-4CE7-91C2-04E03A01B9C5}.Debug|x64.ActiveCfg = Debug|x64 {287B60C4-636F-4CE7-91C2-04E03A01B9C5}.Debug|x64.Build.0 = Debug|x64 {287B60C4-636F-4CE7-91C2-04E03A01B9C5}.Release|x64.ActiveCfg = Release|x64 diff --git a/usb/usbview/usbview.vcxproj b/usb/usbview/usbview.vcxproj index fa1866e0..9de28f70 100644 --- a/usb/usbview/usbview.vcxproj +++ b/usb/usbview/usbview.vcxproj @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> - <ProjectConfiguration Include="Debug|Win32"> + <ProjectConfiguration Include="Debug|ARM64"> <Configuration>Debug</Configuration> - <Platform>Win32</Platform> + <Platform>ARM64</Platform> </ProjectConfiguration> - <ProjectConfiguration Include="Release|Win32"> + <ProjectConfiguration Include="Release|ARM64"> <Configuration>Release</Configuration> - <Platform>Win32</Platform> + <Platform>ARM64</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Debug|x64"> <Configuration>Debug</Configuration> @@ -22,7 +22,7 @@ <ProjectGuid>{287B60C4-636F-4CE7-91C2-04E03A01B9C5}</ProjectGuid> <RootNamespace>$(MSBuildProjectName)</RootNamespace> <Configuration Condition="'$(Configuration)' == ''">Debug</Configuration> - <Platform Condition="'$(Platform)' == ''">Win32</Platform> + <Platform Condition="'$(Platform)' == ''">x64</Platform> <SampleGuid>{54E86405-9C3D-4F0F-B65C-AB86DE455DD7}</SampleGuid> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> @@ -34,23 +34,23 @@ <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> <ConfigurationType>Application</ConfigurationType> </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> + <UseDebugLibraries>False</UseDebugLibraries> <DriverTargetPlatform>Desktop</DriverTargetPlatform> <DriverType /> <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> <ConfigurationType>Application</ConfigurationType> </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> + <UseDebugLibraries>True</UseDebugLibraries> <DriverTargetPlatform>Desktop</DriverTargetPlatform> <DriverType /> <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> <ConfigurationType>Application</ConfigurationType> </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> <TargetVersion>Windows10</TargetVersion> <UseDebugLibraries>True</UseDebugLibraries> <DriverTargetPlatform>Desktop</DriverTargetPlatform> @@ -65,13 +65,13 @@ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> </ImportGroup> <ItemGroup Label="WrappedTaskItems" /> @@ -79,15 +79,15 @@ <TargetName>usbview</TargetName> <ManagedAssembly>true</ManagedAssembly> </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> <TargetName>usbview</TargetName> <ManagedAssembly>true</ManagedAssembly> </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <TargetName>usbview</TargetName> <ManagedAssembly>true</ManagedAssembly> </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> <TargetName>usbview</TargetName> <ManagedAssembly>true</ManagedAssembly> </PropertyGroup> @@ -108,7 +108,7 @@ <FileDigestAlgorithm>sha256</FileDigestAlgorithm> </DriverSign> </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> <ClCompile> <RuntimeTypeInfo>true</RuntimeTypeInfo> <TreatWarningAsError>true</TreatWarningAsError> @@ -117,15 +117,15 @@ </ExceptionHandling> </ClCompile> <Link> - <BaseAddress Condition="'$(Platform)'=='x64'">0x101000000</BaseAddress> - <BaseAddress Condition="!('$(Platform)'=='x64')">0x1000000</BaseAddress> + <BaseAddress Condition="'$(Platform)'=='x64' or '$(Platform)'=='ARM64'">0x101000000</BaseAddress> + <BaseAddress Condition="!('$(Platform)'=='x64' or '$(Platform)'=='ARM64')">0x1000000</BaseAddress> <AdditionalDependencies>%(AdditionalDependencies);shell32.lib;kernel32.lib;user32.lib;gdi32.lib;comctl32.lib;cfgmgr32.lib;comdlg32.lib;ole32.lib;setupapi.lib;strsafe.lib;shlwapi.lib</AdditionalDependencies> </Link> <DriverSign> <FileDigestAlgorithm>sha256</FileDigestAlgorithm> </DriverSign> </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ClCompile> <RuntimeTypeInfo>true</RuntimeTypeInfo> <TreatWarningAsError>true</TreatWarningAsError> @@ -142,7 +142,7 @@ <FileDigestAlgorithm>sha256</FileDigestAlgorithm> </DriverSign> </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> <ClCompile> <RuntimeTypeInfo>true</RuntimeTypeInfo> <TreatWarningAsError>true</TreatWarningAsError> @@ -151,8 +151,8 @@ </ExceptionHandling> </ClCompile> <Link> - <BaseAddress Condition="'$(Platform)'=='x64'">0x101000000</BaseAddress> - <BaseAddress Condition="!('$(Platform)'=='x64')">0x1000000</BaseAddress> + <BaseAddress Condition="'$(Platform)'=='x64' or '$(Platform)'=='ARM64'">0x101000000</BaseAddress> + <BaseAddress Condition="!('$(Platform)'=='x64' or '$(Platform)'=='ARM64')">0x1000000</BaseAddress> <AdditionalDependencies>%(AdditionalDependencies);shell32.lib;kernel32.lib;user32.lib;gdi32.lib;comctl32.lib;cfgmgr32.lib;comdlg32.lib;ole32.lib;setupapi.lib;strsafe.lib;shlwapi.lib</AdditionalDependencies> </Link> <DriverSign> @@ -195,4 +195,4 @@ <ClInclude Exclude="@(ClInclude)" Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd" /> </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> -</Project> +</Project>
\ No newline at end of file diff --git a/usb/usbview/xmlhelper.cpp b/usb/usbview/xmlhelper.cpp index f67c9587..6ed0f61b 100644 --- a/usb/usbview/xmlhelper.cpp +++ b/usb/usbview/xmlhelper.cpp @@ -2071,6 +2071,7 @@ String ^ XmlGetStringDescriptor(UCHAR index, PSTRING_DESCRIPTOR_NODE stringDesc, { // If we are required to return only english descriptor, continue foundNonEnglishDescriptor = true; + stringDesc = stringDesc->Next; continue; } |
