Пример #1
0
        // Token: 0x0600002A RID: 42 RVA: 0x00003F40 File Offset: 0x00002140
        private static string GetDevicePath(IntPtr hInfoSet, ref Win32Usb.DeviceInterfaceData oInterface)
        {
            uint nDeviceInterfaceDetailDataSize = 0u;

            if (!Win32Usb.SetupDiGetDeviceInterfaceDetail(hInfoSet, ref oInterface, IntPtr.Zero, 0u, ref nDeviceInterfaceDetailDataSize, IntPtr.Zero))
            {
                Win32Usb.DeviceInterfaceDetailData deviceInterfaceDetailData = default(Win32Usb.DeviceInterfaceDetailData);
                deviceInterfaceDetailData.Size = 5;
                if (Win32Usb.SetupDiGetDeviceInterfaceDetail(hInfoSet, ref oInterface, ref deviceInterfaceDetailData, nDeviceInterfaceDetailDataSize, ref nDeviceInterfaceDetailDataSize, IntPtr.Zero))
                {
                    return(deviceInterfaceDetailData.DevicePath);
                }
            }
            return(null);
        }
Пример #2
0
        private static string GetDevicePath(IntPtr hInfoSet, ref Win32Usb.DeviceInterfaceData oInterface)
        {
            uint nRequiredSize = 0;

            if (!Win32Usb.SetupDiGetDeviceInterfaceDetail(hInfoSet, ref oInterface, IntPtr.Zero, 0, ref nRequiredSize, IntPtr.Zero))
            {
                Win32Usb.DeviceInterfaceDetailData oDetailData = new Win32Usb.DeviceInterfaceDetailData {
                    Size = 5
                };
                if (Win32Usb.SetupDiGetDeviceInterfaceDetail(hInfoSet, ref oInterface, ref oDetailData, nRequiredSize, ref nRequiredSize, IntPtr.Zero))
                {
                    return(oDetailData.DevicePath);
                }
            }
            return(null);
        }
Пример #3
0
        private static string smethod_0(IntPtr intptr_0, ref DeviceInterfaceData deviceInterfaceData_0)
        {
            uint nDeviceInterfaceDetailDataSize = 0u;

            if (!Win32Usb.SetupDiGetDeviceInterfaceDetail(intptr_0, ref deviceInterfaceData_0, IntPtr.Zero, 0u, ref nDeviceInterfaceDetailDataSize, IntPtr.Zero))
            {
                DeviceInterfaceDetailData deviceInterfaceDetailData = default(DeviceInterfaceDetailData);
                if (IntPtr.Size == 4)
                {
                    deviceInterfaceDetailData.Size = 5;
                }
                else
                {
                    deviceInterfaceDetailData.Size = 8;
                }
                if (Win32Usb.SetupDiGetDeviceInterfaceDetail(intptr_0, ref deviceInterfaceData_0, ref deviceInterfaceDetailData, nDeviceInterfaceDetailDataSize, ref nDeviceInterfaceDetailDataSize, IntPtr.Zero))
                {
                    return(deviceInterfaceDetailData.DevicePath);
                }
            }
            return(null);
        }