File: _generated\0\LibraryImports.g.cs
Web Access
Project: src\src\runtime\src\libraries\System.Security.Cryptography.ProtectedData\src\System.Security.Cryptography.ProtectedData.csproj (System.Security.Cryptography.ProtectedData)
// <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.27024")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        internal static partial bool CryptProtectData(in global::Interop.Crypt32.DATA_BLOB pDataIn, string szDataDescr, ref global::Interop.Crypt32.DATA_BLOB pOptionalEntropy, nint pvReserved, nint pPromptStruct, global::Interop.Crypt32.CryptProtectDataFlags dwFlags, out global::Interop.Crypt32.DATA_BLOB pDataOut)
        {
            int __lastError;
            pDataOut = default;
            bool __retVal;
            int __retVal_native;
            // Pin - Pin data in preparation for calling the P/Invoke.
            fixed (global::Interop.Crypt32.DATA_BLOB* __pDataOut_native = &pDataOut)
            fixed (global::Interop.Crypt32.DATA_BLOB* __pOptionalEntropy_native = &pOptionalEntropy)
            fixed (void* __szDataDescr_native = &global::System.Runtime.InteropServices.Marshalling.Utf16StringMarshaller.GetPinnableReference(szDataDescr))
            fixed (global::Interop.Crypt32.DATA_BLOB* __pDataIn_native = &pDataIn)
            {
                global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                __retVal_native = __PInvoke(__pDataIn_native, (ushort*)__szDataDescr_native, __pOptionalEntropy_native, pvReserved, pPromptStruct, dwFlags, __pDataOut_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("crypt32.dll", EntryPoint = "CryptProtectData", ExactSpelling = true, CharSet = global::System.Runtime.InteropServices.CharSet.Unicode)]
            static extern unsafe int __PInvoke(global::Interop.Crypt32.DATA_BLOB* __pDataIn_native, ushort* __szDataDescr_native, global::Interop.Crypt32.DATA_BLOB* __pOptionalEntropy_native, nint __pvReserved_native, nint __pPromptStruct_native, global::Interop.Crypt32.CryptProtectDataFlags __dwFlags_native, global::Interop.Crypt32.DATA_BLOB* __pDataOut_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Crypt32
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27024")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        internal static partial bool CryptUnprotectData(in global::Interop.Crypt32.DATA_BLOB pDataIn, nint ppszDataDescr, ref global::Interop.Crypt32.DATA_BLOB pOptionalEntropy, nint pvReserved, nint pPromptStruct, global::Interop.Crypt32.CryptProtectDataFlags dwFlags, out global::Interop.Crypt32.DATA_BLOB pDataOut)
        {
            int __lastError;
            pDataOut = default;
            bool __retVal;
            int __retVal_native;
            // Pin - Pin data in preparation for calling the P/Invoke.
            fixed (global::Interop.Crypt32.DATA_BLOB* __pDataOut_native = &pDataOut)
            fixed (global::Interop.Crypt32.DATA_BLOB* __pOptionalEntropy_native = &pOptionalEntropy)
            fixed (global::Interop.Crypt32.DATA_BLOB* __pDataIn_native = &pDataIn)
            {
                global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                __retVal_native = __PInvoke(__pDataIn_native, ppszDataDescr, __pOptionalEntropy_native, pvReserved, pPromptStruct, dwFlags, __pDataOut_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("crypt32.dll", EntryPoint = "CryptUnprotectData", ExactSpelling = true)]
            static extern unsafe int __PInvoke(global::Interop.Crypt32.DATA_BLOB* __pDataIn_native, nint __ppszDataDescr_native, global::Interop.Crypt32.DATA_BLOB* __pOptionalEntropy_native, nint __pvReserved_native, nint __pPromptStruct_native, global::Interop.Crypt32.CryptProtectDataFlags __dwFlags_native, global::Interop.Crypt32.DATA_BLOB* __pDataOut_native);
        }
    }
}
internal static unsafe partial class Interop
{
    internal static unsafe partial class Kernel32
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.27024")]
        [global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
        private static unsafe partial int FormatMessage(int dwFlags, nint lpSource, uint dwMessageId, int dwLanguageId, void* lpBuffer, int nSize, nint arguments)
        {
            int __lastError;
            int __retVal;
            {
                global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                __retVal = __PInvoke(dwFlags, lpSource, dwMessageId, dwLanguageId, lpBuffer, nSize, arguments);
                __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 = "FormatMessageW", ExactSpelling = true)]
            static extern unsafe int __PInvoke(int __dwFlags_native, nint __lpSource_native, uint __dwMessageId_native, int __dwLanguageId_native, void* __lpBuffer_native, int __nSize_native, nint __arguments_native);
        }
    }
}