File: _generated\0\LibraryImports.g.cs
Web Access
Project: src\src\runtime\src\libraries\System.Windows.Extensions\src\System.Windows.Extensions.csproj (System.Windows.Extensions)
// <auto-generated/>
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypt32
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        internal static partial bool CertAddCertificateLinkToStore(global::Microsoft.Win32.SafeHandles.SafeCertStoreHandle hCertStore, global::Microsoft.Win32.SafeHandles.SafeCertContextHandle pCertContext, uint dwAddDisposition, global::Microsoft.Win32.SafeHandles.SafeCertContextHandle ppStoreContext)
        {
            int __lastError;
            nint __hCertStore_native = default;
            nint __pCertContext_native = default;
            nint __ppStoreContext_native = default;
            bool __retVal = default;
            int __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeCertContextHandle>.ManagedToUnmanagedIn __ppStoreContext_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeCertContextHandle>.ManagedToUnmanagedIn __pCertContext_native__marshaller = new();
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeCertStoreHandle>.ManagedToUnmanagedIn __hCertStore_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __ppStoreContext_native__marshaller.FromManaged(ppStoreContext);
                __pCertContext_native__marshaller.FromManaged(pCertContext);
                __hCertStore_native__marshaller.FromManaged(hCertStore);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __ppStoreContext_native = __ppStoreContext_native__marshaller.ToUnmanaged();
                    __pCertContext_native = __pCertContext_native__marshaller.ToUnmanaged();
                    __hCertStore_native = __hCertStore_native__marshaller.ToUnmanaged();
                    global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                    __retVal_native = __PInvoke(__hCertStore_native, __pCertContext_native, dwAddDisposition, __ppStoreContext_native);
                    __lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
                }
 
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native != 0;
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __ppStoreContext_native__marshaller.Free();
                __pCertContext_native__marshaller.Free();
                __hCertStore_native__marshaller.Free();
            }
 
            global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("crypt32.dll", EntryPoint = "CertAddCertificateLinkToStore", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __hCertStore_native, nint __pCertContext_native, uint __dwAddDisposition_native, nint __ppStoreContext_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypt32
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        internal static partial bool CertCloseStore(nint hCertStore, uint dwFlags)
        {
            int __lastError;
            bool __retVal;
            int __retVal_native;
            {
                global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                __retVal_native = __PInvoke(hCertStore, dwFlags);
                __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("crypt32.dll", EntryPoint = "CertCloseStore", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __hCertStore_native, uint __dwFlags_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypt32
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        internal static partial global::Microsoft.Win32.SafeHandles.SafeCertContextHandle CertDuplicateCertificateContext(nint pCertContext)
        {
            int __lastError;
            bool __invokeSucceeded = default;
            global::Microsoft.Win32.SafeHandles.SafeCertContextHandle __retVal = default;
            nint __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeCertContextHandle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
            try
            {
                {
                    global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                    __retVal_native = __PInvoke(pCertContext);
                    __lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
                }
 
                __invokeSucceeded = true;
                // UnmarshalCapture - Capture the native data into marshaller instances in case conversion to managed data throws an exception.
                __retVal_native__marshaller.FromUnmanaged(__retVal_native);
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native__marshaller.ToManaged();
            }
            finally
            {
                if (__invokeSucceeded)
                {
                    // CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
                    __retVal_native__marshaller.Free();
                }
            }
 
            global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("crypt32.dll", EntryPoint = "CertDuplicateCertificateContext", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __pCertContext_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypt32
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        internal static partial nint CertEnumCertificatesInStore(global::Microsoft.Win32.SafeHandles.SafeCertStoreHandle hCertStore, nint pPrevCertContext)
        {
            int __lastError;
            nint __hCertStore_native = default;
            nint __retVal = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeCertStoreHandle>.ManagedToUnmanagedIn __hCertStore_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __hCertStore_native__marshaller.FromManaged(hCertStore);
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __hCertStore_native = __hCertStore_native__marshaller.ToUnmanaged();
                    global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                    __retVal = __PInvoke(__hCertStore_native, pPrevCertContext);
                    __lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
                }
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __hCertStore_native__marshaller.Free();
            }
 
            global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("crypt32.dll", EntryPoint = "CertEnumCertificatesInStore", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __hCertStore_native, nint __pPrevCertContext_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypt32
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        internal static partial bool CertFreeCertificateContext(nint pCertContext)
        {
            int __lastError;
            bool __retVal;
            int __retVal_native;
            {
                global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                __retVal_native = __PInvoke(pCertContext);
                __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("crypt32.dll", EntryPoint = "CertFreeCertificateContext", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __pCertContext_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypt32
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        internal static partial bool CertGetCertificateContextProperty(global::Microsoft.Win32.SafeHandles.SafeCertContextHandle pCertContext, global::Interop.Crypt32.CertContextPropId dwPropId, byte[] pvData, ref int pcbData)
        {
            int __lastError;
            nint __pCertContext_native = default;
            bool __retVal = default;
            int __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeCertContextHandle>.ManagedToUnmanagedIn __pCertContext_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __pCertContext_native__marshaller.FromManaged(pCertContext);
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (int* __pcbData_native = &pcbData)
                fixed (void* __pvData_native = &global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<byte, byte>.ManagedToUnmanagedIn.GetPinnableReference(pvData))
                {
                    // PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
                    __pCertContext_native = __pCertContext_native__marshaller.ToUnmanaged();
                    global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                    __retVal_native = __PInvoke(__pCertContext_native, dwPropId, (byte*)__pvData_native, __pcbData_native);
                    __lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
                }
 
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native != 0;
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                __pCertContext_native__marshaller.Free();
            }
 
            global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("crypt32.dll", EntryPoint = "CertGetCertificateContextProperty", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __pCertContext_native, global::Interop.Crypt32.CertContextPropId __dwPropId_native, byte* __pvData_native, int* __pcbData_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypt32
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        internal static partial global::Microsoft.Win32.SafeHandles.SafeCertStoreHandle CertOpenStore(nint lpszStoreProvider, uint dwMsgAndCertEncodingType, nint hCryptProv, uint dwFlags, nint pvPara)
        {
            int __lastError;
            bool __invokeSucceeded = default;
            global::Microsoft.Win32.SafeHandles.SafeCertStoreHandle __retVal = default;
            nint __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeCertStoreHandle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
            try
            {
                {
                    global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                    __retVal_native = __PInvoke(lpszStoreProvider, dwMsgAndCertEncodingType, hCryptProv, dwFlags, pvPara);
                    __lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
                }
 
                __invokeSucceeded = true;
                // UnmarshalCapture - Capture the native data into marshaller instances in case conversion to managed data throws an exception.
                __retVal_native__marshaller.FromUnmanaged(__retVal_native);
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native__marshaller.ToManaged();
            }
            finally
            {
                if (__invokeSucceeded)
                {
                    // CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
                    __retVal_native__marshaller.Free();
                }
            }
 
            global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("crypt32.dll", EntryPoint = "CertOpenStore", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(nint __lpszStoreProvider_native, uint __dwMsgAndCertEncodingType_native, nint __hCryptProv_native, uint __dwFlags_native, nint __pvPara_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class CryptUI
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        internal static partial bool CryptUIDlgViewCertificateW(in global::Interop.CryptUI.CRYPTUI_VIEWCERTIFICATE_STRUCTW ViewInfo, nint pfPropertiesChanged)
        {
            int __lastError;
            global::Interop.CryptUI.CRYPTUI_VIEWCERTIFICATE_STRUCTW.Marshaller.Native __ViewInfo_native = default;
            bool __retVal = default;
            int __retVal_native = default;
            try
            {
                // Marshal - Convert managed data to native data.
                __ViewInfo_native = global::Interop.CryptUI.CRYPTUI_VIEWCERTIFICATE_STRUCTW.Marshaller.ConvertToUnmanaged(ViewInfo);
                {
                    global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                    __retVal_native = __PInvoke(&__ViewInfo_native, pfPropertiesChanged);
                    __lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
                }
 
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native != 0;
            }
            finally
            {
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                global::Interop.CryptUI.CRYPTUI_VIEWCERTIFICATE_STRUCTW.Marshaller.Free(__ViewInfo_native);
            }
 
            global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("cryptui.dll", EntryPoint = "CryptUIDlgViewCertificateW", ExactSpelling = true)]
            static extern unsafe int __PInvoke(global::Interop.CryptUI.CRYPTUI_VIEWCERTIFICATE_STRUCTW.Marshaller.Native* __ViewInfo_native, nint __pfPropertiesChanged_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class CryptUI
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        internal static partial global::Microsoft.Win32.SafeHandles.SafeCertContextHandle CryptUIDlgSelectCertificateW(ref global::Interop.CryptUI.CRYPTUI_SELECTCERTIFICATE_STRUCTW csc)
        {
            int __lastError;
            bool __invokeSucceeded = default;
            global::Interop.CryptUI.CRYPTUI_SELECTCERTIFICATE_STRUCTW.Marshaller.Native __csc_native = default;
            global::Microsoft.Win32.SafeHandles.SafeCertContextHandle __retVal = default;
            nint __retVal_native = default;
            // Setup - Perform required setup.
            global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeCertContextHandle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
            try
            {
                // Marshal - Convert managed data to native data.
                __csc_native = global::Interop.CryptUI.CRYPTUI_SELECTCERTIFICATE_STRUCTW.Marshaller.ConvertToUnmanaged(csc);
                {
                    global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                    __retVal_native = __PInvoke(&__csc_native);
                    __lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
                }
 
                __invokeSucceeded = true;
                // UnmarshalCapture - Capture the native data into marshaller instances in case conversion to managed data throws an exception.
                __retVal_native__marshaller.FromUnmanaged(__retVal_native);
                // Unmarshal - Convert native data to managed data.
                __retVal = __retVal_native__marshaller.ToManaged();
                csc = global::Interop.CryptUI.CRYPTUI_SELECTCERTIFICATE_STRUCTW.Marshaller.ConvertToManaged(__csc_native);
            }
            finally
            {
                if (__invokeSucceeded)
                {
                    // CleanupCalleeAllocated - Perform cleanup of callee allocated resources.
                    __retVal_native__marshaller.Free();
                }
 
                // CleanupCallerAllocated - Perform cleanup of caller allocated resources.
                global::Interop.CryptUI.CRYPTUI_SELECTCERTIFICATE_STRUCTW.Marshaller.Free(__csc_native);
            }
 
            global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("cryptui.dll", EntryPoint = "CryptUIDlgSelectCertificateW", ExactSpelling = true)]
            static extern unsafe nint __PInvoke(global::Interop.CryptUI.CRYPTUI_SELECTCERTIFICATE_STRUCTW.Marshaller.Native* __csc_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]
        internal static partial bool MessageBeep(int type)
        {
            bool __retVal;
            int __retVal_native;
            {
                __retVal_native = __PInvoke(type);
            }
 
            // Unmarshal - Convert native data to managed data.
            __retVal = __retVal_native != 0;
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "MessageBeep", ExactSpelling = true)]
            static extern unsafe int __PInvoke(int __type_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class WinMM
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("winmm.dll", EntryPoint = "mmioAscend", ExactSpelling = true)]
        internal static unsafe extern partial int mmioAscend(nint hMIO, global::Interop.WinMM.MMCKINFO* lpck, int flags);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class WinMM
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("winmm.dll", EntryPoint = "mmioClose", ExactSpelling = true)]
        internal static extern partial int mmioClose(nint hMIO, int flags);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class WinMM
    {
        [global::System.Runtime.InteropServices.DllImportAttribute("winmm.dll", EntryPoint = "mmioDescend", ExactSpelling = true)]
        internal static unsafe extern partial int mmioDescend(nint hMIO, global::Interop.WinMM.MMCKINFO* lpck, global::Interop.WinMM.MMCKINFO* lcpkParent, int flags);
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class WinMM
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        internal static partial int mmioRead(nint hMIO, byte[] wf, int cch)
        {
            int __retVal;
            // Pin - Pin data in preparation for calling the P/Invoke.
            fixed (void* __wf_native = &global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<byte, byte>.ManagedToUnmanagedIn.GetPinnableReference(wf))
            {
                __retVal = __PInvoke(hMIO, (byte*)__wf_native, cch);
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("winmm.dll", EntryPoint = "mmioRead", ExactSpelling = true)]
            static extern unsafe int __PInvoke(nint __hMIO_native, byte* __wf_native, int __cch_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class WinMM
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        internal static partial nint mmioOpen(string fileName, nint not_used, int flags)
        {
            nint __retVal;
            // Pin - Pin data in preparation for calling the P/Invoke.
            fixed (void* __fileName_native = &global::System.Runtime.InteropServices.Marshalling.Utf16StringMarshaller.GetPinnableReference(fileName))
            {
                __retVal = __PInvoke((ushort*)__fileName_native, not_used, flags);
            }
 
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("winmm.dll", EntryPoint = "mmioOpenW", ExactSpelling = true, CharSet = global::System.Runtime.InteropServices.CharSet.Unicode)]
            static extern unsafe nint __PInvoke(ushort* __fileName_native, nint __not_used_native, int __flags_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class WinMM
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        internal static partial bool PlaySound(string soundName, nint hmod, int soundFlags)
        {
            bool __retVal;
            int __retVal_native;
            // Pin - Pin data in preparation for calling the P/Invoke.
            fixed (void* __soundName_native = &global::System.Runtime.InteropServices.Marshalling.Utf16StringMarshaller.GetPinnableReference(soundName))
            {
                __retVal_native = __PInvoke((ushort*)__soundName_native, hmod, soundFlags);
            }
 
            // Unmarshal - Convert native data to managed data.
            __retVal = __retVal_native != 0;
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("winmm.dll", EntryPoint = "PlaySoundW", ExactSpelling = true, CharSet = global::System.Runtime.InteropServices.CharSet.Unicode)]
            static extern unsafe int __PInvoke(ushort* __soundName_native, nint __hmod_native, int __soundFlags_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class WinMM
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.26904")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        internal static partial bool PlaySound(byte[] soundName, nint hmod, int soundFlags)
        {
            bool __retVal;
            int __retVal_native;
            // Pin - Pin data in preparation for calling the P/Invoke.
            fixed (void* __soundName_native = &global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<byte, byte>.ManagedToUnmanagedIn.GetPinnableReference(soundName))
            {
                __retVal_native = __PInvoke((byte*)__soundName_native, hmod, soundFlags);
            }
 
            // Unmarshal - Convert native data to managed data.
            __retVal = __retVal_native != 0;
            return __retVal;
            // Local P/Invoke
            [global::System.Runtime.InteropServices.DllImportAttribute("winmm.dll", EntryPoint = "PlaySoundW", ExactSpelling = true)]
            static extern unsafe int __PInvoke(byte* __soundName_native, nint __hmod_native, int __soundFlags_native);
        }
    }
}