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

◆ Preallocate()

static unsafe void Microsoft.Win32.SafeHandles.SafeFileHandle.Preallocate ( string fullPath,
long preallocationSize,
SafeFileHandle fileHandle )
inlinestaticprivate

Definition at line 482 of file SafeFileHandle.cs.

483 {
485 fILE_ALLOCATION_INFO.AllocationSize = preallocationSize;
488 {
490 if (lastPInvokeError == 112 || lastPInvokeError == 223)
491 {
492 fileHandle.Dispose();
494 throw new IOException(SR.Format((lastPInvokeError == 112) ? SR.IO_DiskFull_Path_AllocationSize : SR.IO_FileTooLarge_Path_AllocationSize, fullPath, preallocationSize));
495 }
496 }
497 }
static bool DeleteFile(string path)
Definition Interop.cs:750
static unsafe bool SetFileInformationByHandle(SafeFileHandle hFile, int FileInformationClass, void *lpFileInformation, uint dwBufferSize)
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string IO_DiskFull_Path_AllocationSize
Definition SR.cs:1556
Definition SR.cs:7

References Interop.Kernel32.DeleteFile(), System.Runtime.InteropServices.SafeHandle.Dispose(), System.SR.Format(), System.Runtime.InteropServices.Marshal.GetLastPInvokeError(), System.SR.IO_DiskFull_Path_AllocationSize, System.SR.IO_FileTooLarge_Path_AllocationSize, and Interop.Kernel32.SetFileInformationByHandle().

Referenced by Microsoft.Win32.SafeHandles.SafeFileHandle.Open().