using System.Runtime.InteropServices; namespace MicaSetup.Shell.Dialogs; internal static class IntPtrExtensions { public static T MarshalAs(this nint ptr) => (T)Marshal.PtrToStructure(ptr, typeof(T)); }