File: _generated\0\LibraryImports.g.cs
Web Access
Project: src\src\runtime\src\libraries\Microsoft.Win32.SystemEvents\src\Microsoft.Win32.SystemEvents.csproj (Microsoft.Win32.SystemEvents)
// <auto-generated/>
internal static unsafe partial class Interop
{
    internal static unsafe partial class User32
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial nint CreateWindowExW(int exStyle, string lpszClassName, string lpszWindowName, int style, int x, int y, int width, int height, nint hWndParent, nint hMenu, nint hInst, nint pvParam)
        {
            int __lastError;
            nint __retVal;
            // Pin - Pin data in preparation for calling the P/Invoke.
            fixed (void* __lpszWindowName_native = &global::System.Runtime.InteropServices.Marshalling.Utf16StringMarshaller.GetPinnableReference(lpszWindowName))
            fixed (void* __lpszClassName_native = &global::System.Runtime.InteropServices.Marshalling.Utf16StringMarshaller.GetPinnableReference(lpszClassName))
            {
                global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                __retVal = __PInvoke(exStyle, (ushort*)__lpszClassName_native, (ushort*)__lpszWindowName_native, style, x, y, width, height, hWndParent, hMenu, hInst, pvParam);
                __lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
            }
 
            global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "CreateWindowExW", ExactSpelling = true, CharSet = global::System.Runtime.InteropServices.CharSet.Unicode)]
            static extern unsafe nint __PInvoke(int __exStyle_native, ushort* __lpszClassName_native, ushort* __lpszWindowName_native, int __style_native, int __x_native, int __y_native, int __width_native, int __height_native, nint __hWndParent_native, nint __hMenu_native, nint __hInst_native, nint __pvParam_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class User32
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "DefWindowProcW", ExactSpelling = true)]
        public static extern partial nint DefWindowProcW(nint hWnd, int msg, nint wParam, nint lParam);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class User32
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial bool DestroyWindow(nint hWnd)
        {
            bool __retVal;
            int __retVal_native;
            {
                __retVal_native = __PInvoke(hWnd);
            }
 
            // Unmarshal - Convert native data to managed data.
            __retVal = __retVal_native != 0;
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "DestroyWindow", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __hWnd_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class User32
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int DispatchMessageW(ref global::Interop.User32.MSG msg)
        {
            int __retVal;
            // Pin - Pin data in preparation for calling the P/Invoke.
            fixed (global::Interop.User32.MSG* __msg_native = &msg)
            {
                __retVal = __PInvoke(__msg_native);
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "DispatchMessageW", ExactSpelling = true)]
            static extern unsafe int __PInvoke(global::Interop.User32.MSG* __msg_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class User32
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial bool GetClassInfoW(nint hInst, string lpszClass, ref global::Interop.User32.WNDCLASS wc)
        {
            bool __retVal;
            int __retVal_native;
            // Pin - Pin data in preparation for calling the P/Invoke.
            fixed (global::Interop.User32.WNDCLASS* __wc_native = &wc)
            fixed (void* __lpszClass_native = &global::System.Runtime.InteropServices.Marshalling.Utf16StringMarshaller.GetPinnableReference(lpszClass))
            {
                __retVal_native = __PInvoke(hInst, (ushort*)__lpszClass_native, __wc_native);
            }
 
            // Unmarshal - Convert native data to managed data.
            __retVal = __retVal_native != 0;
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "GetClassInfoW", ExactSpelling = true, CharSet = global::System.Runtime.InteropServices.CharSet.Unicode)]
            static extern unsafe int __PInvoke(nint __hInst_native, ushort* __lpszClass_native, global::Interop.User32.WNDCLASS* __wc_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class User32
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int GetMessageW(ref global::Interop.User32.MSG msg, nint hwnd, int msgMin, int msgMax)
        {
            int __retVal;
            // Pin - Pin data in preparation for calling the P/Invoke.
            fixed (global::Interop.User32.MSG* __msg_native = &msg)
            {
                __retVal = __PInvoke(__msg_native, hwnd, msgMin, msgMax);
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "GetMessageW", ExactSpelling = true)]
            static extern unsafe int __PInvoke(global::Interop.User32.MSG* __msg_native, nint __hwnd_native, int __msgMin_native, int __msgMax_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class User32
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "GetProcessWindowStation", ExactSpelling = true)]
        internal static extern partial nint GetProcessWindowStation();
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class User32
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static unsafe partial bool GetUserObjectInformationW(nint hObj, int nIndex, void* pvBuffer, uint nLength, ref uint lpnLengthNeeded)
        {
            int __lastError;
            bool __retVal;
            int __retVal_native;
            // Pin - Pin data in preparation for calling the P/Invoke.
            fixed (uint* __lpnLengthNeeded_native = &lpnLengthNeeded)
            {
                global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                __retVal_native = __PInvoke(hObj, nIndex, pvBuffer, nLength, __lpnLengthNeeded_native);
                __lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
            }
 
            // Unmarshal - Convert native data to managed data.
            __retVal = __retVal_native != 0;
            global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "GetUserObjectInformationW", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __hObj_native, int __nIndex_native, void* __pvBuffer_native, uint __nLength_native, uint* __lpnLengthNeeded_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class User32
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "GetWindowThreadProcessId", ExactSpelling = true)]
        public static unsafe extern partial int GetWindowThreadProcessId(nint handle, int* processId);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class User32
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial bool IsWindow(nint hWnd)
        {
            bool __retVal;
            int __retVal_native;
            {
                __retVal_native = __PInvoke(hWnd);
            }
 
            // Unmarshal - Convert native data to managed data.
            __retVal = __retVal_native != 0;
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "IsWindow", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __hWnd_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class User32
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial bool KillTimer(nint hwnd, nint idEvent)
        {
            bool __retVal;
            int __retVal_native;
            {
                __retVal_native = __PInvoke(hwnd, idEvent);
            }
 
            // Unmarshal - Convert native data to managed data.
            __retVal = __retVal_native != 0;
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "KillTimer", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __hwnd_native, nint __idEvent_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class User32
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "MsgWaitForMultipleObjectsEx", ExactSpelling = true)]
        public static extern partial int MsgWaitForMultipleObjectsEx(int nCount, nint pHandles, int dwMilliseconds, int dwWakeMask, int dwFlags);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class User32
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "PostMessageW", ExactSpelling = true)]
        public static extern partial int PostMessageW(nint hwnd, int msg, nint wparam, nint lparam);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class User32
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "PostQuitMessage", ExactSpelling = true)]
        public static extern partial void PostQuitMessage(int exitCode);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class User32
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial short RegisterClassW(ref global::Interop.User32.WNDCLASS wc)
        {
            int __lastError;
            short __retVal;
            // Pin - Pin data in preparation for calling the P/Invoke.
            fixed (global::Interop.User32.WNDCLASS* __wc_native = &wc)
            {
                global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                __retVal = __PInvoke(__wc_native);
                __lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
            }
 
            global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "RegisterClassW", ExactSpelling = true)]
            static extern unsafe short __PInvoke(global::Interop.User32.WNDCLASS* __wc_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class User32
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial int RegisterWindowMessageW(string msg)
        {
            int __retVal;
            // Pin - Pin data in preparation for calling the P/Invoke.
            fixed (void* __msg_native = &global::System.Runtime.InteropServices.Marshalling.Utf16StringMarshaller.GetPinnableReference(msg))
            {
                __retVal = __PInvoke((ushort*)__msg_native);
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "RegisterWindowMessageW", ExactSpelling = true, CharSet = global::System.Runtime.InteropServices.CharSet.Unicode)]
            static extern unsafe int __PInvoke(ushort* __msg_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class User32
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "SendMessageW", ExactSpelling = true)]
        public static extern partial nint SendMessageW(nint hWnd, int msg, nint wParam, nint lParam);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class User32
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "SetClassLongW", ExactSpelling = true)]
        public static extern partial nint SetClassLongW(nint hwnd, int nIndex, nint dwNewLong);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class User32
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "SetClassLongPtrW", ExactSpelling = true)]
        public static extern partial nint SetClassLongPtrW(nint hwnd, int nIndex, nint dwNewLong);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class User32
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "SetTimer", ExactSpelling = true)]
        public static extern partial nint SetTimer(nint hWnd, nint nIDEvent, int uElapse, nint lpTimerProc);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class User32
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "SetWindowLongW", ExactSpelling = true)]
        public static extern partial nint SetWindowLongW(nint hWnd, int nIndex, nint dwNewLong);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class User32
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "SetWindowLongPtrW", ExactSpelling = true)]
        public static extern partial nint SetWindowLongPtrW(nint hWnd, int nIndex, nint dwNewLong);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class User32
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial bool TranslateMessage(ref global::Interop.User32.MSG msg)
        {
            bool __retVal;
            int __retVal_native;
            // Pin - Pin data in preparation for calling the P/Invoke.
            fixed (global::Interop.User32.MSG* __msg_native = &msg)
            {
                __retVal_native = __PInvoke(__msg_native);
            }
 
            // Unmarshal - Convert native data to managed data.
            __retVal = __retVal_native != 0;
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "TranslateMessage", ExactSpelling = true)]
            static extern unsafe int __PInvoke(global::Interop.User32.MSG* __msg_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class User32
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial short UnregisterClassW(string lpClassName, nint hInstance)
        {
            int __lastError;
            short __retVal;
            // Pin - Pin data in preparation for calling the P/Invoke.
            fixed (void* __lpClassName_native = &global::System.Runtime.InteropServices.Marshalling.Utf16StringMarshaller.GetPinnableReference(lpClassName))
            {
                global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                __retVal = __PInvoke((ushort*)__lpClassName_native, hInstance);
                __lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
            }
 
            global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "UnregisterClassW", ExactSpelling = true, CharSet = global::System.Runtime.InteropServices.CharSet.Unicode)]
            static extern unsafe short __PInvoke(ushort* __lpClassName_native, nint __hInstance_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Kernel32
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("kernel32.dll", EntryPoint = "GetCurrentThreadId", ExactSpelling = true)]
        public static extern partial int GetCurrentThreadId();
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Kernel32
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        internal static partial nint GetModuleHandle(string moduleName)
        {
            int __lastError;
            nint __retVal;
            // Pin - Pin data in preparation for calling the P/Invoke.
            fixed (void* __moduleName_native = &global::System.Runtime.InteropServices.Marshalling.Utf16StringMarshaller.GetPinnableReference(moduleName))
            {
                global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                __retVal = __PInvoke((ushort*)__moduleName_native);
                __lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
            }
 
            global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("kernel32.dll", EntryPoint = "GetModuleHandleW", ExactSpelling = true, CharSet = global::System.Runtime.InteropServices.CharSet.Unicode)]
            static extern unsafe nint __PInvoke(ushort* __moduleName_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Kernel32
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial nint GetProcAddress(global::Microsoft.Win32.SafeHandles.SafeLibraryHandle hModule, string lpProcName)
        {
            nint __hModule_native = default;
            byte* __lpProcName_native = default;
            nint __retVal = default;
            // Setup - Perform required setup.
            scoped global::System.Runtime.InteropServices.Marshalling.AnsiStringMarshaller.ManagedToUnmanagedIn __lpProcName_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeLibraryHandle>.ManagedToUnmanagedIn __hModule_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __lpProcName_native__marshaller.FromManaged(lpProcName, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.AnsiStringMarshaller.ManagedToUnmanagedIn.BufferSize]);
                __hModule_native__marshaller.FromManaged(hModule);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __lpProcName_native = __lpProcName_native__marshaller.ToUnmanaged();
                    __hModule_native = __hModule_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(__hModule_native, __lpProcName_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __lpProcName_native__marshaller.Free();
                __hModule_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("kernel32.dll", EntryPoint = "GetProcAddress", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __hModule_native, byte* __lpProcName_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Kernel32
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial nint GetProcAddress(nint hModule, string lpProcName)
        {
            byte* __lpProcName_native = default;
            nint __retVal = default;
            // Setup - Perform required setup.
            scoped global::System.Runtime.InteropServices.Marshalling.AnsiStringMarshaller.ManagedToUnmanagedIn __lpProcName_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __lpProcName_native__marshaller.FromManaged(lpProcName, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.AnsiStringMarshaller.ManagedToUnmanagedIn.BufferSize]);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __lpProcName_native = __lpProcName_native__marshaller.ToUnmanaged();
                    __retVal = __PInvoke(hModule, __lpProcName_native);
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __lpProcName_native__marshaller.Free();
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("kernel32.dll", EntryPoint = "GetProcAddress", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __hModule_native, byte* __lpProcName_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Kernel32
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial nint LoadLibrary(string libFilename)
        {
            int __lastError;
            nint __retVal;
            // Pin - Pin data in preparation for calling the P/Invoke.
            fixed (void* __libFilename_native = &global::System.Runtime.InteropServices.Marshalling.Utf16StringMarshaller.GetPinnableReference(libFilename))
            {
                global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                __retVal = __PInvoke((ushort*)__libFilename_native);
                __lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
            }
 
            global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("kernel32.dll", EntryPoint = "LoadLibraryW", ExactSpelling = true, CharSet = global::System.Runtime.InteropServices.CharSet.Unicode)]
            static extern unsafe nint __PInvoke(ushort* __libFilename_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Kernel32
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        internal static partial bool FreeLibrary(nint hModule)
        {
            int __lastError;
            bool __retVal;
            int __retVal_native;
            {
                global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                __retVal_native = __PInvoke(hModule);
                __lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
            }
 
            // Unmarshal - Convert native data to managed data.
            __retVal = __retVal_native != 0;
            global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("kernel32.dll", EntryPoint = "FreeLibrary", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __hModule_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Kernel32
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        internal static partial bool SetConsoleCtrlHandler(global::Interop.Kernel32.ConsoleCtrlHandlerRoutine handler, bool addOrRemove)
        {
            int __lastError;
            nint __handler_native;
            int __addOrRemove_native;
            bool __retVal;
            int __retVal_native;
            // Marshal - Convert managed data to native data.
            __addOrRemove_native = (int)(addOrRemove ? 1 : 0);
            __handler_native = handler != null ? global::System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(handler) : default;
            {
                global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                __retVal_native = __PInvoke(__handler_native, __addOrRemove_native);
                __lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
            }
 
            // NotifyForSuccessfulInvoke - Keep alive any managed objects that need to stay alive across the call.
            global::System.GC.KeepAlive(handler);
            // Unmarshal - Convert native data to managed data.
            __retVal = __retVal_native != 0;
            global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("kernel32.dll", EntryPoint = "SetConsoleCtrlHandler", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __handler_native, int __addOrRemove_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Wtsapi32
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial bool WTSRegisterSessionNotification(nint hWnd, int dwFlags)
        {
            bool __retVal;
            int __retVal_native;
            {
                __retVal_native = __PInvoke(hWnd, dwFlags);
            }
 
            // Unmarshal - Convert native data to managed data.
            __retVal = __retVal_native != 0;
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("wtsapi32.dll", EntryPoint = "WTSRegisterSessionNotification", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __hWnd_native, int __dwFlags_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Wtsapi32
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        public static partial bool WTSUnRegisterSessionNotification(nint hWnd)
        {
            bool __retVal;
            int __retVal_native;
            {
                __retVal_native = __PInvoke(hWnd);
            }
 
            // Unmarshal - Convert native data to managed data.
            __retVal = __retVal_native != 0;
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("wtsapi32.dll", EntryPoint = "WTSUnRegisterSessionNotification", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __hWnd_native);
        }
    }
}