diff --git a/src/Snap.Hutao/Snap.Hutao.Win32/StructMarshal.cs b/src/Snap.Hutao/Snap.Hutao.Win32/StructMarshal.cs index 86e4c3e2..6225225f 100644 --- a/src/Snap.Hutao/Snap.Hutao.Win32/StructMarshal.cs +++ b/src/Snap.Hutao/Snap.Hutao.Win32/StructMarshal.cs @@ -19,18 +19,6 @@ internal static class StructMarshal /// 新的实例 public static unsafe WINDOWPLACEMENT WINDOWPLACEMENT() { - return new() { length = SizeOf() }; - } - - /// - /// 获取结构的大小 - /// - /// 结构类型 - /// 结构的大小 - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe uint SizeOf() - where TStruct : unmanaged - { - return unchecked((uint)sizeof(TStruct)); + return new() { length = unchecked((uint)sizeof(WINDOWPLACEMENT)) }; } } \ No newline at end of file diff --git a/src/Snap.Hutao/Snap.Hutao/Core/Threading/DispatcherQueueExtension.cs b/src/Snap.Hutao/Snap.Hutao/Core/Threading/DispatcherQueueExtension.cs index e4365bc9..01df78e1 100644 --- a/src/Snap.Hutao/Snap.Hutao/Core/Threading/DispatcherQueueExtension.cs +++ b/src/Snap.Hutao/Snap.Hutao/Core/Threading/DispatcherQueueExtension.cs @@ -36,7 +36,7 @@ internal static class DispatcherQueueExtension } catch (Exception ex) { - ExceptionDispatchInfo.Capture(ex); + exceptionDispatchInfo = ExceptionDispatchInfo.Capture(ex); } finally {