Skip to content

Commit

Permalink
Add disable warning CA1401
Browse files Browse the repository at this point in the history
Add disable warning CA1401
  • Loading branch information
Gaoyifei1011 committed Oct 1, 2024
1 parent d8a8f1b commit 1ec4086
Show file tree
Hide file tree
Showing 19 changed files with 68 additions and 32 deletions.
6 changes: 3 additions & 3 deletions WindowsTools/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
[assembly: AssemblyCompany("高怡飞")]
[assembly: AssemblyCopyright("Copyright ©2024 高怡飞, All Rights Reserved.")]
[assembly: AssemblyDescription("Windows 工具箱")]
[assembly: AssemblyFileVersion("3.0.930.0")]
[assembly: AssemblyInformationalVersion("3.0.930.0")]
[assembly: AssemblyFileVersion("3.0.1001.0")]
[assembly: AssemblyInformationalVersion("3.0.1001.0")]
[assembly: AssemblyProduct("Windows 工具箱")]
[assembly: AssemblyTitle("Windows 工具箱")]
[assembly: AssemblyVersion("3.0.930.0")]
[assembly: AssemblyVersion("3.0.1001.0")]
1 change: 1 addition & 0 deletions WindowsTools/UI/Dialogs/AppInformationDialog.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ public AppInformationDialog()
}
}

// Windows UI 版本信息
FileVersionInfo windowsUIFile = FileVersionInfo.GetVersionInfo(string.Format(@"{0}\{1}", Environment.SystemDirectory, "Windows.UI.Xaml.dll"));

FileVersionInfo mileXamlFile = FileVersionInfo.GetVersionInfo(Path.Combine(AppContext.BaseDirectory, @"Mile.Xaml.Managed.dll"));
Expand Down
1 change: 0 additions & 1 deletion WindowsTools/Views/Windows/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ public MainWindow()
cbSize = Marshal.SizeOf<CHANGEFILTERSTRUCT>()
};
User32Library.ChangeWindowMessageFilterEx(Handle, WindowMessage.WM_DROPFILES, ChangeFilterAction.MSGFLT_ALLOW, in changeFilterStatus);
User32Library.ChangeWindowMessageFilterEx(Handle, WindowMessage.WM_COPYDATA, ChangeFilterAction.MSGFLT_ALLOW, in changeFilterStatus);
User32Library.ChangeWindowMessageFilterEx(Handle, WindowMessage.WM_COPYGLOBALDATA, ChangeFilterAction.MSGFLT_ALLOW, in changeFilterStatus);
Shell32Library.DragAcceptFiles(Handle, true);
}
Expand Down
38 changes: 19 additions & 19 deletions WindowsTools/WindowsAPI/ComTypes/IPropertyValueStatics.cs

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions WindowsTools/WindowsAPI/PInvoke/Advapi32/Advapi32Library.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
using System;
using System.Runtime.InteropServices;

// 抑制 CA1401 警告
#pragma warning disable CA1401

namespace WindowsTools.WindowsAPI.PInvoke.Advapi32
{
/// <summary>
Expand Down
3 changes: 3 additions & 0 deletions WindowsTools/WindowsAPI/PInvoke/Combase/CombaseLibrary.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
using System;
using System.Runtime.InteropServices;

// 抑制 CA1401,CA2101 警告
#pragma warning disable CA1401,CA2101

namespace WindowsTools.WindowsAPI.PInvoke.Combase
{
public static class CombaseLibrary
Expand Down
3 changes: 3 additions & 0 deletions WindowsTools/WindowsAPI/PInvoke/Comctl32/Comctl32Library.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
using System.Runtime.InteropServices;
using WindowsTools.WindowsAPI.PInvoke.User32;

// 抑制 CA1401 警告
#pragma warning disable CA1401

namespace WindowsTools.WindowsAPI.PInvoke.Comctl32
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
using System;
using System.Runtime.InteropServices;

// 抑制 CA1401 警告
#pragma warning disable CA1401

namespace WindowsTools.WindowsAPI.PInvoke.FirewallAPI
{
public static class FirewallAPILibrary
Expand Down Expand Up @@ -41,6 +44,6 @@ public static class FirewallAPILibrary
/// <param name="appContainerSids">安全标识符 (允许发送环回流量的应用容器) SID。 用于调试目的。</param>
/// <returns>如果成功,则返回ERROR_SUCCESS,否则返回错误值。</returns>
[DllImport(FirewallAPI, CharSet = CharSet.Unicode, EntryPoint = "NetworkIsolationSetAppContainerConfig", SetLastError = false), PreserveSig]
public static extern uint NetworkIsolationSetAppContainerConfig(int dwNumPublicAppCs, [In, MarshalAs(UnmanagedType.LPArray)] SID_AND_ATTRIBUTES[] appContainerSids);
public static extern uint NetworkIsolationSetAppContainerConfig(int dwNumPublicAppCs, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] SID_AND_ATTRIBUTES[] appContainerSids);
}
}
3 changes: 3 additions & 0 deletions WindowsTools/WindowsAPI/PInvoke/Imagehlp/ImagehlpLibrary.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
using System;
using System.Runtime.InteropServices;

