Skip to content

Code Quality: Removed unused P/Invoke methods from helper class #17120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 0 additions & 82 deletions src/Files.App/Helpers/Win32/Win32PInvoke.Enums.cs
Original file line number Diff line number Diff line change
@@ -81,88 +81,6 @@ public enum StreamInfoLevels
FindStreamInfoStandard = 0
}

[Flags]
public enum CryptProtectFlags
{
CRYPTPROTECT_UI_FORBIDDEN = 0x1,
CRYPTPROTECT_LOCAL_MACHINE = 0x4,
CRYPTPROTECT_CRED_SYNC = 0x8,
CRYPTPROTECT_AUDIT = 0x10,
CRYPTPROTECT_NO_RECOVERY = 0x20,
CRYPTPROTECT_VERIFY_PROTECTION = 0x40,
CRYPTPROTECT_CRED_REGENERATE = 0x80
}

public enum TOKEN_INFORMATION_CLASS
{
TokenUser = 1,
TokenGroups,
TokenPrivileges,
TokenOwner,
TokenPrimaryGroup,
TokenDefaultDacl,
TokenSource,
TokenType,
TokenImpersonationLevel,
TokenStatistics,
TokenRestrictedSids,
TokenSessionId,
TokenGroupsAndPrivileges,
TokenSessionReference,
TokenSandBoxInert,
TokenAuditPolicy,
TokenOrigin,
TokenElevationType,
TokenLinkedToken,
TokenElevation,
TokenHasRestrictions,
TokenAccessInformation,
TokenVirtualizationAllowed,
TokenVirtualizationEnabled,
TokenIntegrityLevel,
TokenUIAccess,
TokenMandatoryPolicy,
TokenLogonSid,
TokenIsAppContainer,
TokenCapabilities,
TokenAppContainerSid,
TokenAppContainerNumber,
TokenUserClaimAttributes,
TokenDeviceClaimAttributes,
TokenRestrictedUserClaimAttributes,
TokenRestrictedDeviceClaimAttributes,
TokenDeviceGroups,
TokenRestrictedDeviceGroups,
TokenSecurityAttributes,
TokenIsRestricted
}

[Serializable]
public enum TOKEN_TYPE
{
TokenPrimary = 1,
TokenImpersonation = 2
}

[Flags]
public enum TokenAccess : uint
{
TOKEN_ASSIGN_PRIMARY = 0x0001,
TOKEN_DUPLICATE = 0x0002,
TOKEN_IMPERSONATE = 0x0004,
TOKEN_QUERY = 0x0008,
TOKEN_QUERY_SOURCE = 0x0010,
TOKEN_ADJUST_PRIVILEGES = 0x0020,
TOKEN_ADJUST_GROUPS = 0x0040,
TOKEN_ADJUST_DEFAULT = 0x0080,
TOKEN_ADJUST_SESSIONID = 0x0100,
TOKEN_ALL_ACCESS_P = 0x000F00FF,
TOKEN_ALL_ACCESS = 0x000F01FF,
TOKEN_READ = 0x00020008,
TOKEN_WRITE = 0x000200E0,
TOKEN_EXECUTE = 0x00020000
}

