Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ FillAttributeInfo() [2/2]

static int System.IO.FileSystem.FillAttributeInfo ( string path,
ref Interop::Kernel32::WIN32_FILE_ATTRIBUTE_DATA data,
bool returnErrorOnNotFound )
inlinestaticpackage

Definition at line 53 of file FileSystem.cs.

54 {
55 int num = 0;
56 path = PathInternal.TrimEndingDirectorySeparator(path);
57 using (DisableMediaInsertionPrompt.Create())
58 {
60 {
62 if (!IsPathUnreachableError(num))
63 {
66 if (safeFindHandle.IsInvalid)
67 {
69 }
70 else
71 {
72 num = 0;
73 data.PopulateFrom(ref data2);
74 }
75 }
76 }
77 }
78 if (num != 0 && !returnErrorOnNotFound && ((uint)(num - 2) <= 1u || num == 21))
79 {
80 data.dwFileAttributes = -1;
81 return 0;
82 }
83 return num;
84 }
static bool GetFileAttributesEx(string name, GET_FILEEX_INFO_LEVELS fileInfoLevel, ref WIN32_FILE_ATTRIBUTE_DATA lpFileInformation)
Definition Interop.cs:179
static Microsoft.Win32.SafeHandles.SafeFindHandle FindFirstFile(string fileName, ref WIN32_FIND_DATA data)
Definition Interop.cs:117
static bool IsPathUnreachableError(int errorCode)
Definition FileSystem.cs:69

References System.IO.DisableMediaInsertionPrompt.Create(), Interop.Kernel32.FindFirstFile(), Interop.Kernel32.GetFileAttributesEx(), System.Runtime.InteropServices.Marshal.GetLastWin32Error(), System.IO.FileSystem.IsPathUnreachableError(), and System.IO.PathInternal.TrimEndingDirectorySeparator().