// 抑制 CA1401 警告
#pragma warning disable CA1401

namespace WindowsTools.WindowsAPI.PInvoke.Imagehlp
{
/// <summary>
Expand Down
3 changes: 3 additions & 0 deletions WindowsTools/WindowsAPI/PInvoke/Kernel32/Kernel32Library.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
using System.Runtime.InteropServices;
using System.Text;

// 抑制 CA1401 警告
#pragma warning disable CA1401

namespace WindowsTools.WindowsAPI.PInvoke.Kernel32
{
/// <summary>
Expand Down
3 changes: 3 additions & 0 deletions WindowsTools/WindowsAPI/PInvoke/Ole32/Ole32Library.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
using System;
using System.Runtime.InteropServices;

// 抑制 CA1401 警告
#pragma warning disable CA1401

namespace WindowsTools.WindowsAPI.PInvoke.Ole32
{
/// <summary>
Expand Down
7 changes: 5 additions & 2 deletions WindowsTools/WindowsAPI/PInvoke/Rstrtmgr/RstrtmgrLibrary.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
using System.Runtime.InteropServices;

// 抑制 CA1401 警告
#pragma warning disable CA1401

namespace WindowsTools.WindowsAPI.PInvoke.Rstrtmgr
{
public static class RstrtmgrLibrary
Expand All @@ -18,7 +21,7 @@ public static class RstrtmgrLibrary
/// <param name="rgsServiceNames">以 null 结尾的服务短名称字符串的数组。 如果 nServices 为 0,此参数可以为 NULL。</param>
/// <returns>这是收到的最新错误。 函数可以返回 Winerror.h 中定义的系统错误代码之一。</returns>
[DllImport(Rstrtmgr, CharSet = CharSet.Unicode, EntryPoint = "RmRegisterResources", SetLastError = false), PreserveSig]
public static extern int RmRegisterResources(uint pSessionHandle, uint nFiles, [In, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr)] string[] rgsFilenames, uint nApplications, [In] RM_UNIQUE_PROCESS[] rgApplications, uint nServices, [In, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr)] string[] rgsServiceNames);
public static extern int RmRegisterResources(uint pSessionHandle, uint nFiles, [In, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr, SizeParamIndex = 0)] string[] rgsFilenames, uint nApplications, [In] RM_UNIQUE_PROCESS[] rgApplications, uint nServices, [In, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr, SizeParamIndex = 0)] string[] rgsServiceNames);

/// <summary>
/// 启动新的重启管理器会话。 每个用户会话最多可以同时在系统上打开 64 个重启管理器会话。 当此函数启动会话时,它将返回会话句柄和会话密钥,这些句柄和会话密钥可用于对重启管理器 API 的后续调用。
Expand Down Expand Up @@ -48,6 +51,6 @@ public static class RstrtmgrLibrary
/// <param name="lpdwRebootReasons">指向位置的指针,该位置接收 RM_REBOOT_REASON 枚举的值,该枚举描述需要重启系统的原因。</param>
/// <returns>这是收到的最新错误。 函数可以返回 Winerror.h 中定义的系统错误代码之一。</returns>
[DllImport(Rstrtmgr, CharSet = CharSet.Unicode, EntryPoint = "RmGetList", SetLastError = false), PreserveSig]
public static extern int RmGetList(uint dwSessionHandle, out uint pnProcInfoNeeded, ref uint pnProcInfo, [In, Out] RM_PROCESS_INFO[] rgAffectedApps, ref uint lpdwRebootReasons);
public static extern int RmGetList(uint dwSessionHandle, out uint pnProcInfoNeeded, ref uint pnProcInfo, [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] RM_PROCESS_INFO[] rgAffectedApps, ref uint lpdwRebootReasons);
}
}
3 changes: 3 additions & 0 deletions WindowsTools/WindowsAPI/PInvoke/Shell32/Shell32Library.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
using System.Text;
using WindowsTools.WindowsAPI.ComTypes;

