From a79b6b7ea3f7da828b1c3985dd1891299d74a328 Mon Sep 17 00:00:00 2001 From: Frederik Carlier Date: Tue, 9 Aug 2016 12:07:48 +0200 Subject: [PATCH 01/13] Upgrade projects to Visual Studio 2015 --- stage/Benchmark/Benchmark.csproj | 16 ++++++--- stage/BenchmarkCon/BenchmarkCon.csproj | 15 ++++---- .../Device.Notification.csproj | 9 +++-- .../Read.Isochronous/Read.Isochronous.csproj | 7 +++- stage/Examples/Read.Only/Read.Only.csproj | 7 +++- .../Read.Write.Async/Read.Write.Async.csproj | 7 +++- .../Read.Write.Event/Read.Write.Event.csproj | 9 +++-- stage/Examples/Read.Write/Read.Write.csproj | 9 +++-- stage/Examples/Show.Info/Show.Info.csproj | 9 +++-- stage/InfWizard/InfWizard.csproj | 8 ++--- ...ings1.Designer.cs => Settings.Designer.cs} | 4 +-- stage/InfWizard/resInfWizard.Designer.cs | 34 +++++++++++++++++-- stage/LibUsbDotNet.sln | 10 +++--- stage/LibWinUsb/LibUsbDotNet.csproj | 4 +-- stage/Test_Bulk/Test_Bulk.csproj | 20 +++++++---- .../Test_DeviceNotify.csproj | 20 +++++++---- stage/Test_Info/Test_Info.csproj | 20 +++++++---- 17 files changed, 144 insertions(+), 64 deletions(-) rename stage/InfWizard/Properties/{Settings1.Designer.cs => Settings.Designer.cs} (96%) diff --git a/stage/Benchmark/Benchmark.csproj b/stage/Benchmark/Benchmark.csproj index 421dfee..f759c08 100644 --- a/stage/Benchmark/Benchmark.csproj +++ b/stage/Benchmark/Benchmark.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -12,7 +12,7 @@ Benchmark - 2.0 + 3.5 v2.0 @@ -82,14 +82,20 @@ Designer ResXFileCodeGenerator + Resources.Designer.cs - - Resources.resx - SettingsSingleFileGenerator + Settings.Designer.cs + + True + True + Resources.resx + + True + True Settings.settings diff --git a/stage/BenchmarkCon/BenchmarkCon.csproj b/stage/BenchmarkCon/BenchmarkCon.csproj index 5a6c9a2..fa6a284 100644 --- a/stage/BenchmarkCon/BenchmarkCon.csproj +++ b/stage/BenchmarkCon/BenchmarkCon.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -12,9 +12,12 @@ BenchmarkCon v2.0 512 - - UsbDos.ico + + + + + 3.5 true @@ -84,10 +87,4 @@ --> - - SET USE_ILMERGE=1 -IF NOT DEFINED USE_ILMERGE GOTO DONE -ilmerge /out:"$(TargetDir)Bm$(TargetExt)" "$(TargetPath)" "$(TargetDir)LibUsbDotNet.dll" -:DONE - \ No newline at end of file diff --git a/stage/Examples/Device.Notification/Device.Notification.csproj b/stage/Examples/Device.Notification/Device.Notification.csproj index 3d445c5..88796a7 100644 --- a/stage/Examples/Device.Notification/Device.Notification.csproj +++ b/stage/Examples/Device.Notification/Device.Notification.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -12,8 +12,11 @@ Device.Notification v2.0 512 - - + + + + + 3.5 true diff --git a/stage/Examples/Read.Isochronous/Read.Isochronous.csproj b/stage/Examples/Read.Isochronous/Read.Isochronous.csproj index 22da68e..e429448 100644 --- a/stage/Examples/Read.Isochronous/Read.Isochronous.csproj +++ b/stage/Examples/Read.Isochronous/Read.Isochronous.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -12,6 +12,11 @@ Read.Isochronous v2.0 512 + + + + + 3.5 true diff --git a/stage/Examples/Read.Only/Read.Only.csproj b/stage/Examples/Read.Only/Read.Only.csproj index bcf82b1..163715b 100644 --- a/stage/Examples/Read.Only/Read.Only.csproj +++ b/stage/Examples/Read.Only/Read.Only.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -12,6 +12,11 @@ Read.Only v2.0 512 + + + + + 3.5 true diff --git a/stage/Examples/Read.Write.Async/Read.Write.Async.csproj b/stage/Examples/Read.Write.Async/Read.Write.Async.csproj index bb8ddbb..b87d673 100644 --- a/stage/Examples/Read.Write.Async/Read.Write.Async.csproj +++ b/stage/Examples/Read.Write.Async/Read.Write.Async.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -12,6 +12,11 @@ Read.Write.Async v2.0 512 + + + + + 3.5 true diff --git a/stage/Examples/Read.Write.Event/Read.Write.Event.csproj b/stage/Examples/Read.Write.Event/Read.Write.Event.csproj index 189a705..9cd58b5 100644 --- a/stage/Examples/Read.Write.Event/Read.Write.Event.csproj +++ b/stage/Examples/Read.Write.Event/Read.Write.Event.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -12,8 +12,11 @@ Read.Write.Event v2.0 512 - - + + + + + 3.5 true diff --git a/stage/Examples/Read.Write/Read.Write.csproj b/stage/Examples/Read.Write/Read.Write.csproj index 042aa8f..7ed7501 100644 --- a/stage/Examples/Read.Write/Read.Write.csproj +++ b/stage/Examples/Read.Write/Read.Write.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -12,8 +12,11 @@ Read.Write v2.0 512 - - + + + + + 3.5 true diff --git a/stage/Examples/Show.Info/Show.Info.csproj b/stage/Examples/Show.Info/Show.Info.csproj index d28821c..a6007b4 100644 --- a/stage/Examples/Show.Info/Show.Info.csproj +++ b/stage/Examples/Show.Info/Show.Info.csproj @@ -1,5 +1,5 @@  - + {F7069C5F-8327-471A-9C13-9764C11E3A56} Debug @@ -10,10 +10,13 @@ v2.0 Properties C:\Documents and Settings\travis\Application Data\ICSharpCode/SharpDevelop3.0\Settings.SourceAnalysis - - 9.0.30729 2.0 + + + + + 3.5 bin\Debug\ diff --git a/stage/InfWizard/InfWizard.csproj b/stage/InfWizard/InfWizard.csproj index a25dfab..0728197 100644 --- a/stage/InfWizard/InfWizard.csproj +++ b/stage/InfWizard/InfWizard.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -12,7 +12,7 @@ InfWizard - 2.0 + 3.5 InfWizard.ico @@ -74,7 +74,7 @@ - + True True Settings.settings @@ -191,7 +191,7 @@ SettingsSingleFileGenerator - Settings1.Designer.cs + Settings.Designer.cs diff --git a/stage/InfWizard/Properties/Settings1.Designer.cs b/stage/InfWizard/Properties/Settings.Designer.cs similarity index 96% rename from stage/InfWizard/Properties/Settings1.Designer.cs rename to stage/InfWizard/Properties/Settings.Designer.cs index fd2323a..ef0fc87 100644 --- a/stage/InfWizard/Properties/Settings1.Designer.cs +++ b/stage/InfWizard/Properties/Settings.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.3053 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -12,7 +12,7 @@ namespace InfWizard.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/stage/InfWizard/resInfWizard.Designer.cs b/stage/InfWizard/resInfWizard.Designer.cs index a658205..0015354 100644 --- a/stage/InfWizard/resInfWizard.Designer.cs +++ b/stage/InfWizard/resInfWizard.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.3053 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -19,7 +19,7 @@ namespace InfWizard { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class resInfWizard { @@ -60,6 +60,9 @@ internal resInfWizard() { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// internal static System.Drawing.Bitmap CloseFolderImage { get { object obj = ResourceManager.GetObject("CloseFolderImage", resourceCulture); @@ -76,6 +79,9 @@ internal static string DRIVERRESOURCE_NOTFOUND { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// internal static System.Drawing.Bitmap InfoImage { get { object obj = ResourceManager.GetObject("InfoImage", resourceCulture); @@ -137,6 +143,9 @@ internal static string INSTALLDRIVER_WINDOWSSERVICE_TEXT { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// internal static System.Drawing.Bitmap LeftArrowImage { get { object obj = ResourceManager.GetObject("LeftArrowImage", resourceCulture); @@ -144,6 +153,9 @@ internal static System.Drawing.Bitmap LeftArrowImage { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// internal static System.Drawing.Bitmap LudnImage { get { object obj = ResourceManager.GetObject("LudnImage", resourceCulture); @@ -151,6 +163,9 @@ internal static System.Drawing.Bitmap LudnImage { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// internal static System.Drawing.Bitmap OpenFolderImage { get { object obj = ResourceManager.GetObject("OpenFolderImage", resourceCulture); @@ -158,6 +173,9 @@ internal static System.Drawing.Bitmap OpenFolderImage { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// internal static System.Drawing.Bitmap RefreshImage { get { object obj = ResourceManager.GetObject("RefreshImage", resourceCulture); @@ -174,6 +192,9 @@ internal static string REMOVE_DEVICE_WARNING { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// internal static System.Drawing.Bitmap RightArrowImage { get { object obj = ResourceManager.GetObject("RightArrowImage", resourceCulture); @@ -181,6 +202,9 @@ internal static System.Drawing.Bitmap RightArrowImage { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// internal static System.Drawing.Bitmap SaveImage { get { object obj = ResourceManager.GetObject("SaveImage", resourceCulture); @@ -217,6 +241,9 @@ internal static string SETUP_PACKAGE_README_HTM { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// internal static System.Drawing.Bitmap StopImage { get { object obj = ResourceManager.GetObject("StopImage", resourceCulture); @@ -224,6 +251,9 @@ internal static System.Drawing.Bitmap StopImage { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// internal static System.Drawing.Bitmap YieldImage { get { object obj = ResourceManager.GetObject("YieldImage", resourceCulture); diff --git a/stage/LibUsbDotNet.sln b/stage/LibUsbDotNet.sln index 5664178..4733292 100644 --- a/stage/LibUsbDotNet.sln +++ b/stage/LibUsbDotNet.sln @@ -1,6 +1,10 @@  -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{5E024A6D-DD45-421A-BF51-73DBA0A27E53}" +EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test_Bulk", "Test_Bulk\Test_Bulk.csproj", "{2AA77B1D-5F6B-4206-954C-ED8D6E7DEA1B}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Benchmark", "Benchmark\Benchmark.csproj", "{A379842D-C4E3-41E1-BE82-4041293AC225}" @@ -11,8 +15,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test_DeviceNotify", "Test_D EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test_Info", "Test_Info\Test_Info.csproj", "{3EFEDA92-CAE3-4585-A519-439ACD58468A}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{5E024A6D-DD45-421A-BF51-73DBA0A27E53}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Read.Write", "Examples\Read.Write\Read.Write.csproj", "{4030AC2F-4073-4F33-A529-6AF5B5D99B45}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Read.Write.Event", "Examples\Read.Write.Event\Read.Write.Event.csproj", "{CCDBE804-2312-444D-B7E7-C63FF1469795}" diff --git a/stage/LibWinUsb/LibUsbDotNet.csproj b/stage/LibWinUsb/LibUsbDotNet.csproj index 17d34a2..ad3ccfd 100644 --- a/stage/LibWinUsb/LibUsbDotNet.csproj +++ b/stage/LibWinUsb/LibUsbDotNet.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -12,7 +12,7 @@ LibUsbDotNet - 2.0 + 3.5 v2.0 diff --git a/stage/Test_Bulk/Test_Bulk.csproj b/stage/Test_Bulk/Test_Bulk.csproj index a435f93..185a0d9 100644 --- a/stage/Test_Bulk/Test_Bulk.csproj +++ b/stage/Test_Bulk/Test_Bulk.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -12,7 +12,7 @@ Test_Bulk - 2.0 + 3.5 v2.0 @@ -67,6 +67,11 @@ + + True + True + Settings.settings + fTestBulk.cs Designer @@ -74,15 +79,16 @@ Designer ResXFileCodeGenerator + Resources.Designer.cs - - Resources.resx - SettingsSingleFileGenerator + Settings.Designer.cs - - Settings.settings + + True + True + Resources.resx diff --git a/stage/Test_DeviceNotify/Test_DeviceNotify.csproj b/stage/Test_DeviceNotify/Test_DeviceNotify.csproj index bbea15f..98223fb 100644 --- a/stage/Test_DeviceNotify/Test_DeviceNotify.csproj +++ b/stage/Test_DeviceNotify/Test_DeviceNotify.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -12,7 +12,7 @@ Test_DeviceNotify - 2.0 + 3.5 v2.0 @@ -68,6 +68,11 @@ + + True + True + Settings.settings + fTestDeviceNotify.cs Designer @@ -75,15 +80,16 @@ Designer ResXFileCodeGenerator + Resources.Designer.cs - - Resources.resx - SettingsSingleFileGenerator + Settings.Designer.cs - - Settings.settings + + True + True + Resources.resx diff --git a/stage/Test_Info/Test_Info.csproj b/stage/Test_Info/Test_Info.csproj index ed9f612..8dbf371 100644 --- a/stage/Test_Info/Test_Info.csproj +++ b/stage/Test_Info/Test_Info.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -12,7 +12,7 @@ Test_Info - 2.0 + 3.5 v2.0 @@ -65,6 +65,11 @@ + + True + True + Settings.settings + fTestInfo.cs Designer @@ -72,15 +77,16 @@ Designer ResXFileCodeGenerator + Resources.Designer.cs - - Resources.resx - SettingsSingleFileGenerator + Settings.Designer.cs - - Settings.settings + + True + True + Resources.resx From 14028f2c790aae047b22171d3d04bb817f82c7fa Mon Sep 17 00:00:00 2001 From: Frederik Carlier Date: Tue, 9 Aug 2016 12:17:41 +0200 Subject: [PATCH 02/13] Initial AppVeyor build script --- appveyor.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..3610e71 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,2 @@ +build_script: + - msbuild stage\LibUsbDotNet.sln /p:Configuration=Release /p:Platform="Any CPU" /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" From ecefcf6930e188b47db2e479ca39190b9d1ba5ac Mon Sep 17 00:00:00 2001 From: Frederik Carlier Date: Tue, 9 Aug 2016 14:29:04 +0200 Subject: [PATCH 03/13] Change project folder to match project name --- .../Descriptors/ClassCodeType.cs | 0 .../Descriptors/DescriptorType.cs | 0 .../Descriptors/LangStringDescriptor.cs | 0 .../Descriptors/StringDescriptor.cs | 0 .../Descriptors/UsbConfigDescriptor.cs | 0 .../Descriptors/UsbDescriptor.cs | 0 .../Descriptors/UsbDeviceDescriptor.cs | 0 .../Descriptors/UsbEndpointDescriptor.cs | 0 .../Descriptors/UsbInterfaceDescriptor.cs | 0 .../DeviceNotify/DeviceNotifier.cs | 0 .../DeviceNotify/DeviceNotifyEventArgs.cs | 0 .../DeviceNotify/DeviceType.cs | 0 .../DeviceNotify/EventType.cs | 0 .../DeviceNotify/IDeviceNotifier.cs | 0 .../DeviceNotify/Info/IPortNotifyInfo.cs | 0 .../DeviceNotify/Info/IUsbDeviceNotifyInfo.cs | 0 .../DeviceNotify/Info/IVolumeNotifyInfo.cs | 0 .../DeviceNotify/Info/PortNotifyInfo.cs | 0 .../DeviceNotify/Info/UsbDeviceNotifyInfo.cs | 0 .../DeviceNotify/Info/VolumeNotifyInfo.cs | 0 .../Internal/DevBroadcastDeviceinterface.cs | 0 .../DeviceNotify/Internal/DevBroadcastHdr.cs | 0 .../DeviceNotify/Internal/DevBroadcastPort.cs | 0 .../DeviceNotify/Internal/DevBroadcastVolume.cs | 0 .../DeviceNotify/Internal/DevNotifyNativeWindow.cs | 0 .../DeviceNotify/Internal/SafeNotifyHandle.cs | 0 .../DeviceNotify/Linux/LinuxDevItem.cs | 0 .../DeviceNotify/Linux/LinuxDevItemList.cs | 0 .../Linux/LinuxDeviceNotifier.DevMonitor.cs | 0 .../Linux/LinuxDeviceNotifier.DeviceListPolling.cs | 0 .../DeviceNotify/Linux/LinuxDeviceNotifier.cs | 0 .../DeviceNotify/Linux/LinuxDeviceNotifierMode.cs | 0 .../Linux/LinuxDeviceNotifyEventArgs.cs | 0 .../DeviceNotify/Linux/LinuxUsbDeviceNotifyInfo.cs | 0 .../DeviceNotify/WindowsDeviceNotifier.cs | 0 .../DeviceNotify/WindowsDeviceNotifyEventArgs.cs | 0 stage/{LibWinUsb => LibUsbDotNet}/IUsbDevice.cs | 0 stage/{LibWinUsb => LibUsbDotNet}/IUsbInterface.cs | 0 .../{LibWinUsb => LibUsbDotNet}/Info/UsbBaseInfo.cs | 0 .../Info/UsbConfigInfo.cs | 0 .../Info/UsbDeviceInfo.cs | 0 .../Info/UsbEndpointInfo.cs | 0 .../Info/UsbInterfaceInfo.cs | 0 .../Internal/Kernel32.cs | 0 .../Internal/OverlappedTransferContext.cs | 0 .../Internal/SafeOverlapped.cs | 0 .../Internal/TransferContextBase.cs | 0 .../Internal/UsbApiBase.cs | 0 .../Internal/UsbRegex/BaseRegSymbolicName.cs | 0 .../Internal/UsbRegex/NamedGroup.cs | 0 .../Internal/UsbRegex/RegHardwareID.cs | 0 .../Internal/UsbRegex/RegSymbolicName.cs | 0 .../LibUsb/Internal/LibUsbAPI.cs | 0 .../LibUsb/Internal/LibUsbDriverIO.cs | 0 .../Internal/LibUsbDriverIO_IOControlMessage.cs | 0 .../LibUsb/Internal/LibUsbIoCtl.cs | 0 .../LibUsb/Internal/LibUsbRequest.cs | 0 .../LibUsb/LibUsbDevice.cs | 0 .../LibUsb/LibUsbDeviceRegistryKeyRequest.cs | 0 .../LibUsb/LibUsbKernelType.cs | 0 .../LibUsb/LibUsbRegistry.cs | 0 .../{LibWinUsb => LibUsbDotNet}/LibUsbDotNet.csproj | 0 stage/{LibWinUsb => LibUsbDotNet}/LibUsbDotNet.snk | Bin .../Main/ControlEpLockType.cs | 0 .../Main/DataEpLockType.cs | 0 .../Main/DataReceivedEnabledChangedEventArgs.cs | 0 .../Main/DeviceLockType.cs | 0 .../Main/DevicePropertyType.cs | 0 .../Main/EndpointDataEventArgs.cs | 0 .../Main/EndpointType.cs | 0 stage/{LibWinUsb => LibUsbDotNet}/Main/ErrorCode.cs | 0 stage/{LibWinUsb => LibUsbDotNet}/Main/Helper.cs | 0 .../Main/LegacyUsbRegistry.cs | 0 .../Main/ReadEndpointID.cs | 0 stage/{LibWinUsb => LibUsbDotNet}/Main/SPDRP.cs | 0 .../Main/SafeContextHandle.cs | 0 .../Main/SetupApiRegistry.cs | 0 .../Main/UsbConstants.cs | 0 .../Main/UsbCtrlFlags.cs | 0 .../Main/UsbDeviceFinder.cs | 0 .../Main/UsbEndpointBase.cs | 0 .../Main/UsbEndpointDirection.cs | 0 .../Main/UsbEndpointList.cs | 0 .../Main/UsbException.cs | 0 .../Main/UsbKernelVersion.cs | 0 .../Main/UsbLockStyle.cs | 0 .../Main/UsbRegDeviceList.cs | 0 .../{LibWinUsb => LibUsbDotNet}/Main/UsbRegistry.cs | 0 .../Main/UsbRequestRecipient.cs | 0 .../Main/UsbRequestType.cs | 0 .../Main/UsbSetupPacket.cs | 0 .../Main/UsbStandardRequest.cs | 0 .../Main/UsbStatusClodes.cs | 0 stage/{LibWinUsb => LibUsbDotNet}/Main/UsbStream.cs | 0 .../Main/UsbSymbolicName.cs | 0 .../{LibWinUsb => LibUsbDotNet}/Main/UsbTransfer.cs | 0 .../Main/WriteEndpointID.cs | 0 .../MonoLibUsb/CallbackDelegates.cs | 0 .../Descriptors/MonoUsbAltInterfaceDescriptor.cs | 0 .../Descriptors/MonoUsbConfigDescriptor.cs | 0 .../Descriptors/MonoUsbDeviceDescriptor.cs | 0 .../Descriptors/MonoUsbEndpointDescriptor.cs | 0 .../MonoLibUsb/Descriptors/MonoUsbInterface.cs | 0 .../MonoLibUsb/MonoLibUsbApi.cs | 0 .../MonoLibUsb/MonoUsbDevice.cs | 0 .../MonoLibUsb/MonoUsbDeviceHandle.cs | 0 .../MonoLibUsb/MonoUsbEndpointReader.cs | 0 .../MonoLibUsb/MonoUsbEndpointWriter.cs | 0 .../MonoLibUsb/MonoUsbError.cs | 0 .../MonoLibUsb/MonoUsbEventHandler.cs | 0 .../MonoLibUsb/MonoUsbSessionHandle.cs | 0 .../MonoLibUsb/Profile/AddRemoveEventArgs.cs | 0 .../MonoLibUsb/Profile/AddRemoveType.cs | 0 .../MonoLibUsb/Profile/MonoUsbConfigHandle.cs | 0 .../MonoLibUsb/Profile/MonoUsbProfile.cs | 0 .../MonoLibUsb/Profile/MonoUsbProfileHandle.cs | 0 .../Profile/MonoUsbProfileHandleEnumerator.cs | 0 .../MonoLibUsb/Profile/MonoUsbProfileList.cs | 0 .../MonoLibUsb/Profile/MonoUsbProfileListHandle.cs | 0 .../MonoLibUsb/Profile/PollfdItem.cs | 0 .../Transfer/Internal/libusb_control_setup.cs | 0 .../Internal/libusb_iso_packet_descriptor.cs | 0 .../MonoLibUsb/Transfer/Internal/libusb_transfer.cs | 0 .../MonoLibUsb/Transfer/MonoUsbControlSetup.cs | 0 .../Transfer/MonoUsbControlSetupHandle.cs | 0 .../MonoLibUsb/Transfer/MonoUsbIsoPacket.cs | 0 .../MonoLibUsb/Transfer/MonoUsbTansferStatus.cs | 0 .../MonoLibUsb/Transfer/MonoUsbTransfer.cs | 0 .../MonoLibUsb/Transfer/MonoUsbTransferContext.cs | 0 .../MonoLibUsb/Transfer/MonoUsbTransferFlags.cs | 0 .../MonoLibUsb/UnixNativeTimeval.cs | 0 .../Properties/AssemblyInfo.cs | 0 .../{LibWinUsb => LibUsbDotNet}/UsbDevice.Common.cs | 0 .../{LibWinUsb => LibUsbDotNet}/UsbDevice.Error.cs | 0 .../UsbDevice.OS.Specific.cs | 0 stage/{LibWinUsb => LibUsbDotNet}/UsbDevice.cs | 0 .../UsbEndpointReader.cs | 0 .../UsbEndpointWriter.cs | 0 stage/{LibWinUsb => LibUsbDotNet}/UsbGlobals.cs | 0 .../WinUsb/DeviceInformationTypes.cs | 0 .../WinUsb/DeviceSpeedTypes.cs | 0 .../WinUsb/Internal/SafeWinUsbInterfaceHandle.cs | 0 .../WinUsb/Internal/WinUsbAPI.cs | 0 .../WinUsb/PipeInformation.cs | 0 .../WinUsb/PipePolicies.cs | 0 .../WinUsb/PipePolicyType.cs | 0 .../WinUsb/PowerPolicies.cs | 0 .../WinUsb/PowerPolicyType.cs | 0 .../WinUsb/WinUsbDevice.cs | 0 .../WinUsb/WinUsbRegistry.cs | 0 150 files changed, 0 insertions(+), 0 deletions(-) rename stage/{LibWinUsb => LibUsbDotNet}/Descriptors/ClassCodeType.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Descriptors/DescriptorType.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Descriptors/LangStringDescriptor.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Descriptors/StringDescriptor.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Descriptors/UsbConfigDescriptor.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Descriptors/UsbDescriptor.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Descriptors/UsbDeviceDescriptor.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Descriptors/UsbEndpointDescriptor.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Descriptors/UsbInterfaceDescriptor.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/DeviceNotify/DeviceNotifier.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/DeviceNotify/DeviceNotifyEventArgs.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/DeviceNotify/DeviceType.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/DeviceNotify/EventType.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/DeviceNotify/IDeviceNotifier.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/DeviceNotify/Info/IPortNotifyInfo.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/DeviceNotify/Info/IUsbDeviceNotifyInfo.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/DeviceNotify/Info/IVolumeNotifyInfo.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/DeviceNotify/Info/PortNotifyInfo.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/DeviceNotify/Info/UsbDeviceNotifyInfo.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/DeviceNotify/Info/VolumeNotifyInfo.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/DeviceNotify/Internal/DevBroadcastDeviceinterface.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/DeviceNotify/Internal/DevBroadcastHdr.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/DeviceNotify/Internal/DevBroadcastPort.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/DeviceNotify/Internal/DevBroadcastVolume.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/DeviceNotify/Internal/DevNotifyNativeWindow.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/DeviceNotify/Internal/SafeNotifyHandle.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/DeviceNotify/Linux/LinuxDevItem.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/DeviceNotify/Linux/LinuxDevItemList.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/DeviceNotify/Linux/LinuxDeviceNotifier.DevMonitor.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/DeviceNotify/Linux/LinuxDeviceNotifier.DeviceListPolling.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/DeviceNotify/Linux/LinuxDeviceNotifier.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/DeviceNotify/Linux/LinuxDeviceNotifierMode.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/DeviceNotify/Linux/LinuxDeviceNotifyEventArgs.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/DeviceNotify/Linux/LinuxUsbDeviceNotifyInfo.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/DeviceNotify/WindowsDeviceNotifier.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/DeviceNotify/WindowsDeviceNotifyEventArgs.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/IUsbDevice.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/IUsbInterface.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Info/UsbBaseInfo.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Info/UsbConfigInfo.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Info/UsbDeviceInfo.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Info/UsbEndpointInfo.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Info/UsbInterfaceInfo.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Internal/Kernel32.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Internal/OverlappedTransferContext.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Internal/SafeOverlapped.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Internal/TransferContextBase.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Internal/UsbApiBase.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Internal/UsbRegex/BaseRegSymbolicName.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Internal/UsbRegex/NamedGroup.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Internal/UsbRegex/RegHardwareID.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Internal/UsbRegex/RegSymbolicName.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/LibUsb/Internal/LibUsbAPI.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/LibUsb/Internal/LibUsbDriverIO.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/LibUsb/Internal/LibUsbDriverIO_IOControlMessage.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/LibUsb/Internal/LibUsbIoCtl.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/LibUsb/Internal/LibUsbRequest.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/LibUsb/LibUsbDevice.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/LibUsb/LibUsbDeviceRegistryKeyRequest.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/LibUsb/LibUsbKernelType.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/LibUsb/LibUsbRegistry.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/LibUsbDotNet.csproj (100%) rename stage/{LibWinUsb => LibUsbDotNet}/LibUsbDotNet.snk (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Main/ControlEpLockType.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Main/DataEpLockType.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Main/DataReceivedEnabledChangedEventArgs.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Main/DeviceLockType.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Main/DevicePropertyType.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Main/EndpointDataEventArgs.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Main/EndpointType.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Main/ErrorCode.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Main/Helper.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Main/LegacyUsbRegistry.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Main/ReadEndpointID.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Main/SPDRP.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Main/SafeContextHandle.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Main/SetupApiRegistry.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Main/UsbConstants.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Main/UsbCtrlFlags.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Main/UsbDeviceFinder.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Main/UsbEndpointBase.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Main/UsbEndpointDirection.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Main/UsbEndpointList.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Main/UsbException.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Main/UsbKernelVersion.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Main/UsbLockStyle.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Main/UsbRegDeviceList.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Main/UsbRegistry.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Main/UsbRequestRecipient.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Main/UsbRequestType.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Main/UsbSetupPacket.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Main/UsbStandardRequest.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Main/UsbStatusClodes.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Main/UsbStream.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Main/UsbSymbolicName.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Main/UsbTransfer.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Main/WriteEndpointID.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/MonoLibUsb/CallbackDelegates.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/MonoLibUsb/Descriptors/MonoUsbAltInterfaceDescriptor.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/MonoLibUsb/Descriptors/MonoUsbConfigDescriptor.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/MonoLibUsb/Descriptors/MonoUsbDeviceDescriptor.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/MonoLibUsb/Descriptors/MonoUsbEndpointDescriptor.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/MonoLibUsb/Descriptors/MonoUsbInterface.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/MonoLibUsb/MonoLibUsbApi.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/MonoLibUsb/MonoUsbDevice.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/MonoLibUsb/MonoUsbDeviceHandle.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/MonoLibUsb/MonoUsbEndpointReader.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/MonoLibUsb/MonoUsbEndpointWriter.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/MonoLibUsb/MonoUsbError.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/MonoLibUsb/MonoUsbEventHandler.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/MonoLibUsb/MonoUsbSessionHandle.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/MonoLibUsb/Profile/AddRemoveEventArgs.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/MonoLibUsb/Profile/AddRemoveType.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/MonoLibUsb/Profile/MonoUsbConfigHandle.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/MonoLibUsb/Profile/MonoUsbProfile.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/MonoLibUsb/Profile/MonoUsbProfileHandle.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/MonoLibUsb/Profile/MonoUsbProfileHandleEnumerator.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/MonoLibUsb/Profile/MonoUsbProfileList.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/MonoLibUsb/Profile/MonoUsbProfileListHandle.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/MonoLibUsb/Profile/PollfdItem.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/MonoLibUsb/Transfer/Internal/libusb_control_setup.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/MonoLibUsb/Transfer/Internal/libusb_iso_packet_descriptor.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/MonoLibUsb/Transfer/Internal/libusb_transfer.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/MonoLibUsb/Transfer/MonoUsbControlSetup.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/MonoLibUsb/Transfer/MonoUsbControlSetupHandle.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/MonoLibUsb/Transfer/MonoUsbIsoPacket.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/MonoLibUsb/Transfer/MonoUsbTansferStatus.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/MonoLibUsb/Transfer/MonoUsbTransfer.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/MonoLibUsb/Transfer/MonoUsbTransferContext.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/MonoLibUsb/Transfer/MonoUsbTransferFlags.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/MonoLibUsb/UnixNativeTimeval.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/Properties/AssemblyInfo.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/UsbDevice.Common.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/UsbDevice.Error.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/UsbDevice.OS.Specific.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/UsbDevice.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/UsbEndpointReader.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/UsbEndpointWriter.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/UsbGlobals.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/WinUsb/DeviceInformationTypes.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/WinUsb/DeviceSpeedTypes.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/WinUsb/Internal/SafeWinUsbInterfaceHandle.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/WinUsb/Internal/WinUsbAPI.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/WinUsb/PipeInformation.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/WinUsb/PipePolicies.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/WinUsb/PipePolicyType.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/WinUsb/PowerPolicies.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/WinUsb/PowerPolicyType.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/WinUsb/WinUsbDevice.cs (100%) rename stage/{LibWinUsb => LibUsbDotNet}/WinUsb/WinUsbRegistry.cs (100%) diff --git a/stage/LibWinUsb/Descriptors/ClassCodeType.cs b/stage/LibUsbDotNet/Descriptors/ClassCodeType.cs similarity index 100% rename from stage/LibWinUsb/Descriptors/ClassCodeType.cs rename to stage/LibUsbDotNet/Descriptors/ClassCodeType.cs diff --git a/stage/LibWinUsb/Descriptors/DescriptorType.cs b/stage/LibUsbDotNet/Descriptors/DescriptorType.cs similarity index 100% rename from stage/LibWinUsb/Descriptors/DescriptorType.cs rename to stage/LibUsbDotNet/Descriptors/DescriptorType.cs diff --git a/stage/LibWinUsb/Descriptors/LangStringDescriptor.cs b/stage/LibUsbDotNet/Descriptors/LangStringDescriptor.cs similarity index 100% rename from stage/LibWinUsb/Descriptors/LangStringDescriptor.cs rename to stage/LibUsbDotNet/Descriptors/LangStringDescriptor.cs diff --git a/stage/LibWinUsb/Descriptors/StringDescriptor.cs b/stage/LibUsbDotNet/Descriptors/StringDescriptor.cs similarity index 100% rename from stage/LibWinUsb/Descriptors/StringDescriptor.cs rename to stage/LibUsbDotNet/Descriptors/StringDescriptor.cs diff --git a/stage/LibWinUsb/Descriptors/UsbConfigDescriptor.cs b/stage/LibUsbDotNet/Descriptors/UsbConfigDescriptor.cs similarity index 100% rename from stage/LibWinUsb/Descriptors/UsbConfigDescriptor.cs rename to stage/LibUsbDotNet/Descriptors/UsbConfigDescriptor.cs diff --git a/stage/LibWinUsb/Descriptors/UsbDescriptor.cs b/stage/LibUsbDotNet/Descriptors/UsbDescriptor.cs similarity index 100% rename from stage/LibWinUsb/Descriptors/UsbDescriptor.cs rename to stage/LibUsbDotNet/Descriptors/UsbDescriptor.cs diff --git a/stage/LibWinUsb/Descriptors/UsbDeviceDescriptor.cs b/stage/LibUsbDotNet/Descriptors/UsbDeviceDescriptor.cs similarity index 100% rename from stage/LibWinUsb/Descriptors/UsbDeviceDescriptor.cs rename to stage/LibUsbDotNet/Descriptors/UsbDeviceDescriptor.cs diff --git a/stage/LibWinUsb/Descriptors/UsbEndpointDescriptor.cs b/stage/LibUsbDotNet/Descriptors/UsbEndpointDescriptor.cs similarity index 100% rename from stage/LibWinUsb/Descriptors/UsbEndpointDescriptor.cs rename to stage/LibUsbDotNet/Descriptors/UsbEndpointDescriptor.cs diff --git a/stage/LibWinUsb/Descriptors/UsbInterfaceDescriptor.cs b/stage/LibUsbDotNet/Descriptors/UsbInterfaceDescriptor.cs similarity index 100% rename from stage/LibWinUsb/Descriptors/UsbInterfaceDescriptor.cs rename to stage/LibUsbDotNet/Descriptors/UsbInterfaceDescriptor.cs diff --git a/stage/LibWinUsb/DeviceNotify/DeviceNotifier.cs b/stage/LibUsbDotNet/DeviceNotify/DeviceNotifier.cs similarity index 100% rename from stage/LibWinUsb/DeviceNotify/DeviceNotifier.cs rename to stage/LibUsbDotNet/DeviceNotify/DeviceNotifier.cs diff --git a/stage/LibWinUsb/DeviceNotify/DeviceNotifyEventArgs.cs b/stage/LibUsbDotNet/DeviceNotify/DeviceNotifyEventArgs.cs similarity index 100% rename from stage/LibWinUsb/DeviceNotify/DeviceNotifyEventArgs.cs rename to stage/LibUsbDotNet/DeviceNotify/DeviceNotifyEventArgs.cs diff --git a/stage/LibWinUsb/DeviceNotify/DeviceType.cs b/stage/LibUsbDotNet/DeviceNotify/DeviceType.cs similarity index 100% rename from stage/LibWinUsb/DeviceNotify/DeviceType.cs rename to stage/LibUsbDotNet/DeviceNotify/DeviceType.cs diff --git a/stage/LibWinUsb/DeviceNotify/EventType.cs b/stage/LibUsbDotNet/DeviceNotify/EventType.cs similarity index 100% rename from stage/LibWinUsb/DeviceNotify/EventType.cs rename to stage/LibUsbDotNet/DeviceNotify/EventType.cs diff --git a/stage/LibWinUsb/DeviceNotify/IDeviceNotifier.cs b/stage/LibUsbDotNet/DeviceNotify/IDeviceNotifier.cs similarity index 100% rename from stage/LibWinUsb/DeviceNotify/IDeviceNotifier.cs rename to stage/LibUsbDotNet/DeviceNotify/IDeviceNotifier.cs diff --git a/stage/LibWinUsb/DeviceNotify/Info/IPortNotifyInfo.cs b/stage/LibUsbDotNet/DeviceNotify/Info/IPortNotifyInfo.cs similarity index 100% rename from stage/LibWinUsb/DeviceNotify/Info/IPortNotifyInfo.cs rename to stage/LibUsbDotNet/DeviceNotify/Info/IPortNotifyInfo.cs diff --git a/stage/LibWinUsb/DeviceNotify/Info/IUsbDeviceNotifyInfo.cs b/stage/LibUsbDotNet/DeviceNotify/Info/IUsbDeviceNotifyInfo.cs similarity index 100% rename from stage/LibWinUsb/DeviceNotify/Info/IUsbDeviceNotifyInfo.cs rename to stage/LibUsbDotNet/DeviceNotify/Info/IUsbDeviceNotifyInfo.cs diff --git a/stage/LibWinUsb/DeviceNotify/Info/IVolumeNotifyInfo.cs b/stage/LibUsbDotNet/DeviceNotify/Info/IVolumeNotifyInfo.cs similarity index 100% rename from stage/LibWinUsb/DeviceNotify/Info/IVolumeNotifyInfo.cs rename to stage/LibUsbDotNet/DeviceNotify/Info/IVolumeNotifyInfo.cs diff --git a/stage/LibWinUsb/DeviceNotify/Info/PortNotifyInfo.cs b/stage/LibUsbDotNet/DeviceNotify/Info/PortNotifyInfo.cs similarity index 100% rename from stage/LibWinUsb/DeviceNotify/Info/PortNotifyInfo.cs rename to stage/LibUsbDotNet/DeviceNotify/Info/PortNotifyInfo.cs diff --git a/stage/LibWinUsb/DeviceNotify/Info/UsbDeviceNotifyInfo.cs b/stage/LibUsbDotNet/DeviceNotify/Info/UsbDeviceNotifyInfo.cs similarity index 100% rename from stage/LibWinUsb/DeviceNotify/Info/UsbDeviceNotifyInfo.cs rename to stage/LibUsbDotNet/DeviceNotify/Info/UsbDeviceNotifyInfo.cs diff --git a/stage/LibWinUsb/DeviceNotify/Info/VolumeNotifyInfo.cs b/stage/LibUsbDotNet/DeviceNotify/Info/VolumeNotifyInfo.cs similarity index 100% rename from stage/LibWinUsb/DeviceNotify/Info/VolumeNotifyInfo.cs rename to stage/LibUsbDotNet/DeviceNotify/Info/VolumeNotifyInfo.cs diff --git a/stage/LibWinUsb/DeviceNotify/Internal/DevBroadcastDeviceinterface.cs b/stage/LibUsbDotNet/DeviceNotify/Internal/DevBroadcastDeviceinterface.cs similarity index 100% rename from stage/LibWinUsb/DeviceNotify/Internal/DevBroadcastDeviceinterface.cs rename to stage/LibUsbDotNet/DeviceNotify/Internal/DevBroadcastDeviceinterface.cs diff --git a/stage/LibWinUsb/DeviceNotify/Internal/DevBroadcastHdr.cs b/stage/LibUsbDotNet/DeviceNotify/Internal/DevBroadcastHdr.cs similarity index 100% rename from stage/LibWinUsb/DeviceNotify/Internal/DevBroadcastHdr.cs rename to stage/LibUsbDotNet/DeviceNotify/Internal/DevBroadcastHdr.cs diff --git a/stage/LibWinUsb/DeviceNotify/Internal/DevBroadcastPort.cs b/stage/LibUsbDotNet/DeviceNotify/Internal/DevBroadcastPort.cs similarity index 100% rename from stage/LibWinUsb/DeviceNotify/Internal/DevBroadcastPort.cs rename to stage/LibUsbDotNet/DeviceNotify/Internal/DevBroadcastPort.cs diff --git a/stage/LibWinUsb/DeviceNotify/Internal/DevBroadcastVolume.cs b/stage/LibUsbDotNet/DeviceNotify/Internal/DevBroadcastVolume.cs similarity index 100% rename from stage/LibWinUsb/DeviceNotify/Internal/DevBroadcastVolume.cs rename to stage/LibUsbDotNet/DeviceNotify/Internal/DevBroadcastVolume.cs diff --git a/stage/LibWinUsb/DeviceNotify/Internal/DevNotifyNativeWindow.cs b/stage/LibUsbDotNet/DeviceNotify/Internal/DevNotifyNativeWindow.cs similarity index 100% rename from stage/LibWinUsb/DeviceNotify/Internal/DevNotifyNativeWindow.cs rename to stage/LibUsbDotNet/DeviceNotify/Internal/DevNotifyNativeWindow.cs diff --git a/stage/LibWinUsb/DeviceNotify/Internal/SafeNotifyHandle.cs b/stage/LibUsbDotNet/DeviceNotify/Internal/SafeNotifyHandle.cs similarity index 100% rename from stage/LibWinUsb/DeviceNotify/Internal/SafeNotifyHandle.cs rename to stage/LibUsbDotNet/DeviceNotify/Internal/SafeNotifyHandle.cs diff --git a/stage/LibWinUsb/DeviceNotify/Linux/LinuxDevItem.cs b/stage/LibUsbDotNet/DeviceNotify/Linux/LinuxDevItem.cs similarity index 100% rename from stage/LibWinUsb/DeviceNotify/Linux/LinuxDevItem.cs rename to stage/LibUsbDotNet/DeviceNotify/Linux/LinuxDevItem.cs diff --git a/stage/LibWinUsb/DeviceNotify/Linux/LinuxDevItemList.cs b/stage/LibUsbDotNet/DeviceNotify/Linux/LinuxDevItemList.cs similarity index 100% rename from stage/LibWinUsb/DeviceNotify/Linux/LinuxDevItemList.cs rename to stage/LibUsbDotNet/DeviceNotify/Linux/LinuxDevItemList.cs diff --git a/stage/LibWinUsb/DeviceNotify/Linux/LinuxDeviceNotifier.DevMonitor.cs b/stage/LibUsbDotNet/DeviceNotify/Linux/LinuxDeviceNotifier.DevMonitor.cs similarity index 100% rename from stage/LibWinUsb/DeviceNotify/Linux/LinuxDeviceNotifier.DevMonitor.cs rename to stage/LibUsbDotNet/DeviceNotify/Linux/LinuxDeviceNotifier.DevMonitor.cs diff --git a/stage/LibWinUsb/DeviceNotify/Linux/LinuxDeviceNotifier.DeviceListPolling.cs b/stage/LibUsbDotNet/DeviceNotify/Linux/LinuxDeviceNotifier.DeviceListPolling.cs similarity index 100% rename from stage/LibWinUsb/DeviceNotify/Linux/LinuxDeviceNotifier.DeviceListPolling.cs rename to stage/LibUsbDotNet/DeviceNotify/Linux/LinuxDeviceNotifier.DeviceListPolling.cs diff --git a/stage/LibWinUsb/DeviceNotify/Linux/LinuxDeviceNotifier.cs b/stage/LibUsbDotNet/DeviceNotify/Linux/LinuxDeviceNotifier.cs similarity index 100% rename from stage/LibWinUsb/DeviceNotify/Linux/LinuxDeviceNotifier.cs rename to stage/LibUsbDotNet/DeviceNotify/Linux/LinuxDeviceNotifier.cs diff --git a/stage/LibWinUsb/DeviceNotify/Linux/LinuxDeviceNotifierMode.cs b/stage/LibUsbDotNet/DeviceNotify/Linux/LinuxDeviceNotifierMode.cs similarity index 100% rename from stage/LibWinUsb/DeviceNotify/Linux/LinuxDeviceNotifierMode.cs rename to stage/LibUsbDotNet/DeviceNotify/Linux/LinuxDeviceNotifierMode.cs diff --git a/stage/LibWinUsb/DeviceNotify/Linux/LinuxDeviceNotifyEventArgs.cs b/stage/LibUsbDotNet/DeviceNotify/Linux/LinuxDeviceNotifyEventArgs.cs similarity index 100% rename from stage/LibWinUsb/DeviceNotify/Linux/LinuxDeviceNotifyEventArgs.cs rename to stage/LibUsbDotNet/DeviceNotify/Linux/LinuxDeviceNotifyEventArgs.cs diff --git a/stage/LibWinUsb/DeviceNotify/Linux/LinuxUsbDeviceNotifyInfo.cs b/stage/LibUsbDotNet/DeviceNotify/Linux/LinuxUsbDeviceNotifyInfo.cs similarity index 100% rename from stage/LibWinUsb/DeviceNotify/Linux/LinuxUsbDeviceNotifyInfo.cs rename to stage/LibUsbDotNet/DeviceNotify/Linux/LinuxUsbDeviceNotifyInfo.cs diff --git a/stage/LibWinUsb/DeviceNotify/WindowsDeviceNotifier.cs b/stage/LibUsbDotNet/DeviceNotify/WindowsDeviceNotifier.cs similarity index 100% rename from stage/LibWinUsb/DeviceNotify/WindowsDeviceNotifier.cs rename to stage/LibUsbDotNet/DeviceNotify/WindowsDeviceNotifier.cs diff --git a/stage/LibWinUsb/DeviceNotify/WindowsDeviceNotifyEventArgs.cs b/stage/LibUsbDotNet/DeviceNotify/WindowsDeviceNotifyEventArgs.cs similarity index 100% rename from stage/LibWinUsb/DeviceNotify/WindowsDeviceNotifyEventArgs.cs rename to stage/LibUsbDotNet/DeviceNotify/WindowsDeviceNotifyEventArgs.cs diff --git a/stage/LibWinUsb/IUsbDevice.cs b/stage/LibUsbDotNet/IUsbDevice.cs similarity index 100% rename from stage/LibWinUsb/IUsbDevice.cs rename to stage/LibUsbDotNet/IUsbDevice.cs diff --git a/stage/LibWinUsb/IUsbInterface.cs b/stage/LibUsbDotNet/IUsbInterface.cs similarity index 100% rename from stage/LibWinUsb/IUsbInterface.cs rename to stage/LibUsbDotNet/IUsbInterface.cs diff --git a/stage/LibWinUsb/Info/UsbBaseInfo.cs b/stage/LibUsbDotNet/Info/UsbBaseInfo.cs similarity index 100% rename from stage/LibWinUsb/Info/UsbBaseInfo.cs rename to stage/LibUsbDotNet/Info/UsbBaseInfo.cs diff --git a/stage/LibWinUsb/Info/UsbConfigInfo.cs b/stage/LibUsbDotNet/Info/UsbConfigInfo.cs similarity index 100% rename from stage/LibWinUsb/Info/UsbConfigInfo.cs rename to stage/LibUsbDotNet/Info/UsbConfigInfo.cs diff --git a/stage/LibWinUsb/Info/UsbDeviceInfo.cs b/stage/LibUsbDotNet/Info/UsbDeviceInfo.cs similarity index 100% rename from stage/LibWinUsb/Info/UsbDeviceInfo.cs rename to stage/LibUsbDotNet/Info/UsbDeviceInfo.cs diff --git a/stage/LibWinUsb/Info/UsbEndpointInfo.cs b/stage/LibUsbDotNet/Info/UsbEndpointInfo.cs similarity index 100% rename from stage/LibWinUsb/Info/UsbEndpointInfo.cs rename to stage/LibUsbDotNet/Info/UsbEndpointInfo.cs diff --git a/stage/LibWinUsb/Info/UsbInterfaceInfo.cs b/stage/LibUsbDotNet/Info/UsbInterfaceInfo.cs similarity index 100% rename from stage/LibWinUsb/Info/UsbInterfaceInfo.cs rename to stage/LibUsbDotNet/Info/UsbInterfaceInfo.cs diff --git a/stage/LibWinUsb/Internal/Kernel32.cs b/stage/LibUsbDotNet/Internal/Kernel32.cs similarity index 100% rename from stage/LibWinUsb/Internal/Kernel32.cs rename to stage/LibUsbDotNet/Internal/Kernel32.cs diff --git a/stage/LibWinUsb/Internal/OverlappedTransferContext.cs b/stage/LibUsbDotNet/Internal/OverlappedTransferContext.cs similarity index 100% rename from stage/LibWinUsb/Internal/OverlappedTransferContext.cs rename to stage/LibUsbDotNet/Internal/OverlappedTransferContext.cs diff --git a/stage/LibWinUsb/Internal/SafeOverlapped.cs b/stage/LibUsbDotNet/Internal/SafeOverlapped.cs similarity index 100% rename from stage/LibWinUsb/Internal/SafeOverlapped.cs rename to stage/LibUsbDotNet/Internal/SafeOverlapped.cs diff --git a/stage/LibWinUsb/Internal/TransferContextBase.cs b/stage/LibUsbDotNet/Internal/TransferContextBase.cs similarity index 100% rename from stage/LibWinUsb/Internal/TransferContextBase.cs rename to stage/LibUsbDotNet/Internal/TransferContextBase.cs diff --git a/stage/LibWinUsb/Internal/UsbApiBase.cs b/stage/LibUsbDotNet/Internal/UsbApiBase.cs similarity index 100% rename from stage/LibWinUsb/Internal/UsbApiBase.cs rename to stage/LibUsbDotNet/Internal/UsbApiBase.cs diff --git a/stage/LibWinUsb/Internal/UsbRegex/BaseRegSymbolicName.cs b/stage/LibUsbDotNet/Internal/UsbRegex/BaseRegSymbolicName.cs similarity index 100% rename from stage/LibWinUsb/Internal/UsbRegex/BaseRegSymbolicName.cs rename to stage/LibUsbDotNet/Internal/UsbRegex/BaseRegSymbolicName.cs diff --git a/stage/LibWinUsb/Internal/UsbRegex/NamedGroup.cs b/stage/LibUsbDotNet/Internal/UsbRegex/NamedGroup.cs similarity index 100% rename from stage/LibWinUsb/Internal/UsbRegex/NamedGroup.cs rename to stage/LibUsbDotNet/Internal/UsbRegex/NamedGroup.cs diff --git a/stage/LibWinUsb/Internal/UsbRegex/RegHardwareID.cs b/stage/LibUsbDotNet/Internal/UsbRegex/RegHardwareID.cs similarity index 100% rename from stage/LibWinUsb/Internal/UsbRegex/RegHardwareID.cs rename to stage/LibUsbDotNet/Internal/UsbRegex/RegHardwareID.cs diff --git a/stage/LibWinUsb/Internal/UsbRegex/RegSymbolicName.cs b/stage/LibUsbDotNet/Internal/UsbRegex/RegSymbolicName.cs similarity index 100% rename from stage/LibWinUsb/Internal/UsbRegex/RegSymbolicName.cs rename to stage/LibUsbDotNet/Internal/UsbRegex/RegSymbolicName.cs diff --git a/stage/LibWinUsb/LibUsb/Internal/LibUsbAPI.cs b/stage/LibUsbDotNet/LibUsb/Internal/LibUsbAPI.cs similarity index 100% rename from stage/LibWinUsb/LibUsb/Internal/LibUsbAPI.cs rename to stage/LibUsbDotNet/LibUsb/Internal/LibUsbAPI.cs diff --git a/stage/LibWinUsb/LibUsb/Internal/LibUsbDriverIO.cs b/stage/LibUsbDotNet/LibUsb/Internal/LibUsbDriverIO.cs similarity index 100% rename from stage/LibWinUsb/LibUsb/Internal/LibUsbDriverIO.cs rename to stage/LibUsbDotNet/LibUsb/Internal/LibUsbDriverIO.cs diff --git a/stage/LibWinUsb/LibUsb/Internal/LibUsbDriverIO_IOControlMessage.cs b/stage/LibUsbDotNet/LibUsb/Internal/LibUsbDriverIO_IOControlMessage.cs similarity index 100% rename from stage/LibWinUsb/LibUsb/Internal/LibUsbDriverIO_IOControlMessage.cs rename to stage/LibUsbDotNet/LibUsb/Internal/LibUsbDriverIO_IOControlMessage.cs diff --git a/stage/LibWinUsb/LibUsb/Internal/LibUsbIoCtl.cs b/stage/LibUsbDotNet/LibUsb/Internal/LibUsbIoCtl.cs similarity index 100% rename from stage/LibWinUsb/LibUsb/Internal/LibUsbIoCtl.cs rename to stage/LibUsbDotNet/LibUsb/Internal/LibUsbIoCtl.cs diff --git a/stage/LibWinUsb/LibUsb/Internal/LibUsbRequest.cs b/stage/LibUsbDotNet/LibUsb/Internal/LibUsbRequest.cs similarity index 100% rename from stage/LibWinUsb/LibUsb/Internal/LibUsbRequest.cs rename to stage/LibUsbDotNet/LibUsb/Internal/LibUsbRequest.cs diff --git a/stage/LibWinUsb/LibUsb/LibUsbDevice.cs b/stage/LibUsbDotNet/LibUsb/LibUsbDevice.cs similarity index 100% rename from stage/LibWinUsb/LibUsb/LibUsbDevice.cs rename to stage/LibUsbDotNet/LibUsb/LibUsbDevice.cs diff --git a/stage/LibWinUsb/LibUsb/LibUsbDeviceRegistryKeyRequest.cs b/stage/LibUsbDotNet/LibUsb/LibUsbDeviceRegistryKeyRequest.cs similarity index 100% rename from stage/LibWinUsb/LibUsb/LibUsbDeviceRegistryKeyRequest.cs rename to stage/LibUsbDotNet/LibUsb/LibUsbDeviceRegistryKeyRequest.cs diff --git a/stage/LibWinUsb/LibUsb/LibUsbKernelType.cs b/stage/LibUsbDotNet/LibUsb/LibUsbKernelType.cs similarity index 100% rename from stage/LibWinUsb/LibUsb/LibUsbKernelType.cs rename to stage/LibUsbDotNet/LibUsb/LibUsbKernelType.cs diff --git a/stage/LibWinUsb/LibUsb/LibUsbRegistry.cs b/stage/LibUsbDotNet/LibUsb/LibUsbRegistry.cs similarity index 100% rename from stage/LibWinUsb/LibUsb/LibUsbRegistry.cs rename to stage/LibUsbDotNet/LibUsb/LibUsbRegistry.cs diff --git a/stage/LibWinUsb/LibUsbDotNet.csproj b/stage/LibUsbDotNet/LibUsbDotNet.csproj similarity index 100% rename from stage/LibWinUsb/LibUsbDotNet.csproj rename to stage/LibUsbDotNet/LibUsbDotNet.csproj diff --git a/stage/LibWinUsb/LibUsbDotNet.snk b/stage/LibUsbDotNet/LibUsbDotNet.snk similarity index 100% rename from stage/LibWinUsb/LibUsbDotNet.snk rename to stage/LibUsbDotNet/LibUsbDotNet.snk diff --git a/stage/LibWinUsb/Main/ControlEpLockType.cs b/stage/LibUsbDotNet/Main/ControlEpLockType.cs similarity index 100% rename from stage/LibWinUsb/Main/ControlEpLockType.cs rename to stage/LibUsbDotNet/Main/ControlEpLockType.cs diff --git a/stage/LibWinUsb/Main/DataEpLockType.cs b/stage/LibUsbDotNet/Main/DataEpLockType.cs similarity index 100% rename from stage/LibWinUsb/Main/DataEpLockType.cs rename to stage/LibUsbDotNet/Main/DataEpLockType.cs diff --git a/stage/LibWinUsb/Main/DataReceivedEnabledChangedEventArgs.cs b/stage/LibUsbDotNet/Main/DataReceivedEnabledChangedEventArgs.cs similarity index 100% rename from stage/LibWinUsb/Main/DataReceivedEnabledChangedEventArgs.cs rename to stage/LibUsbDotNet/Main/DataReceivedEnabledChangedEventArgs.cs diff --git a/stage/LibWinUsb/Main/DeviceLockType.cs b/stage/LibUsbDotNet/Main/DeviceLockType.cs similarity index 100% rename from stage/LibWinUsb/Main/DeviceLockType.cs rename to stage/LibUsbDotNet/Main/DeviceLockType.cs diff --git a/stage/LibWinUsb/Main/DevicePropertyType.cs b/stage/LibUsbDotNet/Main/DevicePropertyType.cs similarity index 100% rename from stage/LibWinUsb/Main/DevicePropertyType.cs rename to stage/LibUsbDotNet/Main/DevicePropertyType.cs diff --git a/stage/LibWinUsb/Main/EndpointDataEventArgs.cs b/stage/LibUsbDotNet/Main/EndpointDataEventArgs.cs similarity index 100% rename from stage/LibWinUsb/Main/EndpointDataEventArgs.cs rename to stage/LibUsbDotNet/Main/EndpointDataEventArgs.cs diff --git a/stage/LibWinUsb/Main/EndpointType.cs b/stage/LibUsbDotNet/Main/EndpointType.cs similarity index 100% rename from stage/LibWinUsb/Main/EndpointType.cs rename to stage/LibUsbDotNet/Main/EndpointType.cs diff --git a/stage/LibWinUsb/Main/ErrorCode.cs b/stage/LibUsbDotNet/Main/ErrorCode.cs similarity index 100% rename from stage/LibWinUsb/Main/ErrorCode.cs rename to stage/LibUsbDotNet/Main/ErrorCode.cs diff --git a/stage/LibWinUsb/Main/Helper.cs b/stage/LibUsbDotNet/Main/Helper.cs similarity index 100% rename from stage/LibWinUsb/Main/Helper.cs rename to stage/LibUsbDotNet/Main/Helper.cs diff --git a/stage/LibWinUsb/Main/LegacyUsbRegistry.cs b/stage/LibUsbDotNet/Main/LegacyUsbRegistry.cs similarity index 100% rename from stage/LibWinUsb/Main/LegacyUsbRegistry.cs rename to stage/LibUsbDotNet/Main/LegacyUsbRegistry.cs diff --git a/stage/LibWinUsb/Main/ReadEndpointID.cs b/stage/LibUsbDotNet/Main/ReadEndpointID.cs similarity index 100% rename from stage/LibWinUsb/Main/ReadEndpointID.cs rename to stage/LibUsbDotNet/Main/ReadEndpointID.cs diff --git a/stage/LibWinUsb/Main/SPDRP.cs b/stage/LibUsbDotNet/Main/SPDRP.cs similarity index 100% rename from stage/LibWinUsb/Main/SPDRP.cs rename to stage/LibUsbDotNet/Main/SPDRP.cs diff --git a/stage/LibWinUsb/Main/SafeContextHandle.cs b/stage/LibUsbDotNet/Main/SafeContextHandle.cs similarity index 100% rename from stage/LibWinUsb/Main/SafeContextHandle.cs rename to stage/LibUsbDotNet/Main/SafeContextHandle.cs diff --git a/stage/LibWinUsb/Main/SetupApiRegistry.cs b/stage/LibUsbDotNet/Main/SetupApiRegistry.cs similarity index 100% rename from stage/LibWinUsb/Main/SetupApiRegistry.cs rename to stage/LibUsbDotNet/Main/SetupApiRegistry.cs diff --git a/stage/LibWinUsb/Main/UsbConstants.cs b/stage/LibUsbDotNet/Main/UsbConstants.cs similarity index 100% rename from stage/LibWinUsb/Main/UsbConstants.cs rename to stage/LibUsbDotNet/Main/UsbConstants.cs diff --git a/stage/LibWinUsb/Main/UsbCtrlFlags.cs b/stage/LibUsbDotNet/Main/UsbCtrlFlags.cs similarity index 100% rename from stage/LibWinUsb/Main/UsbCtrlFlags.cs rename to stage/LibUsbDotNet/Main/UsbCtrlFlags.cs diff --git a/stage/LibWinUsb/Main/UsbDeviceFinder.cs b/stage/LibUsbDotNet/Main/UsbDeviceFinder.cs similarity index 100% rename from stage/LibWinUsb/Main/UsbDeviceFinder.cs rename to stage/LibUsbDotNet/Main/UsbDeviceFinder.cs diff --git a/stage/LibWinUsb/Main/UsbEndpointBase.cs b/stage/LibUsbDotNet/Main/UsbEndpointBase.cs similarity index 100% rename from stage/LibWinUsb/Main/UsbEndpointBase.cs rename to stage/LibUsbDotNet/Main/UsbEndpointBase.cs diff --git a/stage/LibWinUsb/Main/UsbEndpointDirection.cs b/stage/LibUsbDotNet/Main/UsbEndpointDirection.cs similarity index 100% rename from stage/LibWinUsb/Main/UsbEndpointDirection.cs rename to stage/LibUsbDotNet/Main/UsbEndpointDirection.cs diff --git a/stage/LibWinUsb/Main/UsbEndpointList.cs b/stage/LibUsbDotNet/Main/UsbEndpointList.cs similarity index 100% rename from stage/LibWinUsb/Main/UsbEndpointList.cs rename to stage/LibUsbDotNet/Main/UsbEndpointList.cs diff --git a/stage/LibWinUsb/Main/UsbException.cs b/stage/LibUsbDotNet/Main/UsbException.cs similarity index 100% rename from stage/LibWinUsb/Main/UsbException.cs rename to stage/LibUsbDotNet/Main/UsbException.cs diff --git a/stage/LibWinUsb/Main/UsbKernelVersion.cs b/stage/LibUsbDotNet/Main/UsbKernelVersion.cs similarity index 100% rename from stage/LibWinUsb/Main/UsbKernelVersion.cs rename to stage/LibUsbDotNet/Main/UsbKernelVersion.cs diff --git a/stage/LibWinUsb/Main/UsbLockStyle.cs b/stage/LibUsbDotNet/Main/UsbLockStyle.cs similarity index 100% rename from stage/LibWinUsb/Main/UsbLockStyle.cs rename to stage/LibUsbDotNet/Main/UsbLockStyle.cs diff --git a/stage/LibWinUsb/Main/UsbRegDeviceList.cs b/stage/LibUsbDotNet/Main/UsbRegDeviceList.cs similarity index 100% rename from stage/LibWinUsb/Main/UsbRegDeviceList.cs rename to stage/LibUsbDotNet/Main/UsbRegDeviceList.cs diff --git a/stage/LibWinUsb/Main/UsbRegistry.cs b/stage/LibUsbDotNet/Main/UsbRegistry.cs similarity index 100% rename from stage/LibWinUsb/Main/UsbRegistry.cs rename to stage/LibUsbDotNet/Main/UsbRegistry.cs diff --git a/stage/LibWinUsb/Main/UsbRequestRecipient.cs b/stage/LibUsbDotNet/Main/UsbRequestRecipient.cs similarity index 100% rename from stage/LibWinUsb/Main/UsbRequestRecipient.cs rename to stage/LibUsbDotNet/Main/UsbRequestRecipient.cs diff --git a/stage/LibWinUsb/Main/UsbRequestType.cs b/stage/LibUsbDotNet/Main/UsbRequestType.cs similarity index 100% rename from stage/LibWinUsb/Main/UsbRequestType.cs rename to stage/LibUsbDotNet/Main/UsbRequestType.cs diff --git a/stage/LibWinUsb/Main/UsbSetupPacket.cs b/stage/LibUsbDotNet/Main/UsbSetupPacket.cs similarity index 100% rename from stage/LibWinUsb/Main/UsbSetupPacket.cs rename to stage/LibUsbDotNet/Main/UsbSetupPacket.cs diff --git a/stage/LibWinUsb/Main/UsbStandardRequest.cs b/stage/LibUsbDotNet/Main/UsbStandardRequest.cs similarity index 100% rename from stage/LibWinUsb/Main/UsbStandardRequest.cs rename to stage/LibUsbDotNet/Main/UsbStandardRequest.cs diff --git a/stage/LibWinUsb/Main/UsbStatusClodes.cs b/stage/LibUsbDotNet/Main/UsbStatusClodes.cs similarity index 100% rename from stage/LibWinUsb/Main/UsbStatusClodes.cs rename to stage/LibUsbDotNet/Main/UsbStatusClodes.cs diff --git a/stage/LibWinUsb/Main/UsbStream.cs b/stage/LibUsbDotNet/Main/UsbStream.cs similarity index 100% rename from stage/LibWinUsb/Main/UsbStream.cs rename to stage/LibUsbDotNet/Main/UsbStream.cs diff --git a/stage/LibWinUsb/Main/UsbSymbolicName.cs b/stage/LibUsbDotNet/Main/UsbSymbolicName.cs similarity index 100% rename from stage/LibWinUsb/Main/UsbSymbolicName.cs rename to stage/LibUsbDotNet/Main/UsbSymbolicName.cs diff --git a/stage/LibWinUsb/Main/UsbTransfer.cs b/stage/LibUsbDotNet/Main/UsbTransfer.cs similarity index 100% rename from stage/LibWinUsb/Main/UsbTransfer.cs rename to stage/LibUsbDotNet/Main/UsbTransfer.cs diff --git a/stage/LibWinUsb/Main/WriteEndpointID.cs b/stage/LibUsbDotNet/Main/WriteEndpointID.cs similarity index 100% rename from stage/LibWinUsb/Main/WriteEndpointID.cs rename to stage/LibUsbDotNet/Main/WriteEndpointID.cs diff --git a/stage/LibWinUsb/MonoLibUsb/CallbackDelegates.cs b/stage/LibUsbDotNet/MonoLibUsb/CallbackDelegates.cs similarity index 100% rename from stage/LibWinUsb/MonoLibUsb/CallbackDelegates.cs rename to stage/LibUsbDotNet/MonoLibUsb/CallbackDelegates.cs diff --git a/stage/LibWinUsb/MonoLibUsb/Descriptors/MonoUsbAltInterfaceDescriptor.cs b/stage/LibUsbDotNet/MonoLibUsb/Descriptors/MonoUsbAltInterfaceDescriptor.cs similarity index 100% rename from stage/LibWinUsb/MonoLibUsb/Descriptors/MonoUsbAltInterfaceDescriptor.cs rename to stage/LibUsbDotNet/MonoLibUsb/Descriptors/MonoUsbAltInterfaceDescriptor.cs diff --git a/stage/LibWinUsb/MonoLibUsb/Descriptors/MonoUsbConfigDescriptor.cs b/stage/LibUsbDotNet/MonoLibUsb/Descriptors/MonoUsbConfigDescriptor.cs similarity index 100% rename from stage/LibWinUsb/MonoLibUsb/Descriptors/MonoUsbConfigDescriptor.cs rename to stage/LibUsbDotNet/MonoLibUsb/Descriptors/MonoUsbConfigDescriptor.cs diff --git a/stage/LibWinUsb/MonoLibUsb/Descriptors/MonoUsbDeviceDescriptor.cs b/stage/LibUsbDotNet/MonoLibUsb/Descriptors/MonoUsbDeviceDescriptor.cs similarity index 100% rename from stage/LibWinUsb/MonoLibUsb/Descriptors/MonoUsbDeviceDescriptor.cs rename to stage/LibUsbDotNet/MonoLibUsb/Descriptors/MonoUsbDeviceDescriptor.cs diff --git a/stage/LibWinUsb/MonoLibUsb/Descriptors/MonoUsbEndpointDescriptor.cs b/stage/LibUsbDotNet/MonoLibUsb/Descriptors/MonoUsbEndpointDescriptor.cs similarity index 100% rename from stage/LibWinUsb/MonoLibUsb/Descriptors/MonoUsbEndpointDescriptor.cs rename to stage/LibUsbDotNet/MonoLibUsb/Descriptors/MonoUsbEndpointDescriptor.cs diff --git a/stage/LibWinUsb/MonoLibUsb/Descriptors/MonoUsbInterface.cs b/stage/LibUsbDotNet/MonoLibUsb/Descriptors/MonoUsbInterface.cs similarity index 100% rename from stage/LibWinUsb/MonoLibUsb/Descriptors/MonoUsbInterface.cs rename to stage/LibUsbDotNet/MonoLibUsb/Descriptors/MonoUsbInterface.cs diff --git a/stage/LibWinUsb/MonoLibUsb/MonoLibUsbApi.cs b/stage/LibUsbDotNet/MonoLibUsb/MonoLibUsbApi.cs similarity index 100% rename from stage/LibWinUsb/MonoLibUsb/MonoLibUsbApi.cs rename to stage/LibUsbDotNet/MonoLibUsb/MonoLibUsbApi.cs diff --git a/stage/LibWinUsb/MonoLibUsb/MonoUsbDevice.cs b/stage/LibUsbDotNet/MonoLibUsb/MonoUsbDevice.cs similarity index 100% rename from stage/LibWinUsb/MonoLibUsb/MonoUsbDevice.cs rename to stage/LibUsbDotNet/MonoLibUsb/MonoUsbDevice.cs diff --git a/stage/LibWinUsb/MonoLibUsb/MonoUsbDeviceHandle.cs b/stage/LibUsbDotNet/MonoLibUsb/MonoUsbDeviceHandle.cs similarity index 100% rename from stage/LibWinUsb/MonoLibUsb/MonoUsbDeviceHandle.cs rename to stage/LibUsbDotNet/MonoLibUsb/MonoUsbDeviceHandle.cs diff --git a/stage/LibWinUsb/MonoLibUsb/MonoUsbEndpointReader.cs b/stage/LibUsbDotNet/MonoLibUsb/MonoUsbEndpointReader.cs similarity index 100% rename from stage/LibWinUsb/MonoLibUsb/MonoUsbEndpointReader.cs rename to stage/LibUsbDotNet/MonoLibUsb/MonoUsbEndpointReader.cs diff --git a/stage/LibWinUsb/MonoLibUsb/MonoUsbEndpointWriter.cs b/stage/LibUsbDotNet/MonoLibUsb/MonoUsbEndpointWriter.cs similarity index 100% rename from stage/LibWinUsb/MonoLibUsb/MonoUsbEndpointWriter.cs rename to stage/LibUsbDotNet/MonoLibUsb/MonoUsbEndpointWriter.cs diff --git a/stage/LibWinUsb/MonoLibUsb/MonoUsbError.cs b/stage/LibUsbDotNet/MonoLibUsb/MonoUsbError.cs similarity index 100% rename from stage/LibWinUsb/MonoLibUsb/MonoUsbError.cs rename to stage/LibUsbDotNet/MonoLibUsb/MonoUsbError.cs diff --git a/stage/LibWinUsb/MonoLibUsb/MonoUsbEventHandler.cs b/stage/LibUsbDotNet/MonoLibUsb/MonoUsbEventHandler.cs similarity index 100% rename from stage/LibWinUsb/MonoLibUsb/MonoUsbEventHandler.cs rename to stage/LibUsbDotNet/MonoLibUsb/MonoUsbEventHandler.cs diff --git a/stage/LibWinUsb/MonoLibUsb/MonoUsbSessionHandle.cs b/stage/LibUsbDotNet/MonoLibUsb/MonoUsbSessionHandle.cs similarity index 100% rename from stage/LibWinUsb/MonoLibUsb/MonoUsbSessionHandle.cs rename to stage/LibUsbDotNet/MonoLibUsb/MonoUsbSessionHandle.cs diff --git a/stage/LibWinUsb/MonoLibUsb/Profile/AddRemoveEventArgs.cs b/stage/LibUsbDotNet/MonoLibUsb/Profile/AddRemoveEventArgs.cs similarity index 100% rename from stage/LibWinUsb/MonoLibUsb/Profile/AddRemoveEventArgs.cs rename to stage/LibUsbDotNet/MonoLibUsb/Profile/AddRemoveEventArgs.cs diff --git a/stage/LibWinUsb/MonoLibUsb/Profile/AddRemoveType.cs b/stage/LibUsbDotNet/MonoLibUsb/Profile/AddRemoveType.cs similarity index 100% rename from stage/LibWinUsb/MonoLibUsb/Profile/AddRemoveType.cs rename to stage/LibUsbDotNet/MonoLibUsb/Profile/AddRemoveType.cs diff --git a/stage/LibWinUsb/MonoLibUsb/Profile/MonoUsbConfigHandle.cs b/stage/LibUsbDotNet/MonoLibUsb/Profile/MonoUsbConfigHandle.cs similarity index 100% rename from stage/LibWinUsb/MonoLibUsb/Profile/MonoUsbConfigHandle.cs rename to stage/LibUsbDotNet/MonoLibUsb/Profile/MonoUsbConfigHandle.cs diff --git a/stage/LibWinUsb/MonoLibUsb/Profile/MonoUsbProfile.cs b/stage/LibUsbDotNet/MonoLibUsb/Profile/MonoUsbProfile.cs similarity index 100% rename from stage/LibWinUsb/MonoLibUsb/Profile/MonoUsbProfile.cs rename to stage/LibUsbDotNet/MonoLibUsb/Profile/MonoUsbProfile.cs diff --git a/stage/LibWinUsb/MonoLibUsb/Profile/MonoUsbProfileHandle.cs b/stage/LibUsbDotNet/MonoLibUsb/Profile/MonoUsbProfileHandle.cs similarity index 100% rename from stage/LibWinUsb/MonoLibUsb/Profile/MonoUsbProfileHandle.cs rename to stage/LibUsbDotNet/MonoLibUsb/Profile/MonoUsbProfileHandle.cs diff --git a/stage/LibWinUsb/MonoLibUsb/Profile/MonoUsbProfileHandleEnumerator.cs b/stage/LibUsbDotNet/MonoLibUsb/Profile/MonoUsbProfileHandleEnumerator.cs similarity index 100% rename from stage/LibWinUsb/MonoLibUsb/Profile/MonoUsbProfileHandleEnumerator.cs rename to stage/LibUsbDotNet/MonoLibUsb/Profile/MonoUsbProfileHandleEnumerator.cs diff --git a/stage/LibWinUsb/MonoLibUsb/Profile/MonoUsbProfileList.cs b/stage/LibUsbDotNet/MonoLibUsb/Profile/MonoUsbProfileList.cs similarity index 100% rename from stage/LibWinUsb/MonoLibUsb/Profile/MonoUsbProfileList.cs rename to stage/LibUsbDotNet/MonoLibUsb/Profile/MonoUsbProfileList.cs diff --git a/stage/LibWinUsb/MonoLibUsb/Profile/MonoUsbProfileListHandle.cs b/stage/LibUsbDotNet/MonoLibUsb/Profile/MonoUsbProfileListHandle.cs similarity index 100% rename from stage/LibWinUsb/MonoLibUsb/Profile/MonoUsbProfileListHandle.cs rename to stage/LibUsbDotNet/MonoLibUsb/Profile/MonoUsbProfileListHandle.cs diff --git a/stage/LibWinUsb/MonoLibUsb/Profile/PollfdItem.cs b/stage/LibUsbDotNet/MonoLibUsb/Profile/PollfdItem.cs similarity index 100% rename from stage/LibWinUsb/MonoLibUsb/Profile/PollfdItem.cs rename to stage/LibUsbDotNet/MonoLibUsb/Profile/PollfdItem.cs diff --git a/stage/LibWinUsb/MonoLibUsb/Transfer/Internal/libusb_control_setup.cs b/stage/LibUsbDotNet/MonoLibUsb/Transfer/Internal/libusb_control_setup.cs similarity index 100% rename from stage/LibWinUsb/MonoLibUsb/Transfer/Internal/libusb_control_setup.cs rename to stage/LibUsbDotNet/MonoLibUsb/Transfer/Internal/libusb_control_setup.cs diff --git a/stage/LibWinUsb/MonoLibUsb/Transfer/Internal/libusb_iso_packet_descriptor.cs b/stage/LibUsbDotNet/MonoLibUsb/Transfer/Internal/libusb_iso_packet_descriptor.cs similarity index 100% rename from stage/LibWinUsb/MonoLibUsb/Transfer/Internal/libusb_iso_packet_descriptor.cs rename to stage/LibUsbDotNet/MonoLibUsb/Transfer/Internal/libusb_iso_packet_descriptor.cs diff --git a/stage/LibWinUsb/MonoLibUsb/Transfer/Internal/libusb_transfer.cs b/stage/LibUsbDotNet/MonoLibUsb/Transfer/Internal/libusb_transfer.cs similarity index 100% rename from stage/LibWinUsb/MonoLibUsb/Transfer/Internal/libusb_transfer.cs rename to stage/LibUsbDotNet/MonoLibUsb/Transfer/Internal/libusb_transfer.cs diff --git a/stage/LibWinUsb/MonoLibUsb/Transfer/MonoUsbControlSetup.cs b/stage/LibUsbDotNet/MonoLibUsb/Transfer/MonoUsbControlSetup.cs similarity index 100% rename from stage/LibWinUsb/MonoLibUsb/Transfer/MonoUsbControlSetup.cs rename to stage/LibUsbDotNet/MonoLibUsb/Transfer/MonoUsbControlSetup.cs diff --git a/stage/LibWinUsb/MonoLibUsb/Transfer/MonoUsbControlSetupHandle.cs b/stage/LibUsbDotNet/MonoLibUsb/Transfer/MonoUsbControlSetupHandle.cs similarity index 100% rename from stage/LibWinUsb/MonoLibUsb/Transfer/MonoUsbControlSetupHandle.cs rename to stage/LibUsbDotNet/MonoLibUsb/Transfer/MonoUsbControlSetupHandle.cs diff --git a/stage/LibWinUsb/MonoLibUsb/Transfer/MonoUsbIsoPacket.cs b/stage/LibUsbDotNet/MonoLibUsb/Transfer/MonoUsbIsoPacket.cs similarity index 100% rename from stage/LibWinUsb/MonoLibUsb/Transfer/MonoUsbIsoPacket.cs rename to stage/LibUsbDotNet/MonoLibUsb/Transfer/MonoUsbIsoPacket.cs diff --git a/stage/LibWinUsb/MonoLibUsb/Transfer/MonoUsbTansferStatus.cs b/stage/LibUsbDotNet/MonoLibUsb/Transfer/MonoUsbTansferStatus.cs similarity index 100% rename from stage/LibWinUsb/MonoLibUsb/Transfer/MonoUsbTansferStatus.cs rename to stage/LibUsbDotNet/MonoLibUsb/Transfer/MonoUsbTansferStatus.cs diff --git a/stage/LibWinUsb/MonoLibUsb/Transfer/MonoUsbTransfer.cs b/stage/LibUsbDotNet/MonoLibUsb/Transfer/MonoUsbTransfer.cs similarity index 100% rename from stage/LibWinUsb/MonoLibUsb/Transfer/MonoUsbTransfer.cs rename to stage/LibUsbDotNet/MonoLibUsb/Transfer/MonoUsbTransfer.cs diff --git a/stage/LibWinUsb/MonoLibUsb/Transfer/MonoUsbTransferContext.cs b/stage/LibUsbDotNet/MonoLibUsb/Transfer/MonoUsbTransferContext.cs similarity index 100% rename from stage/LibWinUsb/MonoLibUsb/Transfer/MonoUsbTransferContext.cs rename to stage/LibUsbDotNet/MonoLibUsb/Transfer/MonoUsbTransferContext.cs diff --git a/stage/LibWinUsb/MonoLibUsb/Transfer/MonoUsbTransferFlags.cs b/stage/LibUsbDotNet/MonoLibUsb/Transfer/MonoUsbTransferFlags.cs similarity index 100% rename from stage/LibWinUsb/MonoLibUsb/Transfer/MonoUsbTransferFlags.cs rename to stage/LibUsbDotNet/MonoLibUsb/Transfer/MonoUsbTransferFlags.cs diff --git a/stage/LibWinUsb/MonoLibUsb/UnixNativeTimeval.cs b/stage/LibUsbDotNet/MonoLibUsb/UnixNativeTimeval.cs similarity index 100% rename from stage/LibWinUsb/MonoLibUsb/UnixNativeTimeval.cs rename to stage/LibUsbDotNet/MonoLibUsb/UnixNativeTimeval.cs diff --git a/stage/LibWinUsb/Properties/AssemblyInfo.cs b/stage/LibUsbDotNet/Properties/AssemblyInfo.cs similarity index 100% rename from stage/LibWinUsb/Properties/AssemblyInfo.cs rename to stage/LibUsbDotNet/Properties/AssemblyInfo.cs diff --git a/stage/LibWinUsb/UsbDevice.Common.cs b/stage/LibUsbDotNet/UsbDevice.Common.cs similarity index 100% rename from stage/LibWinUsb/UsbDevice.Common.cs rename to stage/LibUsbDotNet/UsbDevice.Common.cs diff --git a/stage/LibWinUsb/UsbDevice.Error.cs b/stage/LibUsbDotNet/UsbDevice.Error.cs similarity index 100% rename from stage/LibWinUsb/UsbDevice.Error.cs rename to stage/LibUsbDotNet/UsbDevice.Error.cs diff --git a/stage/LibWinUsb/UsbDevice.OS.Specific.cs b/stage/LibUsbDotNet/UsbDevice.OS.Specific.cs similarity index 100% rename from stage/LibWinUsb/UsbDevice.OS.Specific.cs rename to stage/LibUsbDotNet/UsbDevice.OS.Specific.cs diff --git a/stage/LibWinUsb/UsbDevice.cs b/stage/LibUsbDotNet/UsbDevice.cs similarity index 100% rename from stage/LibWinUsb/UsbDevice.cs rename to stage/LibUsbDotNet/UsbDevice.cs diff --git a/stage/LibWinUsb/UsbEndpointReader.cs b/stage/LibUsbDotNet/UsbEndpointReader.cs similarity index 100% rename from stage/LibWinUsb/UsbEndpointReader.cs rename to stage/LibUsbDotNet/UsbEndpointReader.cs diff --git a/stage/LibWinUsb/UsbEndpointWriter.cs b/stage/LibUsbDotNet/UsbEndpointWriter.cs similarity index 100% rename from stage/LibWinUsb/UsbEndpointWriter.cs rename to stage/LibUsbDotNet/UsbEndpointWriter.cs diff --git a/stage/LibWinUsb/UsbGlobals.cs b/stage/LibUsbDotNet/UsbGlobals.cs similarity index 100% rename from stage/LibWinUsb/UsbGlobals.cs rename to stage/LibUsbDotNet/UsbGlobals.cs diff --git a/stage/LibWinUsb/WinUsb/DeviceInformationTypes.cs b/stage/LibUsbDotNet/WinUsb/DeviceInformationTypes.cs similarity index 100% rename from stage/LibWinUsb/WinUsb/DeviceInformationTypes.cs rename to stage/LibUsbDotNet/WinUsb/DeviceInformationTypes.cs diff --git a/stage/LibWinUsb/WinUsb/DeviceSpeedTypes.cs b/stage/LibUsbDotNet/WinUsb/DeviceSpeedTypes.cs similarity index 100% rename from stage/LibWinUsb/WinUsb/DeviceSpeedTypes.cs rename to stage/LibUsbDotNet/WinUsb/DeviceSpeedTypes.cs diff --git a/stage/LibWinUsb/WinUsb/Internal/SafeWinUsbInterfaceHandle.cs b/stage/LibUsbDotNet/WinUsb/Internal/SafeWinUsbInterfaceHandle.cs similarity index 100% rename from stage/LibWinUsb/WinUsb/Internal/SafeWinUsbInterfaceHandle.cs rename to stage/LibUsbDotNet/WinUsb/Internal/SafeWinUsbInterfaceHandle.cs diff --git a/stage/LibWinUsb/WinUsb/Internal/WinUsbAPI.cs b/stage/LibUsbDotNet/WinUsb/Internal/WinUsbAPI.cs similarity index 100% rename from stage/LibWinUsb/WinUsb/Internal/WinUsbAPI.cs rename to stage/LibUsbDotNet/WinUsb/Internal/WinUsbAPI.cs diff --git a/stage/LibWinUsb/WinUsb/PipeInformation.cs b/stage/LibUsbDotNet/WinUsb/PipeInformation.cs similarity index 100% rename from stage/LibWinUsb/WinUsb/PipeInformation.cs rename to stage/LibUsbDotNet/WinUsb/PipeInformation.cs diff --git a/stage/LibWinUsb/WinUsb/PipePolicies.cs b/stage/LibUsbDotNet/WinUsb/PipePolicies.cs similarity index 100% rename from stage/LibWinUsb/WinUsb/PipePolicies.cs rename to stage/LibUsbDotNet/WinUsb/PipePolicies.cs diff --git a/stage/LibWinUsb/WinUsb/PipePolicyType.cs b/stage/LibUsbDotNet/WinUsb/PipePolicyType.cs similarity index 100% rename from stage/LibWinUsb/WinUsb/PipePolicyType.cs rename to stage/LibUsbDotNet/WinUsb/PipePolicyType.cs diff --git a/stage/LibWinUsb/WinUsb/PowerPolicies.cs b/stage/LibUsbDotNet/WinUsb/PowerPolicies.cs similarity index 100% rename from stage/LibWinUsb/WinUsb/PowerPolicies.cs rename to stage/LibUsbDotNet/WinUsb/PowerPolicies.cs diff --git a/stage/LibWinUsb/WinUsb/PowerPolicyType.cs b/stage/LibUsbDotNet/WinUsb/PowerPolicyType.cs similarity index 100% rename from stage/LibWinUsb/WinUsb/PowerPolicyType.cs rename to stage/LibUsbDotNet/WinUsb/PowerPolicyType.cs diff --git a/stage/LibWinUsb/WinUsb/WinUsbDevice.cs b/stage/LibUsbDotNet/WinUsb/WinUsbDevice.cs similarity index 100% rename from stage/LibWinUsb/WinUsb/WinUsbDevice.cs rename to stage/LibUsbDotNet/WinUsb/WinUsbDevice.cs diff --git a/stage/LibWinUsb/WinUsb/WinUsbRegistry.cs b/stage/LibUsbDotNet/WinUsb/WinUsbRegistry.cs similarity index 100% rename from stage/LibWinUsb/WinUsb/WinUsbRegistry.cs rename to stage/LibUsbDotNet/WinUsb/WinUsbRegistry.cs From 9f187619fa21c9e1882b34db40d8f4867f70002a Mon Sep 17 00:00:00 2001 From: Frederik Carlier Date: Tue, 9 Aug 2016 15:34:09 +0200 Subject: [PATCH 04/13] .NET Core compatibility --- .../DeviceNotify/DeviceNotifier.cs | 4 +- .../DeviceNotify/Info/PortNotifyInfo.cs | 2 +- .../DeviceNotify/Info/UsbDeviceNotifyInfo.cs | 2 +- .../Internal/DevNotifyNativeWindow.cs | 4 +- .../SafeHandleZeroOrMinusOneIsInvalid.cs | 25 + .../DeviceNotify/Internal/SafeNotifyHandle.cs | 4 +- .../Linux/LinuxDeviceNotifier.DevMonitor.cs | 11 +- .../LinuxDeviceNotifier.DeviceListPolling.cs | 15 +- .../DeviceNotify/WindowsDeviceNotifier.cs | 4 +- stage/LibUsbDotNet/Info/UsbDeviceInfo.cs | 5 +- stage/LibUsbDotNet/Internal/Kernel32.cs | 14 +- .../Internal/OverlappedTransferContext.cs | 10 +- .../Internal/RegistryKeyPermissionCheck.cs | 11 + stage/LibUsbDotNet/Internal/SetupApi.cs | 670 ++++++++++++++++++ .../Internal/TransferContextBase.cs | 8 +- .../LibUsb/Internal/LibUsbDriverIO.cs | 9 +- stage/LibUsbDotNet/LibUsb/LibUsbDevice.cs | 2 +- stage/LibUsbDotNet/LibUsb/LibUsbRegistry.cs | 4 +- stage/LibUsbDotNet/Main/Helper.cs | 17 +- stage/LibUsbDotNet/Main/LegacyUsbRegistry.cs | 4 +- .../Main/ManualResetEventExtensions.cs | 15 + stage/LibUsbDotNet/Main/SetupApiRegistry.cs | 6 +- stage/LibUsbDotNet/Main/UsbDeviceFinder.cs | 17 +- stage/LibUsbDotNet/Main/UsbStream.cs | 4 +- stage/LibUsbDotNet/Main/UsbTransfer.cs | 6 +- .../LibUsbDotNet/MonoLibUsb/MonoLibUsbApi.cs | 6 +- .../LibUsbDotNet/MonoLibUsb/MonoUsbDevice.cs | 8 +- .../MonoLibUsb/MonoUsbDeviceHandle.cs | 12 - .../MonoLibUsb/MonoUsbEventHandler.cs | 12 +- .../MonoLibUsb/MonoUsbSessionHandle.cs | 2 +- .../MonoLibUsb/Profile/MonoUsbProfile.cs | 2 +- .../Profile/MonoUsbProfileHandle.cs | 2 +- .../MonoLibUsb/Profile/MonoUsbProfileList.cs | 4 +- .../Transfer/MonoUsbControlSetupHandle.cs | 2 +- .../Transfer/MonoUsbTransferContext.cs | 11 +- stage/LibUsbDotNet/UsbDevice.OS.Specific.cs | 3 +- stage/LibUsbDotNet/UsbEndpointReader.cs | 19 +- .../LibUsbDotNet/WinUsb/Internal/WinUsbAPI.cs | 2 + stage/LibUsbDotNet/WinUsb/WinUsbDevice.cs | 4 +- 39 files changed, 868 insertions(+), 94 deletions(-) create mode 100644 stage/LibUsbDotNet/DeviceNotify/Internal/SafeHandleZeroOrMinusOneIsInvalid.cs create mode 100644 stage/LibUsbDotNet/Internal/RegistryKeyPermissionCheck.cs create mode 100644 stage/LibUsbDotNet/Internal/SetupApi.cs create mode 100644 stage/LibUsbDotNet/Main/ManualResetEventExtensions.cs diff --git a/stage/LibUsbDotNet/DeviceNotify/DeviceNotifier.cs b/stage/LibUsbDotNet/DeviceNotify/DeviceNotifier.cs index 37991c9..a907637 100644 --- a/stage/LibUsbDotNet/DeviceNotify/DeviceNotifier.cs +++ b/stage/LibUsbDotNet/DeviceNotify/DeviceNotifier.cs @@ -19,6 +19,7 @@ // visit www.gnu.org. // // +#if !NETSTANDARD1_5 using LibUsbDotNet.DeviceNotify.Linux; namespace LibUsbDotNet.DeviceNotify @@ -45,4 +46,5 @@ public static IDeviceNotifier OpenDeviceNotifier() } } } -} \ No newline at end of file +} +#endif diff --git a/stage/LibUsbDotNet/DeviceNotify/Info/PortNotifyInfo.cs b/stage/LibUsbDotNet/DeviceNotify/Info/PortNotifyInfo.cs index d7662fb..dd2b62c 100644 --- a/stage/LibUsbDotNet/DeviceNotify/Info/PortNotifyInfo.cs +++ b/stage/LibUsbDotNet/DeviceNotify/Info/PortNotifyInfo.cs @@ -36,7 +36,7 @@ internal PortNotifyInfo(IntPtr lParam) { Marshal.PtrToStructure(lParam, mBaseHdr); IntPtr pName = new IntPtr(lParam.ToInt64() + Marshal.OffsetOf(typeof (DevBroadcastPort), "mNameHolder").ToInt64()); - mName = Marshal.PtrToStringAuto(pName); + mName = Marshal.PtrToStringUni(pName); } #region IPortNotifyInfo Members diff --git a/stage/LibUsbDotNet/DeviceNotify/Info/UsbDeviceNotifyInfo.cs b/stage/LibUsbDotNet/DeviceNotify/Info/UsbDeviceNotifyInfo.cs index 37dc1c4..24926eb 100644 --- a/stage/LibUsbDotNet/DeviceNotify/Info/UsbDeviceNotifyInfo.cs +++ b/stage/LibUsbDotNet/DeviceNotify/Info/UsbDeviceNotifyInfo.cs @@ -39,7 +39,7 @@ internal UsbDeviceNotifyInfo(IntPtr lParam) { Marshal.PtrToStructure(lParam, mBaseHdr); IntPtr pName = new IntPtr(lParam.ToInt64() + Marshal.OffsetOf(typeof (DevBroadcastDeviceinterface), "mNameHolder").ToInt64()); - mName = Marshal.PtrToStringAuto(pName); + mName = Marshal.PtrToStringUni(pName); } #region IUsbDeviceNotifyInfo Members diff --git a/stage/LibUsbDotNet/DeviceNotify/Internal/DevNotifyNativeWindow.cs b/stage/LibUsbDotNet/DeviceNotify/Internal/DevNotifyNativeWindow.cs index 03a6d99..8745349 100644 --- a/stage/LibUsbDotNet/DeviceNotify/Internal/DevNotifyNativeWindow.cs +++ b/stage/LibUsbDotNet/DeviceNotify/Internal/DevNotifyNativeWindow.cs @@ -19,6 +19,7 @@ // visit www.gnu.org. // // +#if !NETSTANDARD1_5 using System; using System.Windows.Forms; @@ -76,4 +77,5 @@ protected override void WndProc(ref Message m) #endregion } -} \ No newline at end of file +} +#endif diff --git a/stage/LibUsbDotNet/DeviceNotify/Internal/SafeHandleZeroOrMinusOneIsInvalid.cs b/stage/LibUsbDotNet/DeviceNotify/Internal/SafeHandleZeroOrMinusOneIsInvalid.cs new file mode 100644 index 0000000..4d41f8b --- /dev/null +++ b/stage/LibUsbDotNet/DeviceNotify/Internal/SafeHandleZeroOrMinusOneIsInvalid.cs @@ -0,0 +1,25 @@ +#if NETSTANDARD1_5 +using System; +using System.Runtime.InteropServices; +using System.Security; + +namespace LibUsbDotNet.DeviceNotify.Internal +{ + [SecurityCritical] + internal abstract class SafeHandleZeroOrMinusOneIsInvalid : SafeHandle + { + protected SafeHandleZeroOrMinusOneIsInvalid(bool ownsHandle) : base(IntPtr.Zero, ownsHandle) + { + } + + public override bool IsInvalid + { + [SecurityCritical] + get + { + return handle == IntPtr.Zero || handle == new IntPtr(-1); + } + } + } +} +#endif diff --git a/stage/LibUsbDotNet/DeviceNotify/Internal/SafeNotifyHandle.cs b/stage/LibUsbDotNet/DeviceNotify/Internal/SafeNotifyHandle.cs index 5960eaa..92eb661 100644 --- a/stage/LibUsbDotNet/DeviceNotify/Internal/SafeNotifyHandle.cs +++ b/stage/LibUsbDotNet/DeviceNotify/Internal/SafeNotifyHandle.cs @@ -19,6 +19,7 @@ // visit www.gnu.org. // // +#if !NETSTANDARD1_5 using System; using Microsoft.Win32.SafeHandles; @@ -42,4 +43,5 @@ protected override bool ReleaseHandle() return true; } } -} \ No newline at end of file +} +#endif diff --git a/stage/LibUsbDotNet/DeviceNotify/Linux/LinuxDeviceNotifier.DevMonitor.cs b/stage/LibUsbDotNet/DeviceNotify/Linux/LinuxDeviceNotifier.DevMonitor.cs index bbdab1f..cf93104 100644 --- a/stage/LibUsbDotNet/DeviceNotify/Linux/LinuxDeviceNotifier.DevMonitor.cs +++ b/stage/LibUsbDotNet/DeviceNotify/Linux/LinuxDeviceNotifier.DevMonitor.cs @@ -74,10 +74,13 @@ private static bool ReadFileDescriptor(string fullPath, out byte[] deviceDescrip { try { - FileStream f = File.Open(fullPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); - deviceDescriptorBytes = new byte[UsbDeviceDescriptor.Size]; - int iRead = f.Read(deviceDescriptorBytes, 0, UsbDeviceDescriptor.Size); - f.Close(); + int iRead = 0; + + using (FileStream f = File.Open(fullPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) + { + deviceDescriptorBytes = new byte[UsbDeviceDescriptor.Size]; + iRead = f.Read(deviceDescriptorBytes, 0, UsbDeviceDescriptor.Size); + } return iRead == UsbDeviceDescriptor.Size; } diff --git a/stage/LibUsbDotNet/DeviceNotify/Linux/LinuxDeviceNotifier.DeviceListPolling.cs b/stage/LibUsbDotNet/DeviceNotify/Linux/LinuxDeviceNotifier.DeviceListPolling.cs index 212a1bb..dd77d56 100644 --- a/stage/LibUsbDotNet/DeviceNotify/Linux/LinuxDeviceNotifier.DeviceListPolling.cs +++ b/stage/LibUsbDotNet/DeviceNotify/Linux/LinuxDeviceNotifier.DeviceListPolling.cs @@ -20,7 +20,7 @@ // // using System; -using System.Timers; +using System.Threading; using LibUsbDotNet.LudnMonoLibUsb; using MonoLibUsb.Profile; @@ -45,19 +45,17 @@ private void StartDeviceListPolling() MonoUsbDevice.RefreshProfileList(); MonoUsbDevice.ProfileList.AddRemoveEvent += OnAddRemoveEvent; - mDeviceListPollTimer = new Timer(PollingInterval); - mDeviceListPollTimer.Elapsed += PollTimer_Elapsed; - mDeviceListPollTimer.Start(); + mDeviceListPollTimer = new Timer(PollTimer_Elapsed, null, PollingInterval, PollingInterval); } } - private void PollTimer_Elapsed(object sender, ElapsedEventArgs e) + private void PollTimer_Elapsed(object state) { lock (PollTimerLock) { - mDeviceListPollTimer.Stop(); + mDeviceListPollTimer.Change(-1, -1); MonoUsbDevice.RefreshProfileList(); - mDeviceListPollTimer.Start(); + mDeviceListPollTimer.Change(PollingInterval, PollingInterval); } } @@ -66,8 +64,7 @@ private void StopDeviceListPolling() lock (PollTimerLock) { if (mDeviceListPollTimer == null) return; - mDeviceListPollTimer.Stop(); - mDeviceListPollTimer.Elapsed -= PollTimer_Elapsed; + mDeviceListPollTimer.Change(Timeout.Infinite, Timeout.Infinite); mDeviceListPollTimer.Dispose(); MonoUsbDevice.ProfileList.AddRemoveEvent -= OnAddRemoveEvent; mDeviceListPollTimer = null; diff --git a/stage/LibUsbDotNet/DeviceNotify/WindowsDeviceNotifier.cs b/stage/LibUsbDotNet/DeviceNotify/WindowsDeviceNotifier.cs index 716c7a1..67ae294 100644 --- a/stage/LibUsbDotNet/DeviceNotify/WindowsDeviceNotifier.cs +++ b/stage/LibUsbDotNet/DeviceNotify/WindowsDeviceNotifier.cs @@ -19,6 +19,7 @@ // visit www.gnu.org. // // +#if !NETSTANDARD1_5 using System; using System.Diagnostics; using System.Runtime.InteropServices; @@ -143,4 +144,5 @@ private void OnHandleChange(IntPtr newWindowHandle) Debug.Print("RegisterDeviceInterface:" + bSuccess); } } -} \ No newline at end of file +} +#endif diff --git a/stage/LibUsbDotNet/Info/UsbDeviceInfo.cs b/stage/LibUsbDotNet/Info/UsbDeviceInfo.cs index 173b5ef..ff00e05 100644 --- a/stage/LibUsbDotNet/Info/UsbDeviceInfo.cs +++ b/stage/LibUsbDotNet/Info/UsbDeviceInfo.cs @@ -87,10 +87,11 @@ public short CurrentCultureLangID { if (mCurrentCultureLangID == NO_LANG) { - short currentCultureLangID = (short) CultureInfo.CurrentCulture.LCID; short[] deviceLangIDs; if (mUsbDevice.GetLangIDs(out deviceLangIDs)) { +#if !NETSTANDARD1_5 + short currentCultureLangID = (short) CultureInfo.CurrentCulture.LCID; foreach (short deviceLangID in deviceLangIDs) { if (deviceLangID == currentCultureLangID) @@ -99,7 +100,9 @@ public short CurrentCultureLangID return mCurrentCultureLangID; } } +#endif } + mCurrentCultureLangID = deviceLangIDs.Length > 0 ? deviceLangIDs[0] : (short) 0; } return mCurrentCultureLangID; diff --git a/stage/LibUsbDotNet/Internal/Kernel32.cs b/stage/LibUsbDotNet/Internal/Kernel32.cs index 10ef296..ac9e730 100644 --- a/stage/LibUsbDotNet/Internal/Kernel32.cs +++ b/stage/LibUsbDotNet/Internal/Kernel32.cs @@ -30,13 +30,15 @@ namespace LibUsbDotNet.Internal { +#if !NETSTANDARD1_5 [SuppressUnmanagedCodeSecurity] +#endif internal static class Kernel32 { private const int FORMAT_MESSAGE_FROM_SYSTEM = 0x00001000; private static readonly StringBuilder m_sbSysMsg = new StringBuilder(1024); - [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)] + [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)] public static extern SafeFileHandle CreateFile(string fileName, [MarshalAs(UnmanagedType.U4)] NativeFileAccess fileAccess, [MarshalAs(UnmanagedType.U4)] NativeFileShare fileShare, @@ -45,7 +47,7 @@ public static extern SafeFileHandle CreateFile(string fileName, NativeFileFlag flags, IntPtr template); - [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)] + [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)] private static extern int FormatMessage(int dwFlags, IntPtr lpSource, int dwMessageId, @@ -65,7 +67,11 @@ public static string FormatSystemMessage(int dwMessageId) int ret = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, IntPtr.Zero, dwMessageId, +#if !NETSTANDARD1_5 CultureInfo.CurrentCulture.LCID, +#else + 0, +#endif m_sbSysMsg, m_sbSysMsg.Capacity - 1, IntPtr.Zero); @@ -75,7 +81,7 @@ public static string FormatSystemMessage(int dwMessageId) } } - #region DeviceIoControl +#region DeviceIoControl [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Ansi)] public static extern bool DeviceIoControl(SafeHandle hDevice, @@ -117,7 +123,7 @@ public static extern bool DeviceIoControlAsObject(SafeHandle hDevice, ref int pBytesReturned, IntPtr Overlapped); - #endregion +#endregion } [Flags] diff --git a/stage/LibUsbDotNet/Internal/OverlappedTransferContext.cs b/stage/LibUsbDotNet/Internal/OverlappedTransferContext.cs index 9c2fe8f..1784f66 100644 --- a/stage/LibUsbDotNet/Internal/OverlappedTransferContext.cs +++ b/stage/LibUsbDotNet/Internal/OverlappedTransferContext.cs @@ -43,12 +43,12 @@ public override ErrorCode Submit() int iTransferred; ErrorCode eReturn = ErrorCode.Success; - if (mTransferCancelEvent.WaitOne(0, false)) return ErrorCode.IoCancelled; - if (!mTransferCompleteEvent.WaitOne(0, UsbConstants.EXIT_CONTEXT)) return ErrorCode.ResourceBusy; + if (mTransferCancelEvent.WaitOne(0)) return ErrorCode.IoCancelled; + if (!mTransferCompleteEvent.WaitOne(0)) return ErrorCode.ResourceBusy; mHasWaitBeenCalled = false; mTransferCompleteEvent.Reset(); - Overlapped.Init(mTransferCompleteEvent.SafeWaitHandle.DangerousGetHandle()); + Overlapped.Init(mTransferCompleteEvent.GetSafeWaitHandle().DangerousGetHandle()); int ret = EndpointBase.PipeTransferSubmit(NextBufPtr, RequestCount, @@ -72,7 +72,7 @@ public override ErrorCode Wait(out int transferredCount, bool cancel) transferredCount = 0; bool bSuccess; // Temporarily release the transfer lock while we wait for something to happen. - int iWait = WaitHandle.WaitAny(new WaitHandle[] { mTransferCompleteEvent, mTransferCancelEvent }, mTimeout, UsbConstants.EXIT_CONTEXT); + int iWait = WaitHandle.WaitAny(new WaitHandle[] { mTransferCompleteEvent, mTransferCancelEvent }, mTimeout); if (iWait == WaitHandle.WaitTimeout && !cancel) { return ErrorCode.IoTimedOut; @@ -82,7 +82,7 @@ public override ErrorCode Wait(out int transferredCount, bool cancel) if (iWait != 0) { bSuccess = EndpointBase.mUsbApi.AbortPipe(EndpointBase.Handle, EndpointBase.EpNum); - bool bTransferComplete = mTransferCompleteEvent.WaitOne(100, UsbConstants.EXIT_CONTEXT); + bool bTransferComplete = mTransferCompleteEvent.WaitOne(100); mTransferCompleteEvent.Set(); if (!bSuccess || !bTransferComplete) { diff --git a/stage/LibUsbDotNet/Internal/RegistryKeyPermissionCheck.cs b/stage/LibUsbDotNet/Internal/RegistryKeyPermissionCheck.cs new file mode 100644 index 0000000..0d2fa5a --- /dev/null +++ b/stage/LibUsbDotNet/Internal/RegistryKeyPermissionCheck.cs @@ -0,0 +1,11 @@ +#if NETSTANDARD1_5 +namespace LibUsbDotNet.Internal +{ + internal enum RegistryKeyPermissionCheck + { + Default = 0, + ReadSubTree = 1, + ReadWriteSubTree = 2 + } +} +#endif diff --git a/stage/LibUsbDotNet/Internal/SetupApi.cs b/stage/LibUsbDotNet/Internal/SetupApi.cs new file mode 100644 index 0000000..fbf8a72 --- /dev/null +++ b/stage/LibUsbDotNet/Internal/SetupApi.cs @@ -0,0 +1,670 @@ +// Copyright © 2006-2010 Travis Robinson. All rights reserved. +// +// website: http://sourceforge.net/projects/libusbdotnet +// e-mail: libusbdotnet@gmail.com +// +// This program is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with this program; if not, write to the Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. or +// visit www.gnu.org. +// +// +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using LibUsbDotNet.Main; +using LibUsbDotNet.WinUsb; +using Microsoft.Win32; + +// ReSharper disable InconsistentNaming +// ReSharper disable ClassNeverInstantiated.Local +// ReSharper disable UnusedMember.Local +// ReSharper disable ConvertIfStatementToConditionalTernaryExpression +// ReSharper disable UnusedParameter.Local + +namespace LibUsbDotNet.Internal +{ + internal class SetupApi + { + #region Delegates + + public delegate bool ClassEnumeratorDelegate( + IntPtr DeviceInfoSet, int deviceIndex, ref SP_DEVINFO_DATA DeviceInfoData, object classEnumeratorCallbackParam1); + + #endregion + + #region Enumerations + + #region CR enum + + public enum CR + { + SUCCESS = (0x00000000), + DEFAULT = (0x00000001), + OUT_OF_MEMORY = (0x00000002), + INVALID_POINTER = (0x00000003), + INVALID_FLAG = (0x00000004), + INVALID_DEVNODE = (0x00000005), + INVALID_DEVINST = INVALID_DEVNODE, + INVALID_RES_DES = (0x00000006), + INVALID_LOG_CONF = (0x00000007), + INVALID_ARBITRATOR = (0x00000008), + INVALID_NODELIST = (0x00000009), + DEVNODE_HAS_REQS = (0x0000000A), + DEVINST_HAS_REQS = DEVNODE_HAS_REQS, + INVALID_RESOURCEID = (0x0000000B), + DLVXD_NOT_FOUND = (0x0000000C), // WIN 95 ONLY + NO_SUCH_DEVNODE = (0x0000000D), + NO_SUCH_DEVINST = NO_SUCH_DEVNODE, + NO_MORE_LOG_CONF = (0x0000000E), + NO_MORE_RES_DES = (0x0000000F), + ALREADY_SUCH_DEVNODE = (0x00000010), + ALREADY_SUCH_DEVINST = ALREADY_SUCH_DEVNODE, + INVALID_RANGE_LIST = (0x00000011), + INVALID_RANGE = (0x00000012), + FAILURE = (0x00000013), + NO_SUCH_LOGICAL_DEV = (0x00000014), + CREATE_BLOCKED = (0x00000015), + NOT_SYSTEM_VM = (0x00000016), // WIN 95 ONLY + REMOVE_VETOED = (0x00000017), + APM_VETOED = (0x00000018), + INVALID_LOAD_TYPE = (0x00000019), + BUFFER_SMALL = (0x0000001A), + NO_ARBITRATOR = (0x0000001B), + NO_REGISTRY_HANDLE = (0x0000001C), + REGISTRY_ERROR = (0x0000001D), + INVALID_DEVICE_ID = (0x0000001E), + INVALID_DATA = (0x0000001F), + INVALID_API = (0x00000020), + DEVLOADER_NOT_READY = (0x00000021), + NEED_RESTART = (0x00000022), + NO_MORE_HW_PROFILES = (0x00000023), + DEVICE_NOT_THERE = (0x00000024), + NO_SUCH_VALUE = (0x00000025), + WRONG_TYPE = (0x00000026), + INVALID_PRIORITY = (0x00000027), + NOT_DISABLEABLE = (0x00000028), + FREE_RESOURCES = (0x00000029), + QUERY_VETOED = (0x0000002A), + CANT_SHARE_IRQ = (0x0000002B), + NO_DEPENDENT = (0x0000002C), + SAME_RESOURCES = (0x0000002D), + NO_SUCH_REGISTRY_KEY = (0x0000002E), + INVALID_MACHINENAME = (0x0000002F), // NT ONLY + REMOTE_COMM_FAILURE = (0x00000030), // NT ONLY + MACHINE_UNAVAILABLE = (0x00000031), // NT ONLY + NO_CM_SERVICES = (0x00000032), // NT ONLY + ACCESS_DENIED = (0x00000033), // NT ONLY + CALL_NOT_IMPLEMENTED = (0x00000034), + INVALID_PROPERTY = (0x00000035), + DEVICE_INTERFACE_ACTIVE = (0x00000036), + NO_SUCH_DEVICE_INTERFACE = (0x00000037), + INVALID_REFERENCE_STRING = (0x00000038), + INVALID_CONFLICT_LIST = (0x00000039), + INVALID_INDEX = (0x0000003A), + INVALID_STRUCTURE_SIZE = (0x0000003B), + NUM_CR_RESULTS = (0x0000003C) + } + + #endregion + + #region DeviceInterfaceDataFlags enum + + public enum DeviceInterfaceDataFlags : uint + { + Active = 0x00000001, + Default = 0x00000002, + Removed = 0x00000004 + } + + #endregion + + #region DICFG enum + + [Flags] + public enum DICFG + { + /// + /// Return only the device that is associated with the system default device interface, if one is set, for the specified device interface classes. + /// only valid with . + /// + DEFAULT = 0x00000001, + /// + /// Return only devices that are currently present in a system. + /// + PRESENT = 0x00000002, + /// + /// Return a list of installed devices for all device setup classes or all device interface classes. + /// + ALLCLASSES = 0x00000004, + /// + /// Return only devices that are a part of the current hardware profile. + /// + PROFILE = 0x00000008, + /// + /// Return devices that support device interfaces for the specified device interface classes. + /// + DEVICEINTERFACE = 0x00000010, + } + + #endregion + + #region DICUSTOMDEVPROP enum + + public enum DICUSTOMDEVPROP + { + NONE = 0, + MERGE_MULTISZ = 0x00000001, + } + + #endregion + + [Flags] + public enum DevKeyType + { + DEV = 0x00000001, // Open/Create/Delete device key + DRV = 0x00000002, // Open/Create/Delete driver key + BOTH = 0x00000004, // Delete both driver and Device key + + } + #endregion + + private const string STRUCT_END_MARK = "STRUCT_END_MARK"; + + public static readonly Guid GUID_DEVINTERFACE_USB_DEVICE = new Guid("f18a0e88-c30c-11d0-8815-00a0c906bed8"); + + public static bool Is64Bit + { + get { return (IntPtr.Size == 8); } + } + + + /// + /// + /// + /// Caller-supplied device instance handle that is bound to the local machine. + /// Address of a buffer to receive a device instance ID string. The required buffer size can be obtained by calling CM_Get_Device_ID_Size, then incrementing the received value to allow room for the string's terminating NULL. + /// Caller-supplied length, in characters, of the buffer specified by Buffer. + /// Not used. set to 0. + /// If the operation succeeds, the function returns CR_SUCCESS. Otherwise, it returns one of the CR_-prefixed error codes defined in cfgmgr32.h. + [DllImport("setupapi.dll", CharSet = CharSet.Unicode)] + public static extern CR CM_Get_Device_ID(IntPtr dnDevInst, IntPtr Buffer, int BufferLen, int ulFlags); + + + /// + /// The CM_Get_Parent function obtains a device instance handle to the parent node of a specified device node, in the local machine's device tree. + /// + /// Caller-supplied pointer to the device instance handle to the parent node that this function retrieves. The retrieved handle is bound to the local machine. + /// Caller-supplied device instance handle that is bound to the local machine. + /// Not used. set to 0. + /// If the operation succeeds, the function returns CR_SUCCESS. Otherwise, it returns one of the CR_-prefixed error codes defined in cfgmgr32.h. + [DllImport("setupapi.dll")] + public static extern CR CM_Get_Parent(out IntPtr pdnDevInst, IntPtr dnDevInst, int ulFlags); + + [DllImport("setupapi.dll", CharSet = CharSet.Unicode /*, SetLastError = true*/)] + public static extern bool SetupDiDestroyDeviceInfoList(IntPtr hDevInfo); + + [DllImport("setupapi.dll", SetLastError = true)] + public static extern bool SetupDiEnumDeviceInfo(IntPtr DeviceInfoSet, int MemberIndex, ref SP_DEVINFO_DATA DeviceInfoData); + + /// + /// The SetupDiEnumDeviceInterfaces function enumerates the device interfaces that are contained in a device information set. + /// + /// A pointer to a device information set that contains the device interfaces for which to return information. This handle is typically returned by SetupDiGetClassDevs. + /// A pointer to an SP_DEVINFO_DATA structure that specifies a device information element in DeviceInfoSet. This parameter is optional and can be NULL. If this parameter is specified, SetupDiEnumDeviceInterfaces constrains the enumeration to the interfaces that are supported by the specified device. If this parameter is NULL, repeated calls to SetupDiEnumDeviceInterfaces return information about the interfaces that are associated with all the device information elements in DeviceInfoSet. This pointer is typically returned by SetupDiEnumDeviceInfo. + /// A pointer to a GUID that specifies the device interface class for the requested interface. + /// A zero-based index into the list of interfaces in the device information set. The caller should call this function first with MemberIndex set to zero to obtain the first interface. Then, repeatedly increment MemberIndex and retrieve an interface until this function fails and GetLastError returns ERROR_NO_MORE_ITEMS. If DeviceInfoData specifies a particular device, the MemberIndex is relative to only the interfaces exposed by that device. + /// A pointer to a caller-allocated buffer that contains, on successful return, a completed SP_DEVICE_INTERFACE_DATA structure that identifies an interface that meets the search parameters. The caller must set DeviceInterfaceData.cbSize to sizeof(SP_DEVICE_INTERFACE_DATA) before calling this function. + /// + [DllImport("setupapi.dll", CharSet = CharSet.Unicode, SetLastError = true)] + public static extern Boolean SetupDiEnumDeviceInterfaces(IntPtr hDevInfo, + ref SP_DEVINFO_DATA devInfo, + ref Guid interfaceClassGuid, + int memberIndex, + ref SP_DEVICE_INTERFACE_DATA deviceInterfaceData); + + [DllImport("setupapi.dll", CharSet = CharSet.Unicode, SetLastError = true)] + public static extern Boolean SetupDiEnumDeviceInterfaces(IntPtr hDevInfo, + [MarshalAs(UnmanagedType.AsAny)] object devInfo, + ref Guid interfaceClassGuid, + int memberIndex, + ref SP_DEVICE_INTERFACE_DATA deviceInterfaceData); + + /// + /// The SetupDiGetClassDevs function returns a handle to a device information set that contains requested device information elements for a local machine. + /// + /// A pointer to the GUID for a device setup class or a device interface class. This pointer is optional and can be NULL. For more information about how to set ClassGuid, see the following Comments section. + /// A pointer to a NULL-terminated string that supplies the name of a Plug and Play (PnP) enumerator or a PnP device instance identifier. This pointer is optional and can be NULL. For more information about how to set the Enumerator value, see the following Comments section. + /// A handle of the top-level window to be used for a user interface that is associated with installing a device instance in the device information set. This handle is optional and can be NULL. + /// A variable of type DWORD that specifies control options that filter the device information elements that are added to the device information set. This parameter can be a bitwise OR of zero or more of the following flags. + /// + [DllImport("setupapi.dll", CharSet = CharSet.Ansi, EntryPoint = "SetupDiGetClassDevsA")] + public static extern IntPtr SetupDiGetClassDevs(ref Guid ClassGuid, + [MarshalAs(UnmanagedType.LPTStr)] string Enumerator, + IntPtr hwndParent, + DICFG Flags); + + [DllImport("setupapi.dll", CharSet = CharSet.Ansi, EntryPoint = "SetupDiGetClassDevsA")] + public static extern IntPtr SetupDiGetClassDevs(ref Guid ClassGuid, int Enumerator, IntPtr hwndParent, DICFG Flags); + + [DllImport("setupapi.dll", CharSet = CharSet.Ansi, EntryPoint = "SetupDiGetClassDevsA")] + public static extern IntPtr SetupDiGetClassDevs(int ClassGuid, string Enumerator, IntPtr hwndParent, DICFG Flags); + + [DllImport("setupapi.dll", CharSet = CharSet.Unicode, SetLastError = true)] + public static extern bool SetupDiGetCustomDeviceProperty(IntPtr DeviceInfoSet, + ref SP_DEVINFO_DATA DeviceInfoData, + string CustomPropertyName, + DICUSTOMDEVPROP Flags, + out RegistryValueKind PropertyRegDataType, + Byte[] PropertyBuffer, + int PropertyBufferSize, + out int RequiredSize); + + /// + /// The SetupDiGetDeviceInstanceId function retrieves the device instance ID that is associated with a device information element. + /// + /// A handle to the device information set that contains the device information element that represents the device for which to retrieve a device instance ID. + /// A pointer to an SP_DEVINFO_DATA structure that specifies the device information element in DeviceInfoSet. + /// A pointer to the character buffer that will receive the NULL-terminated device instance ID for the specified device information element. For information about device instance IDs, see Device Identification Strings. + /// The size, in characters, of the DeviceInstanceId buffer. + /// A pointer to the variable that receives the number of characters required to store the device instance ID. + /// The function returns TRUE if it is successful. Otherwise, it returns FALSE and the logged error can be retrieved with a call to GetLastError. + [DllImport("setupapi.dll", SetLastError = true, CharSet = CharSet.Ansi, EntryPoint = "SetupDiGetDeviceInstanceIdA")] + public static extern bool SetupDiGetDeviceInstanceId(IntPtr DeviceInfoSet, + ref SP_DEVINFO_DATA DeviceInfoData, + StringBuilder DeviceInstanceId, + int DeviceInstanceIdSize, + out int RequiredSize); + + [DllImport(@"setupapi.dll", CharSet = CharSet.Unicode, SetLastError = true)] + public static extern Boolean SetupDiGetDeviceInterfaceDetail(IntPtr hDevInfo, + ref SP_DEVICE_INTERFACE_DATA deviceInterfaceData, + DEVICE_INTERFACE_DETAIL_HANDLE deviceInterfaceDetailData, + int deviceInterfaceDetailDataSize, + out int requiredSize, + [MarshalAs(UnmanagedType.AsAny)] object deviceInfoData); + [DllImport(@"setupapi.dll", CharSet = CharSet.Unicode, SetLastError = true)] + public static extern Boolean SetupDiGetDeviceInterfaceDetail(IntPtr hDevInfo, + ref SP_DEVICE_INTERFACE_DATA deviceInterfaceData, + DEVICE_INTERFACE_DETAIL_HANDLE deviceInterfaceDetailData, + int deviceInterfaceDetailDataSize, + out int requiredSize, + ref SP_DEVINFO_DATA deviceInfoData); + + + [DllImport("setupapi.dll", CharSet = CharSet.Unicode)] + public static extern bool SetupDiGetDeviceInterfacePropertyKeys(IntPtr DeviceInfoSet, + ref SP_DEVICE_INTERFACE_DATA DeviceInterfaceData, + byte[] propKeyBuffer, + int propKeyBufferElements, + out int RequiredPropertyKeyCount, + int Flags); + + /// + /// The SetupDiGetDeviceRegistryProperty function retrieves the specified device property. + /// This handle is typically returned by the SetupDiGetClassDevs or SetupDiGetClassDevsEx function. + /// + /// Handle to the device information set that contains the interface and its underlying device. + /// Pointer to an SP_DEVINFO_DATA structure that defines the device instance. + /// Device property to be retrieved. SEE MSDN + /// Pointer to a variable that receives the registry data Type. This parameter can be NULL. + /// Pointer to a buffer that receives the requested device property. + /// Size of the buffer, in bytes. + /// Pointer to a variable that receives the required buffer size, in bytes. This parameter can be NULL. + /// If the function succeeds, the return value is nonzero. + [DllImport("setupapi.dll", CharSet = CharSet.Unicode, SetLastError = true)] + public static extern bool SetupDiGetDeviceRegistryProperty(IntPtr DeviceInfoSet, + ref SP_DEVINFO_DATA DeviceInfoData, + SPDRP Property, + out RegistryValueKind PropertyRegDataType, + byte[] PropertyBuffer, + int PropertyBufferSize, + out int RequiredSize); + + [DllImport("setupapi.dll", CharSet = CharSet.Unicode)] + public static extern CR CM_Get_Device_ID(uint dnDevInst, StringBuilder Buffer, int BufferLen, int ulFlags); + + [DllImport("Setupapi", CharSet = CharSet.Unicode, SetLastError = true)] + public static extern IntPtr SetupDiOpenDevRegKey(IntPtr hDeviceInfoSet, ref SP_DEVINFO_DATA deviceInfoData, int scope, int hwProfile, DevKeyType keyType, RegistryKeyPermissionCheck samDesired); + + [DllImport("advapi32.dll", SetLastError = true, CharSet = CharSet.Unicode)] + public static extern int RegEnumValue(IntPtr hKey, int index, StringBuilder lpValueName, ref int lpcValueName, IntPtr lpReserved, out RegistryValueKind lpType, byte[] data, ref int dataLength); + + [DllImport("advapi32.dll", SetLastError = true, CharSet = CharSet.Unicode)] + public static extern int RegEnumValue(IntPtr hKey, int index, StringBuilder lpValueName, ref int lpcValueName, IntPtr lpReserved, out RegistryValueKind lpType, StringBuilder data, ref int dataLength); + + [DllImport("advapi32.dll", SetLastError = true, CharSet = CharSet.Unicode)] + public static extern int RegCloseKey(IntPtr hKey); + + public static bool EnumClassDevs(string enumerator, + DICFG flags, + ClassEnumeratorDelegate classEnumeratorCallback, + object classEnumeratorCallbackParam1) + { + SP_DEVINFO_DATA dev_info_data = SP_DEVINFO_DATA.Empty; + + int dev_index = 0; + + IntPtr dev_info = SetupDiGetClassDevs(0, enumerator, IntPtr.Zero, flags); + + if (dev_info == IntPtr.Zero || dev_info.ToInt64() == -1) return false; + bool bSuccess = false; + while (SetupDiEnumDeviceInfo(dev_info, dev_index, ref dev_info_data)) + { + if (classEnumeratorCallback(dev_info, dev_index, ref dev_info_data, classEnumeratorCallbackParam1)) + { + bSuccess = true; + break; + } + + dev_index++; + } + + SetupDiDestroyDeviceInfoList(dev_info); + + return bSuccess; + } + + public static void getSPDRPProperties(IntPtr deviceInfoSet, ref SP_DEVINFO_DATA deviceInfoData, Dictionary deviceProperties) + { + byte[] propBuffer = new byte[1024]; + Dictionary allProps = Helper.GetEnumData(typeof(SPDRP)); + foreach (KeyValuePair prop in allProps) + { + object oValue = String.Empty; + int iReturnBytes; + RegistryValueKind regPropType; + bool bSuccess = SetupDiGetDeviceRegistryProperty(deviceInfoSet, + ref deviceInfoData, + (SPDRP)prop.Value, + out regPropType, + propBuffer, + propBuffer.Length, + out iReturnBytes); + if (bSuccess) + { + switch ((SPDRP)prop.Value) + { + case SPDRP.PhysicalDeviceObjectName: + case SPDRP.LocationInformation: + case SPDRP.Class: + case SPDRP.Mfg: + case SPDRP.DeviceDesc: + case SPDRP.Driver: + case SPDRP.EnumeratorName: + case SPDRP.FriendlyName: + case SPDRP.ClassGuid: + oValue = UsbRegistry.GetAsString(propBuffer, iReturnBytes); + break; + case SPDRP.HardwareId: + case SPDRP.CompatibleIds: + case SPDRP.LocationPaths: + oValue = UsbRegistry.GetAsStringArray(propBuffer, iReturnBytes); + break; + case SPDRP.BusNumber: + case SPDRP.InstallState: + case SPDRP.LegacyBusType: + case SPDRP.RemovalPolicy: + case SPDRP.UiNumber: + case SPDRP.Address: + oValue = UsbRegistry.GetAsStringInt32(propBuffer, iReturnBytes); + break; + case SPDRP.BusTypeGuid: + oValue = UsbRegistry.GetAsGuid(propBuffer, iReturnBytes); + break; + } + } + else + oValue = String.Empty; + + deviceProperties.Add(prop.Key, oValue); + } + } + + public static bool SetupDiGetDeviceInterfaceDetailLength(IntPtr hDevInfo, + ref SP_DEVICE_INTERFACE_DATA deviceInterfaceData, + out int requiredLength) + { + DEVICE_INTERFACE_DETAIL_HANDLE tmp = new DEVICE_INTERFACE_DETAIL_HANDLE(); + return SetupDiGetDeviceInterfaceDetail(hDevInfo, ref deviceInterfaceData, tmp, 0, out requiredLength, null); + } + + public static bool SetupDiGetDeviceRegistryProperty(out byte[] regBytes, + IntPtr DeviceInfoSet, + ref SP_DEVINFO_DATA DeviceInfoData, + SPDRP Property) + { + regBytes = null; + byte[] tmp = new byte[1024]; + int iReqSize; + RegistryValueKind regValueType; + if (!SetupDiGetDeviceRegistryProperty(DeviceInfoSet, ref DeviceInfoData, Property, out regValueType, tmp, tmp.Length, out iReqSize)) + { + UsbError.Error(ErrorCode.Win32Error, Marshal.GetLastWin32Error(), "SetupDiGetDeviceRegistryProperty", typeof(SetupApi)); + return false; + } + regBytes = new byte[iReqSize]; + Array.Copy(tmp, regBytes, regBytes.Length); + return true; + } + + public static bool SetupDiGetDeviceRegistryProperty(out string regSZ, IntPtr DeviceInfoSet, ref SP_DEVINFO_DATA DeviceInfoData, SPDRP Property) + { + regSZ = null; + byte[] tmp; + if (SetupDiGetDeviceRegistryProperty(out tmp, DeviceInfoSet, ref DeviceInfoData, Property)) + { + regSZ = Encoding.Unicode.GetString(tmp).TrimEnd(new char[] {'\0'}); + return true; + } + return false; + } + + public static bool SetupDiGetDeviceRegistryProperty(out string[] regMultiSZ, + IntPtr DeviceInfoSet, + ref SP_DEVINFO_DATA DeviceInfoData, + SPDRP Property) + { + regMultiSZ = null; + string tmp; + if (SetupDiGetDeviceRegistryProperty(out tmp, DeviceInfoSet, ref DeviceInfoData, Property)) + { + regMultiSZ = tmp.Split(new char[] {'\0'}, StringSplitOptions.RemoveEmptyEntries); + return true; + } + return false; + } + + private static bool cbHasDeviceInterfaceGUID(IntPtr DeviceInfoSet, + int deviceIndex, + ref SP_DEVINFO_DATA DeviceInfoData, + object devInterfaceGuid) + { + RegistryValueKind propertyType; + byte[] propBuffer = new byte[256]; + int requiredSize; + bool bSuccess = SetupDiGetCustomDeviceProperty(DeviceInfoSet, + ref DeviceInfoData, + "DeviceInterfaceGuids", + DICUSTOMDEVPROP.NONE, + out propertyType, + propBuffer, + propBuffer.Length, + out requiredSize); + if (bSuccess) + { + Guid devGuid = (Guid) devInterfaceGuid; + string[] stemp = Encoding.Unicode.GetString(propBuffer, 0, requiredSize).Split(new char[] {'\0'}, + StringSplitOptions.RemoveEmptyEntries); + Guid findGuid = new Guid(stemp[0]); + return (devGuid == findGuid); + } + return false; + } + + #region Nested Types + + #region Nested type: DEVICE_INTERFACE_DETAIL_HANDLE + + [StructLayout(LayoutKind.Sequential)] + public struct DEVICE_INTERFACE_DETAIL_HANDLE + { + private IntPtr mPtr; + + internal DEVICE_INTERFACE_DETAIL_HANDLE(IntPtr ptrInit) { mPtr = ptrInit; } + } + + #endregion + + #region Nested type: DeviceInterfaceDetailHelper + + public class DeviceInterfaceDetailHelper + { + public static readonly int SIZE = Is64Bit ? 8 : 6; + private IntPtr mpDevicePath; + private IntPtr mpStructure; + + public DeviceInterfaceDetailHelper(int maximumLength) + { + mpStructure = Marshal.AllocHGlobal(maximumLength); + mpDevicePath = new IntPtr(mpStructure.ToInt64() + Marshal.SizeOf(typeof (int))); + } + + public DEVICE_INTERFACE_DETAIL_HANDLE Handle + { + get + { + Marshal.WriteInt32(mpStructure, SIZE); + return new DEVICE_INTERFACE_DETAIL_HANDLE(mpStructure); + } + } + + public string DevicePath + { + get { return Marshal.PtrToStringUni(mpDevicePath); } + } + + + public void Free() + { + if (mpStructure != IntPtr.Zero) + Marshal.FreeHGlobal(mpStructure); + + mpDevicePath = IntPtr.Zero; + mpStructure = IntPtr.Zero; + } + + + ~DeviceInterfaceDetailHelper() { Free(); } + } + + #endregion + + #region Nested type: MaxStructSizes + + private class MaxStructSizes + { + public const int SP_DEVINFO_DATA = 40; + } + + #endregion + + #region Nested type: SP_DEVICE_INTERFACE_DATA + + [StructLayout(LayoutKind.Sequential)] + public struct SP_DEVICE_INTERFACE_DATA + { + public static readonly SP_DEVICE_INTERFACE_DATA Empty = new SP_DEVICE_INTERFACE_DATA(Marshal.SizeOf(typeof (SP_DEVICE_INTERFACE_DATA))); + + public UInt32 cbSize; + public Guid interfaceClassGuid; + public UInt32 flags; + private UIntPtr reserved; + + private SP_DEVICE_INTERFACE_DATA(int size) + { + cbSize = (uint) size; + reserved = UIntPtr.Zero; + flags = 0; + interfaceClassGuid = Guid.Empty; + } + } + + #endregion + + //[StructLayout(LayoutKind.Sequential, Pack = 1)] + //public struct SP_DEVICE_INTERFACE_DATA + //{ + // public static readonly SP_DEVICE_INTERFACE_DATA Empty = new SP_DEVICE_INTERFACE_DATA(GetSetupApiSize(typeof (SP_DEVICE_INTERFACE_DATA))); + + // public readonly uint cbSize; + // public Guid interfaceClassGuid; + // public DeviceInterfaceDataFlags flags; + // private IntPtr reserved; + + // private SP_DEVICE_INTERFACE_DATA(int size) + // { + // reserved = new IntPtr(); + // flags = 0; + // interfaceClassGuid = Guid.Empty; + // cbSize = size; + // } + //} + + #region Nested type: SP_DEVINFO_DATA + + [StructLayout(LayoutKind.Sequential)] + public struct SP_DEVINFO_DATA + { + public static readonly SP_DEVINFO_DATA Empty = new SP_DEVINFO_DATA(Marshal.SizeOf(typeof (SP_DEVINFO_DATA))); + + public UInt32 cbSize; + public Guid ClassGuid; + public UInt32 DevInst; + public IntPtr Reserved; + + private SP_DEVINFO_DATA(int size) + { + cbSize = (uint) size; + ClassGuid = Guid.Empty; + DevInst = 0; + Reserved = IntPtr.Zero; + } + } + + #endregion + + //[StructLayout(LayoutKind.Sequential, Pack = IntPtr.Size==8?8:1, Size = MaxStructSizes.SP_DEVINFO_DATA)] + //public struct SP_DEVINFO_DATA + //{ + // public static readonly SP_DEVINFO_DATA Empty = new SP_DEVINFO_DATA(Marshal.SizeOf(typeof(SP_DEVINFO_DATA))); + + // public readonly int cbSize; + // public Guid ClassGuid; + // public IntPtr DevInst; + // public IntPtr Reserved; + // private SP_DEVINFO_DATA(int size) + // { + // cbSize = size; + // ClassGuid = Guid.Empty; + // DevInst = IntPtr.Zero; + // Reserved = IntPtr.Zero; + + // STRUCT_END_MARK = 0; + // } + //} + + #endregion + } +} \ No newline at end of file diff --git a/stage/LibUsbDotNet/Internal/TransferContextBase.cs b/stage/LibUsbDotNet/Internal/TransferContextBase.cs index e5156fc..cd901b8 100644 --- a/stage/LibUsbDotNet/Internal/TransferContextBase.cs +++ b/stage/LibUsbDotNet/Internal/TransferContextBase.cs @@ -71,22 +71,22 @@ protected IntPtr NextBufPtr public bool IsCancelled { - get { return mTransferCancelEvent.WaitOne(0, UsbConstants.EXIT_CONTEXT); } + get { return mTransferCancelEvent.WaitOne(0); } } public bool IsComplete { - get { return mTransferCompleteEvent.WaitOne(0, UsbConstants.EXIT_CONTEXT); } + get { return mTransferCompleteEvent.WaitOne(0); } } public SafeWaitHandle CancelWaitHandle { - get { return mTransferCancelEvent.SafeWaitHandle; } + get { return mTransferCancelEvent.GetSafeWaitHandle(); } } public SafeWaitHandle CompleteWaitHandle { - get { return mTransferCompleteEvent.SafeWaitHandle; } + get { return mTransferCompleteEvent.GetSafeWaitHandle(); } } #region IDisposable Members diff --git a/stage/LibUsbDotNet/LibUsb/Internal/LibUsbDriverIO.cs b/stage/LibUsbDotNet/LibUsb/Internal/LibUsbDriverIO.cs index a4de0a4..0224b90 100644 --- a/stage/LibUsbDotNet/LibUsb/Internal/LibUsbDriverIO.cs +++ b/stage/LibUsbDotNet/LibUsb/Internal/LibUsbDriverIO.cs @@ -67,7 +67,7 @@ internal static bool UsbIOSync(SafeHandle dev, int code, Object inBuffer, int in { SafeOverlapped deviceIoOverlapped = new SafeOverlapped(); ManualResetEvent hEvent = new ManualResetEvent(false); - deviceIoOverlapped.Init(hEvent.SafeWaitHandle.DangerousGetHandle()); + deviceIoOverlapped.Init(hEvent.GetSafeWaitHandle().DangerousGetHandle()); ret = 0; if (!Kernel32.DeviceIoControlAsObject(dev, code, inBuffer, inSize, outBuffer, outSize, ref ret, deviceIoOverlapped.GlobalOverlapped)) @@ -82,18 +82,17 @@ internal static bool UsbIOSync(SafeHandle dev, int code, Object inBuffer, int in if (code == LibUsbIoCtl.GET_CUSTOM_REG_PROPERTY) break; UsbError.Error(ErrorCode.Win32Error, iError, String.Format("DeviceIoControl code {0:X8} failed:{1}", code, Kernel32.FormatSystemMessage(iError)), typeof(LibUsbDriverIO)); } while (false); - - hEvent.Close(); + hEvent.Dispose(); return false; } } if (Kernel32.GetOverlappedResult(dev, deviceIoOverlapped.GlobalOverlapped, out ret, true)) { - hEvent.Close(); + hEvent.Dispose(); return true; } UsbError.Error(ErrorCode.Win32Error, Marshal.GetLastWin32Error(), "GetOverlappedResult failed.\nIoCtlCode:" + code, typeof(LibUsbDriverIO)); - hEvent.Close(); + hEvent.Dispose(); return false; } } diff --git a/stage/LibUsbDotNet/LibUsb/LibUsbDevice.cs b/stage/LibUsbDotNet/LibUsb/LibUsbDevice.cs index fa329e5..0cdd7af 100644 --- a/stage/LibUsbDotNet/LibUsb/LibUsbDevice.cs +++ b/stage/LibUsbDotNet/LibUsb/LibUsbDevice.cs @@ -152,7 +152,7 @@ public override bool Close() { ReleaseAllInterfaces(); ActiveEndpoints.Clear(); - mUsbHandle.Close(); + mUsbHandle.Dispose(); } return true; } diff --git a/stage/LibUsbDotNet/LibUsb/LibUsbRegistry.cs b/stage/LibUsbDotNet/LibUsb/LibUsbRegistry.cs index 1c1f61a..fc61619 100644 --- a/stage/LibUsbDotNet/LibUsb/LibUsbRegistry.cs +++ b/stage/LibUsbDotNet/LibUsb/LibUsbRegistry.cs @@ -156,10 +156,10 @@ public static List DeviceList } catch (Exception ex) { - Debug.Print(ex.Message); + Debug.WriteLine(ex.Message); } } - if (deviceHandle != null && !deviceHandle.IsClosed) deviceHandle.Close(); + if (deviceHandle != null && !deviceHandle.IsClosed) deviceHandle.Dispose(); } return deviceList; diff --git a/stage/LibUsbDotNet/Main/Helper.cs b/stage/LibUsbDotNet/Main/Helper.cs index b2068ab..e28cbc0 100644 --- a/stage/LibUsbDotNet/Main/Helper.cs +++ b/stage/LibUsbDotNet/Main/Helper.cs @@ -33,6 +33,8 @@ namespace LibUsbDotNet.Main public static class Helper { private static object mIsLinux; + +#if !NETSTANDARD1_5 private static OperatingSystem mOs; /// @@ -48,6 +50,7 @@ public static OperatingSystem OSVersion return mOs; } } +#endif /// /// True if running on a unix-like operating system. @@ -57,6 +60,7 @@ public static bool IsLinux { get { +#if !NETSTANDARD1_5 if (ReferenceEquals(mIsLinux, null)) { switch (OSVersion.Platform.ToString()) @@ -77,6 +81,9 @@ public static bool IsLinux } } return (bool)mIsLinux; +#else + return RuntimeInformation.IsOSPlatform(OSPlatform.Linux); +#endif } } @@ -105,7 +112,7 @@ public static void BytesToObject(byte[] sourceBytes, int iStartIndex, int iLengt public static Dictionary GetEnumData(Type type) { Dictionary dictEnum = new Dictionary(); - FieldInfo[] enumFields = type.GetFields(); + FieldInfo[] enumFields = type.GetTypeInfo().GetFields(); for (int iField = 1; iField < enumFields.Length; iField++) { object oValue = enumFields[iField].GetRawConstantValue(); @@ -165,7 +172,7 @@ public static string ToString(string sep0, string[] names, string sep1, object[] return sb.ToString(); } - #region Nested Types +#region Nested Types [StructLayout(LayoutKind.Explicit, Pack = 1)] internal struct HostEndian16BitValue @@ -187,7 +194,7 @@ public HostEndian16BitValue(short x) public readonly byte B1; } - #endregion +#endregion /// /// Builds a formatted hexidecimal string from an array of bytes. @@ -270,7 +277,7 @@ public IntPtr Handle get { return handle; } } - #region IDisposable Members +#region IDisposable Members /// /// Frees and disposes the for this pinned object. @@ -323,7 +330,7 @@ protected virtual void Dispose(bool disposing) } } - #endregion +#endregion ~PinnedHandle() { diff --git a/stage/LibUsbDotNet/Main/LegacyUsbRegistry.cs b/stage/LibUsbDotNet/Main/LegacyUsbRegistry.cs index 0e74a0d..d7b9f14 100644 --- a/stage/LibUsbDotNet/Main/LegacyUsbRegistry.cs +++ b/stage/LibUsbDotNet/Main/LegacyUsbRegistry.cs @@ -148,10 +148,10 @@ public static List DeviceList } catch (Exception ex) { - Debug.Print(ex.Message); + Debug.WriteLine(ex.Message); } } - if (deviceHandle != null && !deviceHandle.IsClosed) deviceHandle.Close(); + if (deviceHandle != null && !deviceHandle.IsClosed) deviceHandle.Dispose(); } } return deviceList; diff --git a/stage/LibUsbDotNet/Main/ManualResetEventExtensions.cs b/stage/LibUsbDotNet/Main/ManualResetEventExtensions.cs new file mode 100644 index 0000000..b086273 --- /dev/null +++ b/stage/LibUsbDotNet/Main/ManualResetEventExtensions.cs @@ -0,0 +1,15 @@ +#if !NETSTANDARD1_5 +using Microsoft.Win32.SafeHandles; +using System.Threading; + +namespace LibUsbDotNet.Main +{ + internal static class ManualResetEventExtensions + { + public static SafeWaitHandle GetSafeWaitHandle(this ManualResetEvent mre) + { + return mre.SafeWaitHandle; + } + } +} +#endif diff --git a/stage/LibUsbDotNet/Main/SetupApiRegistry.cs b/stage/LibUsbDotNet/Main/SetupApiRegistry.cs index 1478f89..c62c803 100644 --- a/stage/LibUsbDotNet/Main/SetupApiRegistry.cs +++ b/stage/LibUsbDotNet/Main/SetupApiRegistry.cs @@ -19,6 +19,7 @@ // visit www.gnu.org. // // +#if WINDOWS_TESTING using System; using System.Collections.Generic; using System.Diagnostics; @@ -101,7 +102,7 @@ private static bool FillWindowsMonoUsbDeviceRegistry(UsbRegistry usbRegistry, Mo { if (priv.usb_interfaces[i].path == IntPtr.Zero) break; path = Marshal.PtrToStringAnsi(priv.usb_interfaces[i].path); - Debug.Print("Intf:{0} Path:{1}",i,path); + Debug.WriteLine("Intf:{0} Path:{1}",i,path); } path = Marshal.PtrToStringAnsi(priv.path); @@ -207,4 +208,5 @@ private static bool BuildMasterCallback(IntPtr deviceInfoSet, int deviceindex, r return false; } } -} \ No newline at end of file +} +#endif diff --git a/stage/LibUsbDotNet/Main/UsbDeviceFinder.cs b/stage/LibUsbDotNet/Main/UsbDeviceFinder.cs index 2c3e632..31a170c 100644 --- a/stage/LibUsbDotNet/Main/UsbDeviceFinder.cs +++ b/stage/LibUsbDotNet/Main/UsbDeviceFinder.cs @@ -22,8 +22,10 @@ using System; using System.Collections.Generic; using System.IO; +#if !NETSTANDARD1_5 using System.Runtime.Serialization; using System.Runtime.Serialization.Formatters.Binary; +#endif namespace LibUsbDotNet.Main { @@ -52,7 +54,10 @@ namespace LibUsbDotNet.Main /// /// /// - public class UsbDeviceFinder : ISerializable + public class UsbDeviceFinder +#if !NETSTANDARD1_5 + : ISerializable +#endif { /// The "exclude from search" value for . public const int NO_PID = int.MaxValue; @@ -139,6 +144,7 @@ public UsbDeviceFinder(string serialNumber) public UsbDeviceFinder(Guid deviceInterfaceGuid) : this(int.MaxValue, int.MaxValue, int.MaxValue, null, deviceInterfaceGuid) { } +#if !NETSTANDARD1_5 /// /// Use a serialization stream to fill the class. /// @@ -155,6 +161,7 @@ protected UsbDeviceFinder(SerializationInfo info, StreamingContext context) mSerialNumber = (string) info.GetValue("SerialNumber", typeof (string)); mDeviceInterfaceGuid = (Guid) info.GetValue("DeviceInterfaceGuid", typeof (Guid)); } +#endif /// /// @@ -218,7 +225,8 @@ public int Vid set { mVid = value; } } - #region ISerializable Members +#if !NETSTANDARD1_5 +#region ISerializable Members /// /// Store this class as a binary serializtion object. @@ -237,8 +245,10 @@ public void GetObjectData(SerializationInfo info, StreamingContext context) info.AddValue("DeviceInterfaceGuid", mDeviceInterfaceGuid); } - #endregion +#endregion +#endif +#if !NETSTANDARD1_5 /// /// Load usb device finder properties from a binary stream. /// @@ -261,6 +271,7 @@ public static void Save(UsbDeviceFinder usbDeviceFinder, Stream outStream) BinaryFormatter formatter = new BinaryFormatter(); formatter.Serialize(outStream, usbDeviceFinder); } +#endif /// /// Dynamic predicate find function. Pass this function into any method that has a parameter. diff --git a/stage/LibUsbDotNet/Main/UsbStream.cs b/stage/LibUsbDotNet/Main/UsbStream.cs index 542f65d..f42d9c1 100644 --- a/stage/LibUsbDotNet/Main/UsbStream.cs +++ b/stage/LibUsbDotNet/Main/UsbStream.cs @@ -19,6 +19,7 @@ // visit www.gnu.org. // // +#if !NETSTANDARD1_5 using System; using System.IO; using System.Runtime.InteropServices; @@ -283,4 +284,5 @@ private static void AsyncTransferFn(object oContext) #endregion } -} \ No newline at end of file +} +#endif diff --git a/stage/LibUsbDotNet/Main/UsbTransfer.cs b/stage/LibUsbDotNet/Main/UsbTransfer.cs index 55ee665..dcf4552 100644 --- a/stage/LibUsbDotNet/Main/UsbTransfer.cs +++ b/stage/LibUsbDotNet/Main/UsbTransfer.cs @@ -98,7 +98,7 @@ protected IntPtr NextBufPtr /// public bool IsCancelled { - get { return mTransferCancelEvent.WaitOne(0, UsbConstants.EXIT_CONTEXT); } + get { return mTransferCancelEvent.WaitOne(0); } } /// @@ -155,7 +155,7 @@ protected virtual void Dispose(bool disposing) } catch (Exception ex) { - Debug.Print(ex.Message); + Debug.WriteLine(ex.Message); } } @@ -384,7 +384,7 @@ public void Reset() /// 2 public bool IsCompleted { - get { return mTransferCompleteEvent.WaitOne(0, UsbConstants.EXIT_CONTEXT); } + get { return mTransferCompleteEvent.WaitOne(0); } } diff --git a/stage/LibUsbDotNet/MonoLibUsb/MonoLibUsbApi.cs b/stage/LibUsbDotNet/MonoLibUsb/MonoLibUsbApi.cs index be09cc6..fc6bd1c 100644 --- a/stage/LibUsbDotNet/MonoLibUsb/MonoLibUsbApi.cs +++ b/stage/LibUsbDotNet/MonoLibUsb/MonoLibUsbApi.cs @@ -922,7 +922,7 @@ public static int ControlTransferAsync([In] MonoUsbDeviceHandle deviceHandle, if (MonoUsbEventHandler.IsStopped) { - while (!completeEvent.WaitOne(0, false)) + while (!completeEvent.WaitOne(0)) { r = HandleEvents(pSessionHandle); if (r < 0) @@ -930,7 +930,7 @@ public static int ControlTransferAsync([In] MonoUsbDeviceHandle deviceHandle, if (r == (int)MonoUsbError.ErrorInterrupted) continue; transfer.Cancel(); - while (!completeEvent.WaitOne(0, false)) + while (!completeEvent.WaitOne(0)) if (HandleEvents(pSessionHandle) < 0) break; transfer.Free(); @@ -941,7 +941,7 @@ public static int ControlTransferAsync([In] MonoUsbDeviceHandle deviceHandle, } else { - completeEvent.WaitOne(Timeout.Infinite, UsbConstants.EXIT_CONTEXT); + completeEvent.WaitOne(Timeout.Infinite); } if (transfer.Status == MonoUsbTansferStatus.TransferCompleted) diff --git a/stage/LibUsbDotNet/MonoLibUsb/MonoUsbDevice.cs b/stage/LibUsbDotNet/MonoLibUsb/MonoUsbDevice.cs index 7ae2645..dcd2163 100644 --- a/stage/LibUsbDotNet/MonoLibUsb/MonoUsbDevice.cs +++ b/stage/LibUsbDotNet/MonoLibUsb/MonoUsbDevice.cs @@ -170,7 +170,7 @@ public override DriverModeType DriverMode public override bool Close() { ActiveEndpoints.Clear(); - if (IsOpen) mUsbHandle.Close(); + if (IsOpen) mUsbHandle.Dispose(); return true; } @@ -263,7 +263,7 @@ public override bool Open() mUsbHandle = handle; if (IsOpen) return true; - mUsbHandle.Close(); + mUsbHandle.Dispose(); return false; } @@ -501,7 +501,7 @@ private static ErrorCode GetConfigs(MonoUsbDevice usbDevice, out List - /// Closes the reference. When all references are no longer is use, the device - /// is closed in the finalizer. - /// - /// - /// The method is roughly equivalent to libusb_close(). - /// - public new void Close() - { - base.Close(); - } } } \ No newline at end of file diff --git a/stage/LibUsbDotNet/MonoLibUsb/MonoUsbEventHandler.cs b/stage/LibUsbDotNet/MonoLibUsb/MonoUsbEventHandler.cs index 3b5a272..59a8e02 100644 --- a/stage/LibUsbDotNet/MonoLibUsb/MonoUsbEventHandler.cs +++ b/stage/LibUsbDotNet/MonoLibUsb/MonoUsbEventHandler.cs @@ -38,7 +38,9 @@ public static class MonoUsbEventHandler private static bool mRunning; private static MonoUsbSessionHandle mSessionHandle; internal static Thread mUsbEventThread; +#if !NETSTANDARD1_5 private static ThreadPriority mPriority = ThreadPriority.Normal; +#endif private static UnixNativeTimeval mWaitUnixNativeTimeval; @@ -58,9 +60,10 @@ public static MonoUsbSessionHandle SessionHandle /// public static bool IsStopped { - get { return mIsStoppedEvent.WaitOne(0, false); } + get { return mIsStoppedEvent.WaitOne(0); } } +#if !NETSTANDARD1_5 /// /// Thread proirity to use for the handle events thread. /// @@ -69,6 +72,7 @@ public static ThreadPriority Priority get { return mPriority; } set {mPriority=value;} } +#endif /// /// Stops the handle events thread and closes the session handle. @@ -79,7 +83,7 @@ public static void Exit() if (mSessionHandle == null) return; if (mSessionHandle.IsInvalid) return; - mSessionHandle.Close(); + mSessionHandle.Dispose(); mSessionHandle = null; } @@ -148,7 +152,9 @@ public static bool Start() { mRunning = true; mUsbEventThread = new Thread(HandleEventFn); +#if !NETSTANDARD1_5 mUsbEventThread.Priority = mPriority; +#endif mUsbEventThread.Start(mSessionHandle); } @@ -178,7 +184,9 @@ public static void Stop(bool bWait) //bool bSuccess = mIsStoppedEvent.WaitOne((int)((mWaitUnixNativeTimeval.tv_sec * 1000 + mWaitUnixNativeTimeval.tv_usec) * 1.2), false); if (!bSuccess) { +#if !NETSTANDARD1_5 mUsbEventThread.Abort(); +#endif throw new UsbException(typeof(MonoUsbEventHandler), "Critical timeout failure! MonoUsbApi.HandleEventsTimeout did not return within the allotted time."); //LibUsbDotNet.UsbError.Error(ErrorCode.UnknownError, 0, "Critical timeout failure!", typeof(MonoUsbEventHandler)); //mIsStoppedEvent.Set(); diff --git a/stage/LibUsbDotNet/MonoLibUsb/MonoUsbSessionHandle.cs b/stage/LibUsbDotNet/MonoLibUsb/MonoUsbSessionHandle.cs index ef1e0cd..a6fe3a7 100644 --- a/stage/LibUsbDotNet/MonoLibUsb/MonoUsbSessionHandle.cs +++ b/stage/LibUsbDotNet/MonoLibUsb/MonoUsbSessionHandle.cs @@ -106,7 +106,7 @@ protected override bool ReleaseHandle() MonoUsbApi.Exit(handle); SetHandleAsInvalid(); mSessionCount--; - Debug.Print(GetType().Name + " : ReleaseHandle #{0}", mSessionCount); + Debug.WriteLine(GetType().Name + " : ReleaseHandle #{0}", mSessionCount); } } diff --git a/stage/LibUsbDotNet/MonoLibUsb/Profile/MonoUsbProfile.cs b/stage/LibUsbDotNet/MonoLibUsb/Profile/MonoUsbProfile.cs index 176e029..f956a70 100644 --- a/stage/LibUsbDotNet/MonoLibUsb/Profile/MonoUsbProfile.cs +++ b/stage/LibUsbDotNet/MonoLibUsb/Profile/MonoUsbProfile.cs @@ -160,7 +160,7 @@ private MonoUsbError GetDeviceDescriptor(out MonoUsbDeviceDescriptor monoUsbDevi public void Close() { if (!mMonoUSBProfileHandle.IsClosed) - mMonoUSBProfileHandle.Close(); + mMonoUSBProfileHandle.Dispose(); } /// diff --git a/stage/LibUsbDotNet/MonoLibUsb/Profile/MonoUsbProfileHandle.cs b/stage/LibUsbDotNet/MonoLibUsb/Profile/MonoUsbProfileHandle.cs index 3d93900..534b792 100644 --- a/stage/LibUsbDotNet/MonoLibUsb/Profile/MonoUsbProfileHandle.cs +++ b/stage/LibUsbDotNet/MonoLibUsb/Profile/MonoUsbProfileHandle.cs @@ -83,7 +83,7 @@ protected override bool ReleaseHandle() MonoUsbApi.UnrefDevice(handle); mDeviceProfileRefCount--; SetHandleAsInvalid(); - Debug.Print(GetType().Name + " : ReleaseHandle #{0}", mDeviceProfileRefCount); + Debug.WriteLine(string.Format(GetType().Name + " : ReleaseHandle #{0}", mDeviceProfileRefCount)); } return true; } diff --git a/stage/LibUsbDotNet/MonoLibUsb/Profile/MonoUsbProfileList.cs b/stage/LibUsbDotNet/MonoLibUsb/Profile/MonoUsbProfileList.cs index 05d4fc7..0555885 100644 --- a/stage/LibUsbDotNet/MonoLibUsb/Profile/MonoUsbProfileList.cs +++ b/stage/LibUsbDotNet/MonoLibUsb/Profile/MonoUsbProfileList.cs @@ -127,7 +127,7 @@ public int Refresh(MonoUsbSessionHandle sessionHandle) #if LIBUSBDOTNET UsbError.Error(ErrorCode.MonoApiError, ret, "Refresh:GetDeviceList Failed", this); #else - System.Diagnostics.Debug.Print("libusb_get_device_list failed:{0} {1}", + System.Diagnostics.Debug.WriteLine("libusb_get_device_list failed:{0} {1}", (MonoUsbError) ret, MonoUsbApi.StrError((MonoUsbError) ret)); #endif @@ -141,7 +141,7 @@ public int Refresh(MonoUsbSessionHandle sessionHandle) if (stopCount <= 0) break; } syncWith(newList); - monoUSBProfileListHandle.Close(); + monoUSBProfileListHandle.Dispose(); return ret; } diff --git a/stage/LibUsbDotNet/MonoLibUsb/Transfer/MonoUsbControlSetupHandle.cs b/stage/LibUsbDotNet/MonoLibUsb/Transfer/MonoUsbControlSetupHandle.cs index 9f72127..058f749 100644 --- a/stage/LibUsbDotNet/MonoLibUsb/Transfer/MonoUsbControlSetupHandle.cs +++ b/stage/LibUsbDotNet/MonoLibUsb/Transfer/MonoUsbControlSetupHandle.cs @@ -105,7 +105,7 @@ protected override bool ReleaseHandle() { Marshal.FreeHGlobal(handle); SetHandleAsInvalid(); - Debug.Print(GetType().Name + " : ReleaseHandle"); + Debug.WriteLine(GetType().Name + " : ReleaseHandle"); } return true; } diff --git a/stage/LibUsbDotNet/MonoLibUsb/Transfer/MonoUsbTransferContext.cs b/stage/LibUsbDotNet/MonoLibUsb/Transfer/MonoUsbTransferContext.cs index 29421ed..69abc84 100644 --- a/stage/LibUsbDotNet/MonoLibUsb/Transfer/MonoUsbTransferContext.cs +++ b/stage/LibUsbDotNet/MonoLibUsb/Transfer/MonoUsbTransferContext.cs @@ -115,7 +115,7 @@ private void freeTransfer() { if (mTransfer.IsInvalid || mOwnsTransfer == false) return; mTransferCancelEvent.Set(); - mTransferCompleteEvent.WaitOne(200, UsbConstants.EXIT_CONTEXT); + mTransferCompleteEvent.WaitOne(200); mTransfer.Free(); if (mCompleteEventHandle.IsAllocated) @@ -184,9 +184,9 @@ public override void Fill(IntPtr buffer, int offset, int count, int timeout, int /// public override ErrorCode Submit() { - if (mTransferCancelEvent.WaitOne(0, false)) return ErrorCode.IoCancelled; + if (mTransferCancelEvent.WaitOne(0)) return ErrorCode.IoCancelled; - if (!mTransferCompleteEvent.WaitOne(0, UsbConstants.EXIT_CONTEXT)) return ErrorCode.ResourceBusy; + if (!mTransferCompleteEvent.WaitOne(0)) return ErrorCode.ResourceBusy; mTransfer.PtrBuffer = NextBufPtr; mTransfer.Length = RequestCount; @@ -218,8 +218,7 @@ public override ErrorCode Wait(out int transferredCount, bool cancel) ErrorCode ec; int iWait = WaitHandle.WaitAny(new WaitHandle[] {mTransferCompleteEvent, mTransferCancelEvent}, - Timeout.Infinite, - UsbConstants.EXIT_CONTEXT); + Timeout.Infinite); switch (iWait) { case 0: // TransferCompleteEvent @@ -237,7 +236,7 @@ public override ErrorCode Wait(out int transferredCount, bool cancel) return ec; case 1: // TransferCancelEvent ret = (int)mTransfer.Cancel(); - bool bTransferComplete = mTransferCompleteEvent.WaitOne(100, UsbConstants.EXIT_CONTEXT); + bool bTransferComplete = mTransferCompleteEvent.WaitOne(100); mTransferCompleteEvent.Set(); if (ret != 0 || !bTransferComplete) diff --git a/stage/LibUsbDotNet/UsbDevice.OS.Specific.cs b/stage/LibUsbDotNet/UsbDevice.OS.Specific.cs index c5fa995..361da5b 100644 --- a/stage/LibUsbDotNet/UsbDevice.OS.Specific.cs +++ b/stage/LibUsbDotNet/UsbDevice.OS.Specific.cs @@ -276,7 +276,7 @@ public static UsbKernelVersion KernelVersion } } - +#if !NETSTANDARD1_5 /// /// Gets a object that contains the current platform identifier and version number. /// @@ -287,5 +287,6 @@ public static OperatingSystem OSVersion return Helper.OSVersion; } } +#endif } } \ No newline at end of file diff --git a/stage/LibUsbDotNet/UsbEndpointReader.cs b/stage/LibUsbDotNet/UsbEndpointReader.cs index 2c82f55..a2ca626 100644 --- a/stage/LibUsbDotNet/UsbEndpointReader.cs +++ b/stage/LibUsbDotNet/UsbEndpointReader.cs @@ -22,7 +22,9 @@ using System; using System.Runtime.InteropServices; using System.Threading; +#if !NETSTANDARD1_5 using System.Windows.Forms; +#endif using LibUsbDotNet.Internal; using LibUsbDotNet.Main; @@ -44,7 +46,9 @@ public class UsbEndpointReader : UsbEndpointBase private bool mDataReceivedEnabled; private int mReadBufferSize; private Thread mReadThread; +#if !NETSTANDARD1_5 private ThreadPriority mReadThreadPriority = ThreadPriority.Normal; +#endif internal UsbEndpointReader(UsbDevice usbDevice, int readBufferSize, byte alternateInterfaceID, ReadEndpointID readEndpointID, EndpointType endpointType) : base(usbDevice, alternateInterfaceID, (Byte)readEndpointID, endpointType) { mReadBufferSize = readBufferSize; } @@ -93,6 +97,7 @@ public int ReadBufferSize set { mReadBufferSize = value; } } +#if !NETSTANDARD1_5 /// /// Gets/Sets the Priority level for the read thread when is true. /// @@ -101,7 +106,7 @@ public ThreadPriority ReadThreadPriority get { return mReadThreadPriority; } set { mReadThreadPriority = value; } } - +#endif /// /// Reads data from the current . @@ -214,10 +219,12 @@ private static void ReadData(object context) if (eReturn != ErrorCode.IoTimedOut) break; } } +#if !NETSTANDARD1_5 catch (ThreadAbortException) { UsbError.Error(ErrorCode.ReceiveThreadTerminated,0, "ReadData:Read thread aborted.", reader); } +#endif finally { reader.Abort(); @@ -233,27 +240,37 @@ private static void ReadData(object context) private void StartReadThread() { mReadThread = new Thread(ReadData); +#if !NETSTANDARD1_5 mReadThread.Priority = ReadThreadPriority; +#endif mReadThread.Start(TransferContext); Thread.Sleep(1); +#if !NETSTANDARD1_5 Application.DoEvents(); +#endif } private bool StopReadThread() { Abort(); Thread.Sleep(1); +#if !NETSTANDARD1_5 Application.DoEvents(); +#endif DateTime dtStart = DateTime.Now; while (mReadThread.IsAlive && ((DateTime.Now - dtStart).TotalSeconds < 5)) // 5 sec fail-safe { Thread.Sleep(100); +#if !NETSTANDARD1_5 Application.DoEvents(); +#endif } if (mReadThread.IsAlive) { UsbError.Error(ErrorCode.ReceiveThreadTerminated,0, "Failed stopping read thread.", this); +#if !NETSTANDARD1_5 mReadThread.Abort(); +#endif return false; } return true; diff --git a/stage/LibUsbDotNet/WinUsb/Internal/WinUsbAPI.cs b/stage/LibUsbDotNet/WinUsb/Internal/WinUsbAPI.cs index 4a712b7..7fb69f9 100644 --- a/stage/LibUsbDotNet/WinUsb/Internal/WinUsbAPI.cs +++ b/stage/LibUsbDotNet/WinUsb/Internal/WinUsbAPI.cs @@ -32,7 +32,9 @@ namespace LibUsbDotNet.WinUsb.Internal { +#if !NETSTANDARD1_5 [SuppressUnmanagedCodeSecurity] +#endif internal class WinUsbAPI : UsbApiBase { #if USE_LUSBW_FOR_WINUSB diff --git a/stage/LibUsbDotNet/WinUsb/WinUsbDevice.cs b/stage/LibUsbDotNet/WinUsb/WinUsbDevice.cs index d6397fe..ae3de2a 100644 --- a/stage/LibUsbDotNet/WinUsb/WinUsbDevice.cs +++ b/stage/LibUsbDotNet/WinUsb/WinUsbDevice.cs @@ -92,11 +92,11 @@ public override bool Close() if (IsOpen) { ActiveEndpoints.Clear(); - mUsbHandle.Close(); + mUsbHandle.Dispose(); if (mSafeDevHandle != null) if (!mSafeDevHandle.IsClosed) - mSafeDevHandle.Close(); + mSafeDevHandle.Dispose(); } return true; } From 78bcc819aacf4a5305078086883e09aed7c8275a Mon Sep 17 00:00:00 2001 From: Frederik Carlier Date: Tue, 9 Aug 2016 16:15:42 +0200 Subject: [PATCH 05/13] Fix building on .NET using Visual Studio, target .NET 3.5 instead of 2.0 (which use the same runtime) --- stage/Benchmark/Benchmark.csproj | 7 ++++--- .../Properties/Resources.Designer.cs | 4 ++-- .../Benchmark/Properties/Settings.Designer.cs | 4 ++-- stage/BenchmarkCon/BenchmarkCon.csproj | 19 ++++++++++-------- .../Device.Notification.csproj | 11 ++++++---- .../Read.Isochronous/Read.Isochronous.csproj | 7 ++++--- stage/Examples/Read.Only/Read.Only.csproj | 7 ++++--- .../Read.Write.Async/Read.Write.Async.csproj | 11 +++++++--- .../Read.Write.Event/Read.Write.Event.csproj | 19 +++++++++++------- stage/Examples/Read.Write/Read.Write.csproj | 13 ++++++------ stage/Examples/Show.Info/Show.Info.csproj | 17 ++++++++++------ stage/InfWizard/InfWizard.csproj | 13 +++++++++--- stage/LibUsbDotNet.sln | 20 +++++++++---------- .../LibUsb/Internal/LibUsbDriverIO.cs | 12 +++++++++++ stage/LibUsbDotNet/LibUsbDotNet.csproj | 6 +++++- stage/LibUsbDotNet/Main/Helper.cs | 4 ++++ .../LibUsbDotNet/MonoLibUsb/MonoUsbDevice.cs | 2 +- .../MonoLibUsb/MonoUsbSessionHandle.cs | 2 +- .../Properties/Resources.Designer.cs | 4 ++-- .../Test_Bulk/Properties/Settings.Designer.cs | 4 ++-- stage/Test_Bulk/Test_Bulk.csproj | 7 ++++--- .../Properties/Resources.Designer.cs | 4 ++-- .../Properties/Settings.Designer.cs | 4 ++-- .../Test_DeviceNotify.csproj | 7 ++++--- .../Properties/Resources.Designer.cs | 4 ++-- .../Test_Info/Properties/Settings.Designer.cs | 4 ++-- stage/Test_Info/Test_Info.csproj | 5 +++-- 27 files changed, 138 insertions(+), 83 deletions(-) diff --git a/stage/Benchmark/Benchmark.csproj b/stage/Benchmark/Benchmark.csproj index f759c08..4df3088 100644 --- a/stage/Benchmark/Benchmark.csproj +++ b/stage/Benchmark/Benchmark.csproj @@ -15,8 +15,9 @@ 3.5 - v2.0 + v3.5 UsbIco.ico + true @@ -105,8 +106,8 @@ - - {0A78F6FF-5586-4052-8104-E23FF83A7CE1} + + {0a78f6ff-5586-4052-8104-e23ff83a7ce1} LibUsbDotNet diff --git a/stage/Benchmark/Properties/Resources.Designer.cs b/stage/Benchmark/Properties/Resources.Designer.cs index 0e91936..4b91143 100644 --- a/stage/Benchmark/Properties/Resources.Designer.cs +++ b/stage/Benchmark/Properties/Resources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.3053 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -19,7 +19,7 @@ namespace Benchmark.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { diff --git a/stage/Benchmark/Properties/Settings.Designer.cs b/stage/Benchmark/Properties/Settings.Designer.cs index 6d08f61..3a59ff9 100644 --- a/stage/Benchmark/Properties/Settings.Designer.cs +++ b/stage/Benchmark/Properties/Settings.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.3053 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -12,7 +12,7 @@ namespace Benchmark.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/stage/BenchmarkCon/BenchmarkCon.csproj b/stage/BenchmarkCon/BenchmarkCon.csproj index fa6a284..65276a8 100644 --- a/stage/BenchmarkCon/BenchmarkCon.csproj +++ b/stage/BenchmarkCon/BenchmarkCon.csproj @@ -10,7 +10,7 @@ Properties LibUsbDotNet BenchmarkCon - v2.0 + v3.5 512 UsbDos.ico @@ -18,6 +18,7 @@ 3.5 + true @@ -63,13 +64,9 @@ - - {0A78F6FF-5586-4052-8104-E23FF83A7CE1} - LibUsbDotNet - - - - + + Designer + @@ -79,6 +76,12 @@ + + + {0a78f6ff-5586-4052-8104-e23ff83a7ce1} + LibUsbDotNet + +