diff options
author | vnugent <public@vaughnnugent.com> | 2024-01-15 19:32:30 -0500 |
---|---|---|
committer | vnugent <public@vaughnnugent.com> | 2024-01-15 19:32:30 -0500 |
commit | f4e4db7c5320976406feb252ae8f8bdbe9b3e351 (patch) | |
tree | bcec74e7fde4b083770dccedf7e93202d2eb657d /lib/Utils/src/IO | |
parent | 1914bdb0e506aac53de6b886648b033d0229e9a1 (diff) |
setup new lib import code attributes
Diffstat (limited to 'lib/Utils/src/IO')
-rw-r--r-- | lib/Utils/src/IO/FileOperations.cs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Utils/src/IO/FileOperations.cs b/lib/Utils/src/IO/FileOperations.cs index a8cd258..0dd95e4 100644 --- a/lib/Utils/src/IO/FileOperations.cs +++ b/lib/Utils/src/IO/FileOperations.cs @@ -1,5 +1,5 @@ /* -* Copyright (c) 2023 Vaughn Nugent +* Copyright (c) 2024 Vaughn Nugent * * Library: VNLib * Package: VNLib.Utils @@ -32,19 +32,19 @@ namespace VNLib.Utils.IO /// <summary> /// Contains cross-platform optimized filesystem operations. /// </summary> - public static class FileOperations + public static partial class FileOperations { public const int INVALID_FILE_ATTRIBUTES = -1; - [DllImport("Shlwapi", SetLastError = true, CharSet = CharSet.Auto)] + [LibraryImport("Shlwapi", EntryPoint = "PathFileExistsW", StringMarshalling = StringMarshalling.Utf16)] [DefaultDllImportSearchPaths(DllImportSearchPath.System32)] [return:MarshalAs(UnmanagedType.Bool)] - private static unsafe extern bool PathFileExists([MarshalAs(UnmanagedType.LPWStr)] string path); + private static unsafe partial bool PathFileExists([MarshalAs(UnmanagedType.LPWStr)] string path); - [DllImport("kernel32", SetLastError = true, CharSet = CharSet.Auto)] + [LibraryImport("kernel32", EntryPoint = "GetFileAttributesW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)] [DefaultDllImportSearchPaths(DllImportSearchPath.System32)] [return:MarshalAs(UnmanagedType.I4)] - private static unsafe extern int GetFileAttributes([MarshalAs(UnmanagedType.LPWStr)] string path); + private static unsafe partial int GetFileAttributes([MarshalAs(UnmanagedType.LPWStr)] string path); static readonly bool IsWindows = OperatingSystem.IsWindows(); |