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

◆ GetFindData()

static void System.IO.FileSystem.GetFindData ( string fullPath,
bool isDirectory,
bool ignoreAccessDenied,
ref Interop::Kernel32::WIN32_FIND_DATA findData )
inlinestaticprivate

Definition at line 382 of file FileSystem.cs.

383 {
384 using SafeFindHandle safeFindHandle = Interop.Kernel32.FindFirstFile(Path.TrimEndingDirectorySeparator(fullPath), ref findData);
385 if (safeFindHandle.IsInvalid)
386 {
387 int num = Marshal.GetLastWin32Error();
388 if (isDirectory && num == 2)
389 {
390 num = 3;
391 }
392 if (!(isDirectory && num == 5 && ignoreAccessDenied))
393 {
394 throw Win32Marshal.GetExceptionForWin32Error(num, fullPath);
395 }
396 }
397 }
static Microsoft.Win32.SafeHandles.SafeFindHandle FindFirstFile(string fileName, ref WIN32_FIND_DATA data)
Definition Interop.cs:117

References Interop.Kernel32.FindFirstFile(), System.IO.Win32Marshal.GetExceptionForWin32Error(), System.Runtime.InteropServices.Marshal.GetLastWin32Error(), and System.IO.Path.TrimEndingDirectorySeparator().

Referenced by System.IO.FileSystem.GetFinalLinkTarget(), and System.IO.FileSystem.RemoveDirectory().