File: _generated\0\LibraryImports.g.cs
Web Access
Project: src\runtime\src\libraries\System.IO.FileSystem.AccessControl\src\System.IO.FileSystem.AccessControl.csproj (System.IO.FileSystem.AccessControl)
// <auto-generated/>
internal static partial class Interop
{
    internal static partial class Kernel32
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.41101")]
        private static unsafe partial global::Microsoft.Win32.SafeHandles.SafeFileHandle CreateFilePrivate(string lpFileName, int dwDesiredAccess, global::System.IO.FileShare dwShareMode, global::Interop.Kernel32.SECURITY_ATTRIBUTES* lpSecurityAttributes, global::System.IO.FileMode dwCreationDisposition, int dwFlagsAndAttributes, nint hTemplateFile)
        {
            unsafe
            {
                int __lastError;
                bool __invokeSucceeded = default;
                global::Microsoft.Win32.SafeHandles.SafeFileHandle __retVal = default;
                nint __retVal_native = default;
                // Setup - Perform required setup.
                global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeFileHandle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
                try
                {
                    // Pin - Pin data in preparation for calling the P/Invoke.
                    fixed (void* __lpFileName_native = &global::System.Runtime.InteropServices.Marshalling.Utf16StringMarshaller.GetPinnableReference(lpFileName))
                    {
                        global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                        __retVal_native = __PInvoke((ushort*)__lpFileName_native, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
                        __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("kernel32.dll", EntryPoint = "CreateFileW", ExactSpelling = true, CharSet = global::System.Runtime.InteropServices.CharSet.Unicode)]
                [global::System.Runtime.InteropServices.DefaultDllImportSearchPathsAttribute((global::System.Runtime.InteropServices.DllImportSearchPath)2048)]
                static extern unsafe nint __PInvoke(ushort* __lpFileName_native, int __dwDesiredAccess_native, global::System.IO.FileShare __dwShareMode_native, global::Interop.Kernel32.SECURITY_ATTRIBUTES* __lpSecurityAttributes_native, global::System.IO.FileMode __dwCreationDisposition_native, int __dwFlagsAndAttributes_native, nint __hTemplateFile_native);
            }
        }
    }
}
internal static partial class Interop
{
    internal static partial class Kernel32
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.41101")]
        internal static partial bool FindClose(nint hFindFile)
        {
            unsafe
            {
                int __lastError;
                bool __retVal;
                int __retVal_native;
                {
                    global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                    __retVal_native = __PInvoke(hFindFile);
                    __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 = "FindClose", ExactSpelling = true)]
                [global::System.Runtime.InteropServices.DefaultDllImportSearchPathsAttribute((global::System.Runtime.InteropServices.DllImportSearchPath)2048)]
                static extern unsafe int __PInvoke(nint __hFindFile_native);
            }
        }
    }
}
internal static partial class Interop
{
    internal static partial class Kernel32
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.41101")]
        private static partial global::Microsoft.Win32.SafeHandles.SafeFindHandle FindFirstFileExPrivate(string lpFileName, global::Interop.Kernel32.FINDEX_INFO_LEVELS fInfoLevelId, ref global::Interop.Kernel32.WIN32_FIND_DATA lpFindFileData, global::Interop.Kernel32.FINDEX_SEARCH_OPS fSearchOp, nint lpSearchFilter, int dwAdditionalFlags)
        {
            unsafe
            {
                int __lastError;
                bool __invokeSucceeded = default;
                global::Microsoft.Win32.SafeHandles.SafeFindHandle __retVal = default;
                nint __retVal_native = default;
                // Setup - Perform required setup.
                global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::Microsoft.Win32.SafeHandles.SafeFindHandle>.ManagedToUnmanagedOut __retVal_native__marshaller = new();
                try
                {
                    // Pin - Pin data in preparation for calling the P/Invoke.
                    fixed (global::Interop.Kernel32.WIN32_FIND_DATA* __lpFindFileData_native = &lpFindFileData)
                    fixed (void* __lpFileName_native = &global::System.Runtime.InteropServices.Marshalling.Utf16StringMarshaller.GetPinnableReference(lpFileName))
                    {
                        global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                        __retVal_native = __PInvoke((ushort*)__lpFileName_native, fInfoLevelId, __lpFindFileData_native, fSearchOp, lpSearchFilter, dwAdditionalFlags);
                        __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("kernel32.dll", EntryPoint = "FindFirstFileExW", ExactSpelling = true, CharSet = global::System.Runtime.InteropServices.CharSet.Unicode)]
                [global::System.Runtime.InteropServices.DefaultDllImportSearchPathsAttribute((global::System.Runtime.InteropServices.DllImportSearchPath)2048)]
                static extern unsafe nint __PInvoke(ushort* __lpFileName_native, global::Interop.Kernel32.FINDEX_INFO_LEVELS __fInfoLevelId_native, global::Interop.Kernel32.WIN32_FIND_DATA* __lpFindFileData_native, global::Interop.Kernel32.FINDEX_SEARCH_OPS __fSearchOp_native, nint __lpSearchFilter_native, int __dwAdditionalFlags_native);
            }
        }
    }
}
internal static partial class Interop
{
    internal static partial class Kernel32
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.41101")]
        private static unsafe partial int FormatMessage(int dwFlags, nint lpSource, uint dwMessageId, int dwLanguageId, void* lpBuffer, int nSize, nint arguments)
        {
            unsafe
            {
                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)]
                [global::System.Runtime.InteropServices.DefaultDllImportSearchPathsAttribute((global::System.Runtime.InteropServices.DllImportSearchPath)2048)]
                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);
            }
        }
    }
}
internal static partial class Interop
{
    internal static partial class Kernel32
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.41101")]
        private static partial bool GetFileAttributesExPrivate(string name, global::Interop.Kernel32.GET_FILEEX_INFO_LEVELS fileInfoLevel, ref global::Interop.Kernel32.WIN32_FILE_ATTRIBUTE_DATA lpFileInformation)
        {
            unsafe
            {
                int __lastError;
                bool __retVal;
                int __retVal_native;
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (global::Interop.Kernel32.WIN32_FILE_ATTRIBUTE_DATA* __lpFileInformation_native = &lpFileInformation)
                fixed (void* __name_native = &global::System.Runtime.InteropServices.Marshalling.Utf16StringMarshaller.GetPinnableReference(name))
                {
                    global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                    __retVal_native = __PInvoke((ushort*)__name_native, fileInfoLevel, __lpFileInformation_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("kernel32.dll", EntryPoint = "GetFileAttributesExW", ExactSpelling = true, CharSet = global::System.Runtime.InteropServices.CharSet.Unicode)]
                [global::System.Runtime.InteropServices.DefaultDllImportSearchPathsAttribute((global::System.Runtime.InteropServices.DllImportSearchPath)2048)]
                static extern unsafe int __PInvoke(ushort* __name_native, global::Interop.Kernel32.GET_FILEEX_INFO_LEVELS __fileInfoLevel_native, global::Interop.Kernel32.WIN32_FILE_ATTRIBUTE_DATA* __lpFileInformation_native);
            }
        }
    }
}
internal static partial class Interop
{
    internal static partial class Kernel32
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.41101")]
        internal static partial uint GetFullPathNameW(ref char lpFileName, uint nBufferLength, ref char lpBuffer, nint lpFilePart)
        {
            unsafe
            {
                int __lastError;
                uint __retVal;
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (char* __lpBuffer_native = &lpBuffer)
                fixed (char* __lpFileName_native = &lpFileName)
                {
                    global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                    __retVal = __PInvoke(__lpFileName_native, nBufferLength, __lpBuffer_native, lpFilePart);
                    __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 = "GetFullPathNameW", ExactSpelling = true, CharSet = global::System.Runtime.InteropServices.CharSet.Unicode)]
                [global::System.Runtime.InteropServices.DefaultDllImportSearchPathsAttribute((global::System.Runtime.InteropServices.DllImportSearchPath)2048)]
                static extern unsafe uint __PInvoke(char* __lpFileName_native, uint __nBufferLength_native, char* __lpBuffer_native, nint __lpFilePart_native);
            }
        }
    }
}
internal static partial class Interop
{
    internal static partial class Kernel32
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.41101")]
        internal static partial uint GetLongPathNameW(ref char lpszShortPath, ref char lpszLongPath, uint cchBuffer)
        {
            unsafe
            {
                int __lastError;
                uint __retVal;
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (char* __lpszLongPath_native = &lpszLongPath)
                fixed (char* __lpszShortPath_native = &lpszShortPath)
                {
                    global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                    __retVal = __PInvoke(__lpszShortPath_native, __lpszLongPath_native, cchBuffer);
                    __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 = "GetLongPathNameW", ExactSpelling = true, CharSet = global::System.Runtime.InteropServices.CharSet.Unicode)]
                [global::System.Runtime.InteropServices.DefaultDllImportSearchPathsAttribute((global::System.Runtime.InteropServices.DllImportSearchPath)2048)]
                static extern unsafe uint __PInvoke(char* __lpszShortPath_native, char* __lpszLongPath_native, uint __cchBuffer_native);
            }
        }
    }
}
internal static partial class Interop
{
    internal static partial class Kernel32
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.41101")]
        internal static partial bool SetThreadErrorMode(uint dwNewMode, out uint lpOldMode)
        {
            unsafe
            {
                int __lastError;
                lpOldMode = default;
                bool __retVal;
                int __retVal_native;
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (uint* __lpOldMode_native = &lpOldMode)
                {
                    global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                    __retVal_native = __PInvoke(dwNewMode, __lpOldMode_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("kernel32.dll", EntryPoint = "SetThreadErrorMode", ExactSpelling = true)]
                [global::System.Runtime.InteropServices.SuppressGCTransitionAttribute, global::System.Runtime.InteropServices.DefaultDllImportSearchPathsAttribute((global::System.Runtime.InteropServices.DllImportSearchPath)2048)]
                static extern unsafe int __PInvoke(uint __dwNewMode_native, uint* __lpOldMode_native);
            }
        }
    }
}
internal static partial class Interop
{
    internal static partial class Kernel32
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "11.0.14.41101")]
        private static unsafe partial bool CreateDirectoryPrivate(string path, global::Interop.Kernel32.SECURITY_ATTRIBUTES* lpSecurityAttributes)
        {
            unsafe
            {
                int __lastError;
                bool __retVal;
                int __retVal_native;
                // Pin - Pin data in preparation for calling the P/Invoke.
                fixed (void* __path_native = &global::System.Runtime.InteropServices.Marshalling.Utf16StringMarshaller.GetPinnableReference(path))
                {
                    global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
                    __retVal_native = __PInvoke((ushort*)__path_native, lpSecurityAttributes);
                    __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 = "CreateDirectoryW", ExactSpelling = true, CharSet = global::System.Runtime.InteropServices.CharSet.Unicode)]
                [global::System.Runtime.InteropServices.DefaultDllImportSearchPathsAttribute((global::System.Runtime.InteropServices.DllImportSearchPath)2048)]
                static extern unsafe int __PInvoke(ushort* __path_native, global::Interop.Kernel32.SECURITY_ATTRIBUTES* __lpSecurityAttributes_native);
            }
        }
    }
}