Skip to content

Commit 394fe76

Browse files
committed
Ran code formatting on full project
1 parent b82c081 commit 394fe76

15 files changed

Lines changed: 75 additions & 90 deletions

src/Drivers/DriverStore.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2929
using System.IO;
3030
using System.Runtime.InteropServices;
3131
using System.Text;
32-
using System.Threading;
3332

34-
using Windows.Win32;
35-
using Windows.Win32.Devices.Properties;
3633
using Windows.Win32.Foundation;
3734

3835
using Nefarius.Utilities.DeviceManagement.Util;

src/Exceptions/PnPDeviceNotFoundException.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#nullable enable
2-
using System;
1+
using System;
32
using System.Diagnostics.CodeAnalysis;
43

54
namespace Nefarius.Utilities.DeviceManagement.Exceptions;
@@ -14,7 +13,7 @@ public class PnPDeviceNotFoundException : Exception
1413
internal PnPDeviceNotFoundException() : base("The desired device instance was not found on the system.")
1514
{
1615
}
17-
16+
1817
internal PnPDeviceNotFoundException(string instanceId) : this()
1918
{
2019
InstanceId = instanceId;

src/Exceptions/Win32Exception.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
#nullable enable
2-
3-
using System;
1+
using System;
42
using System.Diagnostics.CodeAnalysis;
53
using System.Runtime.InteropServices;
64

src/Nefarius.Utilities.DeviceManagement.csproj

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,20 @@
99
<PackageProjectUrl>https://github.com/nefarius/Nefarius.Utilities.DeviceManagement</PackageProjectUrl>
1010
<Description>Managed wrappers around SetupAPI, Cfgmgr32, NewDev and DrvStore native APIs on Windows.</Description>
1111
<NoWarn>CA1416</NoWarn>
12+
<Nullable>enable</Nullable>
1213
</PropertyGroup>
1314

1415
<PropertyGroup>
1516
<MinVerTagPrefix>v</MinVerTagPrefix>
1617
</PropertyGroup>
17-
18+
1819
<ItemGroup>
19-
<Compile Remove="Generator\**" />
20-
<Compile Remove="Tests\**" />
21-
<EmbeddedResource Remove="Generator\**" />
22-
<EmbeddedResource Remove="Tests\**" />
23-
<None Remove="Generator\**" />
24-
<None Remove="Tests\**" />
20+
<Compile Remove="Generator\**"/>
21+
<Compile Remove="Tests\**"/>
22+
<EmbeddedResource Remove="Generator\**"/>
23+
<EmbeddedResource Remove="Tests\**"/>
24+
<None Remove="Generator\**"/>
25+
<None Remove="Tests\**"/>
2526
</ItemGroup>
2627

2728
<ItemGroup>
@@ -35,22 +36,22 @@
3536
<PrivateAssets>all</PrivateAssets>
3637
</PackageReference>
3738
<PackageReference Include="MinVer" Version="6.0.0">
38-
<PrivateAssets>all</PrivateAssets>
39-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
39+
<PrivateAssets>all</PrivateAssets>
40+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
4041
</PackageReference>
41-
<PackageReference Include="System.Memory" Version="4.6.3" />
42+
<PackageReference Include="System.Memory" Version="4.6.3"/>
4243
</ItemGroup>
4344

4445
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' Or '$(TargetFramework)' == 'netstandard2.1'">
45-
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" PrivateAssets="All" />
46+
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" PrivateAssets="All"/>
4647
</ItemGroup>
4748

4849
<ItemGroup>
49-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
50+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
5051
</ItemGroup>
5152

5253
<ItemGroup>
53-
<ProjectReference Include="Generator\DeviceManagementPropertiesGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
54+
<ProjectReference Include="Generator\DeviceManagementPropertiesGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>
5455
</ItemGroup>
5556

5657
</Project>

src/PnP/Devcon.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,8 @@ public static unsafe bool Remove(Guid classGuid, string instanceId, out bool reb
395395
ref classGuid,
396396
IntPtr.Zero,
397397
HWND.Null,
398-
(int)SETUP_DI_GET_CLASS_DEVS_FLAGS.DIGCF_PRESENT | (int)SETUP_DI_GET_CLASS_DEVS_FLAGS.DIGCF_DEVICEINTERFACE
398+
(int)SETUP_DI_GET_CLASS_DEVS_FLAGS.DIGCF_PRESENT |
399+
(int)SETUP_DI_GET_CLASS_DEVS_FLAGS.DIGCF_DEVICEINTERFACE
399400
);
400401

401402
if (SetupApi.SetupDiOpenDeviceInfo(
@@ -526,7 +527,8 @@ public static unsafe bool Update(string hardwareId, string fullInfPath,
526527
HWND.Null,
527528
hardwareId,
528529
fullInfPath,
529-
UPDATEDRIVERFORPLUGANDPLAYDEVICES_FLAGS.INSTALLFLAG_FORCE | UPDATEDRIVERFORPLUGANDPLAYDEVICES_FLAGS.INSTALLFLAG_NONINTERACTIVE,
530+
UPDATEDRIVERFORPLUGANDPLAYDEVICES_FLAGS.INSTALLFLAG_FORCE |
531+
UPDATEDRIVERFORPLUGANDPLAYDEVICES_FLAGS.INSTALLFLAG_NONINTERACTIVE,
530532
&reboot
531533
);
532534

src/PnP/DeviceClassFilters.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
1-
#nullable enable
2-
using System;
1+
using System;
32
using System.Collections.Generic;
43
using System.Diagnostics.CodeAnalysis;
54
using System.Linq;
65
using System.Runtime.InteropServices;
76

87
using Windows.Win32;
98
using Windows.Win32.Foundation;
10-
using Windows.Win32.Security;
119
using Windows.Win32.Storage.FileSystem;
1210
using Windows.Win32.System.Registry;
13-
using Windows.Win32.System.Services;
1411

1512
using Microsoft.Win32.SafeHandles;
1613

@@ -140,7 +137,8 @@ private static unsafe void AddFiltersEntry(Guid classGuid, string filter, string
140137
const uint serviceFlags = (uint)FILE_ACCESS_RIGHTS.STANDARD_RIGHTS_REQUIRED | PInvoke.SC_MANAGER_CONNECT |
141138
PInvoke.SC_MANAGER_ENUMERATE_SERVICE;
142139

143-
using CloseServiceHandleSafeHandle? serviceManager = PInvoke.OpenSCManager(null, "ServicesActive", serviceFlags);
140+
using CloseServiceHandleSafeHandle?
141+
serviceManager = PInvoke.OpenSCManager(null, "ServicesActive", serviceFlags);
144142

145143
if (serviceManager.IsInvalid)
146144
{

src/PnP/DeviceNotificationListener.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ private unsafe void Start(object parameter)
269269
ListenerItem listenerItem = (ListenerItem)parameter;
270270
string className = GenerateRandomString(); // random string to avoid conflicts
271271
string windowName = GenerateRandomString();
272-
using FreeLibrarySafeHandle hInst = PInvoke.GetModuleHandle((string)null);
272+
using FreeLibrarySafeHandle hInst = PInvoke.GetModuleHandle(null);
273273

274274
WNDCLASSEXW windowClass = new()
275275
{

src/PnP/DevicePropertyKey.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
22
using System.Diagnostics.CodeAnalysis;
33

4-
using Windows.Win32.Devices.Properties;
54
using Windows.Win32.Foundation;
65

76
namespace Nefarius.Utilities.DeviceManagement.PnP;

src/PnP/IPnPDevice.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#nullable enable
2-
using System;
1+
using System;
32
using System.Collections.Generic;
43
using System.Diagnostics.CodeAnalysis;
54

@@ -124,7 +123,7 @@ public interface IPnPDevice
124123
/// Gets whether a reboot is required for the changes to take effect or not.
125124
/// </param>
126125
void InstallCustomDriver(string infName, out bool rebootRequired);
127-
126+
128127
/// <summary>
129128
/// Uninstalls this device instance. Unlike <see cref="Remove" /> this call will unload and revert the device function
130129
/// driver to the best available compatible candidate on next device boot.
@@ -137,7 +136,7 @@ public interface IPnPDevice
137136
/// <exception cref="Win32Exception"></exception>
138137
/// <exception cref="ArgumentOutOfRangeException"></exception>
139138
void Uninstall();
140-
139+
141140
/// <summary>
142141
/// Uninstalls this device instance. Unlike <see cref="Remove" /> this call will unload and revert the device function
143142
/// driver to the best available compatible candidate on next device boot.

src/PnP/PnPDevice.Common.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#nullable enable
2-
using System.Collections.Generic;
1+
using System.Collections.Generic;
32
using System.Linq;
43

54
namespace Nefarius.Utilities.DeviceManagement.PnP;

0 commit comments

Comments
 (0)