capture dispatched exceptions

This commit is contained in:
DismissedLight
2023-11-13 23:13:25 +08:00
parent d4e9c2aa9c
commit d8b6315e7e
2 changed files with 2 additions and 14 deletions

View File

@@ -19,18 +19,6 @@ internal static class StructMarshal
/// <returns>新的实例</returns>
public static unsafe WINDOWPLACEMENT WINDOWPLACEMENT()
{
return new() { length = SizeOf<WINDOWPLACEMENT>() };
}
/// <summary>
/// 获取结构的大小
/// </summary>
/// <typeparam name="TStruct">结构类型</typeparam>
/// <returns>结构的大小</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe uint SizeOf<TStruct>()
where TStruct : unmanaged
{
return unchecked((uint)sizeof(TStruct));
return new() { length = unchecked((uint)sizeof(WINDOWPLACEMENT)) };
}
}

View File

@@ -36,7 +36,7 @@ internal static class DispatcherQueueExtension
}
catch (Exception ex)
{
ExceptionDispatchInfo.Capture(ex);
exceptionDispatchInfo = ExceptionDispatchInfo.Capture(ex);
}
finally
{