// 抑制 CA1401 警告
#pragma warning disable CA1401

namespace WindowsTools.WindowsAPI.PInvoke.Shell32
{
/// <summary>
Expand Down
3 changes: 3 additions & 0 deletions WindowsTools/WindowsAPI/PInvoke/Shlwapi/ShlwapiLibrary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
using System.Runtime.InteropServices;
using System.Text;

// 抑制 CA1401 警告
#pragma warning disable CA1401

namespace WindowsTools.WindowsAPI.PInvoke.Shlwapi
{
/// <summary>
Expand Down
5 changes: 4 additions & 1 deletion WindowsTools/WindowsAPI/PInvoke/User32/User32Library.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
using System.Runtime.InteropServices;
using System.Windows.Forms;

// 抑制 CA1401 警告
#pragma warning disable CA1401

namespace WindowsTools.WindowsAPI.PInvoke.User32
{
/// <summary>
Expand Down Expand Up @@ -78,7 +81,7 @@ public static class User32Library
/// 如果 phicon 参数为 NULL 并且此函数成功,则返回值是文件中的图标数。 如果函数失败,则返回值为 0。如果 phicon 参数不为 NULL 且函数成功,则返回值是提取的图标数。 否则,如果未找到该文件,则返回值0xFFFFFFFF。
/// </returns>
[DllImport(User32, CharSet = CharSet.Unicode, EntryPoint = "PrivateExtractIconsW", SetLastError = false), PreserveSig]
public static extern int PrivateExtractIcons([MarshalAs(UnmanagedType.LPWStr)] string lpszFile, int nIconIndex, int cxIcon, int cyIcon, IntPtr[] phicon, int[] piconid, int nIcons, int flags);
public static extern int PrivateExtractIcons([MarshalAs(UnmanagedType.LPWStr)] string lpszFile, int nIconIndex, int cxIcon, int cyIcon, [Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] IntPtr[] phicon, [Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] int[] piconid, int nIcons, int flags);

/// <summary>
/// 注册应用程序以接收特定电源设置事件的电源设置通知。
Expand Down
3 changes: 3 additions & 0 deletions WindowsTools/WindowsAPI/PInvoke/Uxtheme/UxthemeLibrary.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
using System.Runtime.InteropServices;

// 抑制 CA1401 警告
#pragma warning disable CA1401

namespace WindowsTools.WindowsAPI.PInvoke.Uxtheme
{
/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion WindowsToolsPackage/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<Identity
Name="Gaoyifei1011.WindowsTools"
Publisher="CN=高怡飞"
Version="3.0.930.0" />
Version="3.0.1001.0" />

<Properties>
<DisplayName>ms-resource:PackageDisplayName</DisplayName>
Expand Down
6 changes: 3 additions & 3 deletions WindowsToolsShellExtension/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
[assembly: AssemblyCompany("高怡飞")]
[assembly: AssemblyCopyright("Copyright ©2024 高怡飞, All Rights Reserved.")]
[assembly: AssemblyDescription("Windows 工具箱 右键菜单扩展")]
[assembly: AssemblyFileVersion("3.0.930.0")]
[assembly: AssemblyInformationalVersion("3.0.930.0")]
[assembly: AssemblyFileVersion("3.0.1001.0")]
[assembly: AssemblyInformationalVersion("3.0.1001.0")]
[assembly: AssemblyProduct("Windows 工具箱 右键菜单扩展")]
[assembly: AssemblyTitle("Windows 工具箱 右键菜单扩展")]
[assembly: AssemblyVersion("3.0.930.0")]
[assembly: AssemblyVersion("3.0.1001.0")]

// 应用程序默认区域性的资源控制器设置
[assembly: NeutralResourcesLanguage("en-us")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public partial interface IEnumExplorerCommand
/// <param name="pceltFetched">此方法返回时,包含指向实际检索的元素数的指针。 如果不需要此信息,则此指针可以为 NULL 。</param>
/// <returns>如果该方法成功,则返回 S_OK。 否则,将返回 HRESULT 错误代码。</returns>
[PreserveSig]
int Next(uint celt, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.Interface, SizeParamIndex = 0), Out] IExplorerCommand[] pUICommand, out uint pceltFetched);
int Next(uint celt, [Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.Interface, SizeParamIndex = 0)] IExplorerCommand[] pUICommand, out uint pceltFetched);

/// <summary>
/// 目前尚未实现。
Expand Down

0 comments on commit 1ec4086

Please sign in to comment.