Use object initializer.

This commit is contained in:
2022-11-14 01:23:52 +00:00
parent c4a95c40ca
commit 2b40eab0d2
9 changed files with 85 additions and 68 deletions

View File

@@ -90,10 +90,12 @@ partial class Device : Devices.Device
}
// Windows is answering SCSI INQUIRY for all device types so it needs to be detected first
var query = new StoragePropertyQuery();
query.PropertyId = StoragePropertyId.Device;
query.QueryType = StorageQueryType.Standard;
query.AdditionalParameters = new byte[1];
var query = new StoragePropertyQuery
{
PropertyId = StoragePropertyId.Device,
QueryType = StorageQueryType.Standard,
AdditionalParameters = new byte[1]
};
IntPtr descriptorPtr = Marshal.AllocHGlobal(1000);
var descriptorB = new byte[1000];

View File

@@ -705,9 +705,11 @@ static partial class Usb
if(!_portIsHub)
return null;
var hub = new UsbHub();
hub._hubIsRootHub = false;
hub._hubDeviceDesc = "External Hub";
var hub = new UsbHub
{
_hubIsRootHub = false,
_hubDeviceDesc = "External Hub"
};
// Open a handle to the Host Controller
IntPtr h = CreateFile(_portHubDevicePath, GENERIC_WRITE, FILE_SHARE_WRITE, IntPtr.Zero, OPEN_EXISTING, 0,