public enum FINDEX_INFO_LEVELS
{
FindExInfoStandard = 0,
123 changes: 1 addition & 122 deletions src/Files.App/Helpers/Win32/Win32PInvoke.Methods.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2024 Files Community
// Copyright (c) 2024 Files Community
// Licensed under the MIT License. See the LICENSE.

using System.IO;
@@ -56,13 +56,6 @@ public static extern int RmGetList(
ref uint lpdwRebootReasons
);

[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
public static extern bool SetPropW(
IntPtr hWnd,
string lpString,
IntPtr hData
);

[DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
public static extern IntPtr CreateEvent(
IntPtr lpEventAttributes,
@@ -102,39 +95,12 @@ public static extern bool CloseHandle(
IntPtr hObject
);

[DllImport("api-ms-win-core-io-l1-1-1.dll")]
public static extern bool GetOverlappedResult(
IntPtr hFile,
OVERLAPPED lpOverlapped,
out int lpNumberOfBytesTransferred,
bool bWait
);

[DllImport("api-ms-win-core-io-l1-1-1.dll")]
public static extern bool CancelIo(
IntPtr hFile
);

[DllImport("api-ms-win-core-io-l1-1-1.dll")]
public static extern bool CancelIoEx(
IntPtr hFile,
IntPtr lpOverlapped
);

[DllImport("api-ms-win-core-synch-l1-2-0.dll")]
public static extern uint WaitForMultipleObjectsEx(
uint nCount,
IntPtr[] lpHandles,
bool bWaitAll,
uint dwMilliseconds,
bool bAlertable
);

[DllImport("api-ms-win-core-synch-l1-2-0.dll", SetLastError = true)]
public static extern bool ResetEvent(
IntPtr hEvent
);

[DllImport("api-ms-win-core-synch-l1-2-0.dll", SetLastError = true)]
public static extern uint WaitForSingleObjectEx(
IntPtr hHandle,
@@ -202,16 +168,6 @@ public static extern bool DeviceIoControl(
out uint lpBytesReturned,
IntPtr lpOverlapped);

[DllImport("user32.dll")]
public static extern int ToUnicode(
uint virtualKeyCode,
uint scanCode,
byte[] keyboardState,
[Out, MarshalAs(UnmanagedType.LPWStr, SizeConst = 64)] StringBuilder receivingBuffer,
int bufferSize,
uint flags
);

[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern int ToUnicodeEx(
uint virtualKeyCode,
@@ -223,11 +179,6 @@ public static extern int ToUnicodeEx(
IntPtr keyboardLayout
);

[DllImport("user32.dll")]
public static extern bool TranslateMessage(
ref MSG lpMsg
);

[DllImport("api-ms-win-core-file-fromapp-l1-1-0.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall, SetLastError = true)]
public static extern IntPtr CreateFileFromApp(
string lpFileName,
@@ -252,14 +203,6 @@ public static extern bool SetFileAttributesFromApp(
string lpFileName,
FileAttributes dwFileAttributes);

[DllImport("api-ms-win-core-file-l1-2-1.dll", ExactSpelling = true, CallingConvention = CallingConvention.StdCall, SetLastError = true)]
public static extern uint SetFilePointer(
IntPtr hFile,
long lDistanceToMove,
IntPtr lpDistanceToMoveHigh,
uint dwMoveMethod
);

[DllImport("api-ms-win-core-file-l1-2-1.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall, SetLastError = true)]
public unsafe static extern bool ReadFile(
IntPtr hFile,
@@ -310,14 +253,6 @@ public static extern bool GetFileInformationByHandleEx(
uint dwBufferSize
);

[DllImport("api-ms-win-core-file-l2-1-1.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall, SetLastError = true)]
public static extern bool GetFileInformationByHandleEx(
IntPtr hFile,
FILE_INFO_BY_HANDLE_CLASS infoClass,
IntPtr dirInfo,
uint dwBufferSize
);

[DllImport("kernel32.dll", ExactSpelling = true, CharSet = CharSet.Auto, SetLastError = true)]
public static extern IntPtr FindFirstStreamW(
string lpFileName,
@@ -333,49 +268,6 @@ public static extern bool FindNextStreamW(
[In, Out, MarshalAs(UnmanagedType.LPStruct)] WIN32_FIND_STREAM_DATA lpFindStreamData
);

[DllImport("Shcore.dll", SetLastError = true)]
public static extern int GetDpiForMonitor(
IntPtr hmonitor,
uint dpiType,
out uint dpiX,
out uint dpiY
);

[DllImport("api-ms-win-core-processthreads-l1-1-0.dll", SetLastError = true, ExactSpelling = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool OpenProcessToken(
[In] IntPtr ProcessHandle, TokenAccess DesiredAccess, out IntPtr TokenHandle);

[DllImport("api-ms-win-core-processthreads-l1-1-2.dll", SetLastError = true, ExactSpelling = true)]
public static extern IntPtr GetCurrentProcess();

[DllImport("api-ms-win-security-base-l1-1-0.dll", SetLastError = true, ExactSpelling = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool GetTokenInformation(
IntPtr hObject,
TOKEN_INFORMATION_CLASS tokenInfoClass,
IntPtr pTokenInfo,
int tokenInfoLength,
out int returnLength
);

[DllImport("api-ms-win-security-base-l1-1-0.dll", ExactSpelling = true, SetLastError = true)]
public static extern int GetLengthSid(
IntPtr pSid
);

[DllImport("crypt32.dll", SetLastError = true, CharSet = CharSet.Auto)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool CryptUnprotectData(
in CRYPTOAPI_BLOB pDataIn,
StringBuilder szDataDescr,
in CRYPTOAPI_BLOB pOptionalEntropy,
IntPtr pvReserved,
IntPtr pPromptStruct,
CryptProtectFlags dwFlags,
out CRYPTOAPI_BLOB pDataOut
);

[DllImport("api-ms-win-core-wow64-l1-1-1.dll", SetLastError = true)]
public static extern bool IsWow64Process2(
IntPtr process,
@@ -410,19 +302,6 @@ public static extern IntPtr FindFirstFileExFromApp(
int dwAdditionalFlags
);

[DllImport("api-ms-win-core-string-l1-1-0.dll", CharSet = CharSet.Unicode)]
public static extern int CompareStringEx(
string localeName,
int flags,
string str1,
int count1,
string str2,
int count2,
IntPtr versionInformation,
IntPtr reserved,
int param
);

[LibraryImport("shell32.dll", EntryPoint = "#865", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static partial bool IsElevationRequired(
24 changes: 0 additions & 24 deletions src/Files.App/Helpers/Win32/Win32PInvoke.Structs.cs
Original file line number Diff line number Diff line change
@@ -139,12 +139,6 @@ public sealed class WIN32_FIND_STREAM_DATA
public string cStreamName;
}

[StructLayout(LayoutKind.Sequential)]
public struct TOKEN_USER
{
public SID_AND_ATTRIBUTES User;
}

[StructLayout(LayoutKind.Sequential)]
public struct SID_AND_ATTRIBUTES
{
@@ -153,13 +147,6 @@ public struct SID_AND_ATTRIBUTES
public uint Attributes;
}

[StructLayout(LayoutKind.Sequential)]
public struct CRYPTOAPI_BLOB
{
public uint cbData;
public IntPtr pbData;
}

[StructLayout(LayoutKind.Sequential)]
public struct SYSTEMTIME
{
@@ -211,16 +198,5 @@ public struct WIN32_FIND_DATA
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 14)]
public string cAlternateFileName;
}

[StructLayout(LayoutKind.Sequential)]
public struct MSG
{
public IntPtr hwnd;
public uint message;
public IntPtr wParam;
public IntPtr lParam;
public uint time;
public System.Drawing.Point pt;
}
}
}

Unchanged files with check annotations Beta

/// <summary>
/// Initializes a new instance of the <see cref="BladeItem"/> class.
/// </summary>
public BladeItem()

Check warning on line 18 in src/Files.App.Controls/BladeView/BladeItem.cs

GitHub Actions / build (Debug, x64)

Non-nullable field '_parentBladeView' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 18 in src/Files.App.Controls/BladeView/BladeItem.cs

GitHub Actions / build (Debug, x64)

Non-nullable field '_closeButton' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 18 in src/Files.App.Controls/BladeView/BladeItem.cs

GitHub Actions / build (Debug, arm64)

Non-nullable field '_parentBladeView' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 18 in src/Files.App.Controls/BladeView/BladeItem.cs

GitHub Actions / build (Debug, arm64)

Non-nullable field '_closeButton' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 18 in src/Files.App.Controls/BladeView/BladeItem.cs

GitHub Actions / build (Release, x64)

Non-nullable field '_closeButton' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 18 in src/Files.App.Controls/BladeView/BladeItem.cs

GitHub Actions / build (Release, arm64)

Non-nullable field '_closeButton' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.
{
DefaultStyleKey = typeof(BladeItem);
}
SetHasContent( false );
}
UpdateContent( newContent );

Check warning on line 175 in src/Files.App.Controls/Toolbar/ToolbarToggleButton/ToolbarToggleButton.cs

GitHub Actions / build (Debug, x64)

Possible null reference argument for parameter 'newContent' in 'void ToolbarToggleButton.UpdateContent(object newContent)'.

Check warning on line 175 in src/Files.App.Controls/Toolbar/ToolbarToggleButton/ToolbarToggleButton.cs

GitHub Actions / build (Debug, arm64)

Possible null reference argument for parameter 'newContent' in 'void ToolbarToggleButton.UpdateContent(object newContent)'.

Check warning on line 175 in src/Files.App.Controls/Toolbar/ToolbarToggleButton/ToolbarToggleButton.cs

GitHub Actions / build (Release, x64)

Possible null reference argument for parameter 'newContent' in 'void ToolbarToggleButton.UpdateContent(object newContent)'.

Check warning on line 175 in src/Files.App.Controls/Toolbar/ToolbarToggleButton/ToolbarToggleButton.cs

GitHub Actions / build (Release, arm64)

Possible null reference argument for parameter 'newContent' in 'void ToolbarToggleButton.UpdateContent(object newContent)'.
}
#endregion
var newDocument = context.Document.WithSyntaxRoot(newRoot);
context.RegisterCodeFix(
CodeAction.Create(

Check warning on line 57 in src/Files.Core.SourceGenerator/CodeFixProviders/StringsPropertyCodeFixProvider.cs

GitHub Actions / build (Debug, x64)

Provide an explicit argument for optional parameter 'equivalenceKey', which is non-null and unique for each kind of code action created by this fixer

Check warning on line 57 in src/Files.Core.SourceGenerator/CodeFixProviders/StringsPropertyCodeFixProvider.cs

GitHub Actions / build (Debug, arm64)

Provide an explicit argument for optional parameter 'equivalenceKey', which is non-null and unique for each kind of code action created by this fixer

Check warning on line 57 in src/Files.Core.SourceGenerator/CodeFixProviders/StringsPropertyCodeFixProvider.cs

GitHub Actions / build (Release, x64)

Provide an explicit argument for optional parameter 'equivalenceKey', which is non-null and unique for each kind of code action created by this fixer

Check warning on line 57 in src/Files.Core.SourceGenerator/CodeFixProviders/StringsPropertyCodeFixProvider.cs

GitHub Actions / build (Release, arm64)

Provide an explicit argument for optional parameter 'equivalenceKey', which is non-null and unique for each kind of code action created by this fixer
CodeFixProviderTitle,
c => Task.FromResult(newDocument),
null),
/// <summary>
/// Generates properties for strings based on resource files.
/// </summary>
[Generator]

Check warning on line 13 in src/Files.Core.SourceGenerator/Generators/StringsPropertyGenerator.cs

GitHub Actions / build (Debug, x64)

This compiler extension should not be implemented in an assembly containing a reference to Microsoft.CodeAnalysis.Workspaces. The Microsoft.CodeAnalysis.Workspaces assembly is not provided during command line compilation scenarios, so references to it could cause the compiler extension to behave unpredictably. (https://github.com/dotnet/roslyn-analyzers/blob/main/docs/rules/RS1038.md)

Check warning on line 13 in src/Files.Core.SourceGenerator/Generators/StringsPropertyGenerator.cs

GitHub Actions / build (Debug, arm64)

This compiler extension should not be implemented in an assembly containing a reference to Microsoft.CodeAnalysis.Workspaces. The Microsoft.CodeAnalysis.Workspaces assembly is not provided during command line compilation scenarios, so references to it could cause the compiler extension to behave unpredictably. (https://github.com/dotnet/roslyn-analyzers/blob/main/docs/rules/RS1038.md)

Check warning on line 13 in src/Files.Core.SourceGenerator/Generators/StringsPropertyGenerator.cs

GitHub Actions / build (Release, x64)

This compiler extension should not be implemented in an assembly containing a reference to Microsoft.CodeAnalysis.Workspaces. The Microsoft.CodeAnalysis.Workspaces assembly is not provided during command line compilation scenarios, so references to it could cause the compiler extension to behave unpredictably. (https://github.com/dotnet/roslyn-analyzers/blob/main/docs/rules/RS1038.md)

Check warning on line 13 in src/Files.Core.SourceGenerator/Generators/StringsPropertyGenerator.cs

GitHub Actions / build (Release, arm64)

This compiler extension should not be implemented in an assembly containing a reference to Microsoft.CodeAnalysis.Workspaces. The Microsoft.CodeAnalysis.Workspaces assembly is not provided during command line compilation scenarios, so references to it could cause the compiler extension to behave unpredictably. (https://github.com/dotnet/roslyn-analyzers/blob/main/docs/rules/RS1038.md)
internal sealed class StringsPropertyGenerator : IIncrementalGenerator
{
// Static HashSet to track generated file names
/// <summary>
/// A generator for serializing/deserializing objects to/from the Windows Registry using attributes.
/// </summary>
[Generator]

Check warning on line 9 in src/Files.Core.SourceGenerator/Generators/RegistrySerializationGenerator.cs

GitHub Actions / build (Debug, x64)

This compiler extension should not be implemented in an assembly containing a reference to Microsoft.CodeAnalysis.Workspaces. The Microsoft.CodeAnalysis.Workspaces assembly is not provided during command line compilation scenarios, so references to it could cause the compiler extension to behave unpredictably. (https://github.com/dotnet/roslyn-analyzers/blob/main/docs/rules/RS1038.md)

Check warning on line 9 in src/Files.Core.SourceGenerator/Generators/RegistrySerializationGenerator.cs

GitHub Actions / build (Debug, arm64)

This compiler extension should not be implemented in an assembly containing a reference to Microsoft.CodeAnalysis.Workspaces. The Microsoft.CodeAnalysis.Workspaces assembly is not provided during command line compilation scenarios, so references to it could cause the compiler extension to behave unpredictably. (https://github.com/dotnet/roslyn-analyzers/blob/main/docs/rules/RS1038.md)

Check warning on line 9 in src/Files.Core.SourceGenerator/Generators/RegistrySerializationGenerator.cs

GitHub Actions / build (Release, x64)

This compiler extension should not be implemented in an assembly containing a reference to Microsoft.CodeAnalysis.Workspaces. The Microsoft.CodeAnalysis.Workspaces assembly is not provided during command line compilation scenarios, so references to it could cause the compiler extension to behave unpredictably. (https://github.com/dotnet/roslyn-analyzers/blob/main/docs/rules/RS1038.md)

Check warning on line 9 in src/Files.Core.SourceGenerator/Generators/RegistrySerializationGenerator.cs

GitHub Actions / build (Release, arm64)

This compiler extension should not be implemented in an assembly containing a reference to Microsoft.CodeAnalysis.Workspaces. The Microsoft.CodeAnalysis.Workspaces assembly is not provided during command line compilation scenarios, so references to it could cause the compiler extension to behave unpredictably. (https://github.com/dotnet/roslyn-analyzers/blob/main/docs/rules/RS1038.md)
internal sealed class RegistrySerializationGenerator : IIncrementalGenerator
{
/// <summary>
/// <summary>
/// Analyzer that detects if string literals can be replaced with constants from the <c>Strings</c> class.
/// </summary>
[DiagnosticAnalyzer(LanguageNames.CSharp)]

Check warning on line 12 in src/Files.Core.SourceGenerator/Analyzers/StringsPropertyAnalyzer.cs

GitHub Actions / build (Debug, x64)

This compiler extension should not be implemented in an assembly containing a reference to Microsoft.CodeAnalysis.Workspaces. The Microsoft.CodeAnalysis.Workspaces assembly is not provided during command line compilation scenarios, so references to it could cause the compiler extension to behave unpredictably. (https://github.com/dotnet/roslyn-analyzers/blob/main/docs/rules/RS1038.md)

Check warning on line 12 in src/Files.Core.SourceGenerator/Analyzers/StringsPropertyAnalyzer.cs

GitHub Actions / build (Debug, arm64)

This compiler extension should not be implemented in an assembly containing a reference to Microsoft.CodeAnalysis.Workspaces. The Microsoft.CodeAnalysis.Workspaces assembly is not provided during command line compilation scenarios, so references to it could cause the compiler extension to behave unpredictably. (https://github.com/dotnet/roslyn-analyzers/blob/main/docs/rules/RS1038.md)

Check warning on line 12 in src/Files.Core.SourceGenerator/Analyzers/StringsPropertyAnalyzer.cs

GitHub Actions / build (Release, x64)

This compiler extension should not be implemented in an assembly containing a reference to Microsoft.CodeAnalysis.Workspaces. The Microsoft.CodeAnalysis.Workspaces assembly is not provided during command line compilation scenarios, so references to it could cause the compiler extension to behave unpredictably. (https://github.com/dotnet/roslyn-analyzers/blob/main/docs/rules/RS1038.md)

Check warning on line 12 in src/Files.Core.SourceGenerator/Analyzers/StringsPropertyAnalyzer.cs

GitHub Actions / build (Release, arm64)

This compiler extension should not be implemented in an assembly containing a reference to Microsoft.CodeAnalysis.Workspaces. The Microsoft.CodeAnalysis.Workspaces assembly is not provided during command line compilation scenarios, so references to it could cause the compiler extension to behave unpredictably. (https://github.com/dotnet/roslyn-analyzers/blob/main/docs/rules/RS1038.md)
internal sealed class StringsPropertyAnalyzer : DiagnosticAnalyzer
{
/// <summary>
GetKeyState
CreateDirectoryFromApp
WNetCancelConnection2
NET_USE_CONNECT_FLAGS

Check warning on line 48 in src/Files.App.CsWin32/NativeMethods.txt

GitHub Actions / build (Debug, x64)

Method, type or constant "NET_USE_CONNECT_FLAGS" not found

Check warning on line 48 in src/Files.App.CsWin32/NativeMethods.txt

GitHub Actions / build (Debug, arm64)

Method, type or constant "NET_USE_CONNECT_FLAGS" not found

Check warning on line 48 in src/Files.App.CsWin32/NativeMethods.txt

GitHub Actions / build (Release, x64)

Method, type or constant "NET_USE_CONNECT_FLAGS" not found

Check warning on line 48 in src/Files.App.CsWin32/NativeMethods.txt

GitHub Actions / build (Release, arm64)

Method, type or constant "NET_USE_CONNECT_FLAGS" not found
NETRESOURCEW
WNetAddConnection3
CREDENTIALW
SetEntriesInAcl
ACL_SIZE_INFORMATION
DeleteAce
EXPLICIT_ACCESS

Check warning on line 81 in src/Files.App.CsWin32/NativeMethods.txt

GitHub Actions / build (Debug, x64)

Method, type or constant "EXPLICIT_ACCESS" not found. Did you mean or "EXPLICIT_ACCESS_A" or "EXPLICIT_ACCESS_W"?

Check warning on line 81 in src/Files.App.CsWin32/NativeMethods.txt

GitHub Actions / build (Debug, arm64)

Method, type or constant "EXPLICIT_ACCESS" not found. Did you mean or "EXPLICIT_ACCESS_A" or "EXPLICIT_ACCESS_W"?

Check warning on line 81 in src/Files.App.CsWin32/NativeMethods.txt

GitHub Actions / build (Release, x64)

Method, type or constant "EXPLICIT_ACCESS" not found. Did you mean or "EXPLICIT_ACCESS_A" or "EXPLICIT_ACCESS_W"?

Check warning on line 81 in src/Files.App.CsWin32/NativeMethods.txt

GitHub Actions / build (Release, arm64)

Method, type or constant "EXPLICIT_ACCESS" not found. Did you mean or "EXPLICIT_ACCESS_A" or "EXPLICIT_ACCESS_W"?
ACCESS_ALLOWED_ACE
LookupAccountSid
GetComputerName
CoTaskMemFree
QueryDosDevice
DeviceIoControl
GetLastError

Check warning on line 136 in src/Files.App.CsWin32/NativeMethods.txt

GitHub Actions / build (Debug, x64)

This API will not be generated. Do not generate GetLastError. Call Marshal.GetLastWin32Error() instead. Learn more from https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshal.getlastwin32error

Check warning on line 136 in src/Files.App.CsWin32/NativeMethods.txt

GitHub Actions / build (Debug, arm64)

This API will not be generated. Do not generate GetLastError. Call Marshal.GetLastWin32Error() instead. Learn more from https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshal.getlastwin32error

Check warning on line 136 in src/Files.App.CsWin32/NativeMethods.txt

GitHub Actions / build (Release, x64)

This API will not be generated. Do not generate GetLastError. Call Marshal.GetLastWin32Error() instead. Learn more from https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshal.getlastwin32error

Check warning on line 136 in src/Files.App.CsWin32/NativeMethods.txt

GitHub Actions / build (Release, arm64)

This API will not be generated. Do not generate GetLastError. Call Marshal.GetLastWin32Error() instead. Learn more from https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshal.getlastwin32error
CreateFile
GetVolumeInformation
COMPRESSION_FORMAT
_ = PInvoke.RoInitialize(RO_INIT_TYPE.RO_INIT_MULTITHREADED);
var classIds = typeof(Program).Assembly.GetTypes()

Check warning on line 28 in src/Files.App.Server/Program.cs

GitHub Actions / build (Release, x64)

Using member 'System.Reflection.Assembly.GetTypes()' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Types might be removed.

Check warning on line 28 in src/Files.App.Server/Program.cs

GitHub Actions / build (Release, arm64)

Using member 'System.Reflection.Assembly.GetTypes()' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Types might be removed.
.Where(t => t.IsSealed && t.IsPublic && t.IsClass)
.Select(t => t.FullName!)
.Where(name => name.StartsWith("Files.App.Server.", StringComparison.Ordinal))