SP_DEVINFO_DATA.cbSize = Marshal.SizeOf(sP_DEVINFO_DATA) USB.SP_DEVINFO_DATA sP_DEVINFO_DATA = default(USB.SP_DEVINFO_DATA) SP_DEVICE_INTERFACE_DATA.cbSize = Marshal.SizeOf(sP_DEVICE_INTERFACE_DATA) įlag = USB.SetupDiEnumDeviceInterfaces(deviceInfoSet, IntPtr.Zero, ref guid, num, ref sP_DEVICE_INTERFACE_DATA) USB.SP_DEVICE_INTERFACE_DATA sP_DEVICE_INTERFACE_DATA = default(USB.SP_DEVICE_INTERFACE_DATA) USB.USBController uSBController = new USB.USBController() IntPtr intPtr = Marshal.AllocHGlobal(2048) IntPtr deviceInfoSet = USB.SetupDiGetClassDevs(ref guid, 0, IntPtr.Zero, 18) Int deviceNumber = USB.GetDeviceNumber("\\\\.\\" + DriveLetter.TrimEnd(new char Public static USB.USBDevice FindDriveLetter(string DriveLetter) Private static extern int CM_Get_Device_ID(IntPtr dnDevInst, IntPtr Buffer, int BufferLen, int ulFlags) Private static extern int CM_Get_Parent(out IntPtr pdnDevInst, int dnDevInst, int ulFlags) USB.SearchHubInstanceID(current.GetHub(), ref FoundDevice, InstanceID) Private static void SearchHubInstanceID(USB.USBHub Hub, ref USB.USBDevice FoundDevice, string InstanceID) USB.SearchHubInstanceID(current.GetRootHub(), ref uSBDevice, InstanceID) Public static USB.USBDevice FindDeviceByInstanceID(string InstanceID) If (device.DeviceDriverKey = DriverKeyName) USB.USBDevice device = current.GetDevice() USB.SearchHubDriverKeyName(current.GetHub(), ref FoundDevice, DriverKeyName) Private static void SearchHubDriverKeyName(USB.USBHub Hub, ref USB.USBDevice FoundDevice, string DriverKeyName) USB.SearchHubDriverKeyName(current.GetRootHub(), ref uSBDevice, DriverKeyName) Public static USB.USBDevice FindDeviceByDriverKeyName(string DriverKeyName) Private static void ListHub(USB.USBHub Hub, List DevList)įoreach (USB.USBPort current in Hub.GetPorts()) Token: 0x0600029F RID: 671 RVA: 0x0000FC14 File Offset: 0x0000DE14įoreach (USB.USBController current in USB.GetHostControllers())
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |