private void SetPriorityHint(SafeFileHandle fileHandle, Kernel32Types.PRIORITY_HINT priorityHint) { Kernel32Types.FileInformation fileInformation = new Kernel32Types.FileInformation(); fileInformation.FILE_IO_PRIORITY_HINT_INFO.PriorityHint = priorityHint; bool isSet = FabricFile.SetFileInformationByHandle( fileHandle, Kernel32Types.FILE_INFO_BY_HANDLE_CLASS.FileIoPriorityHintInfo, ref fileInformation, Marshal.SizeOf(fileInformation.FILE_IO_PRIORITY_HINT_INFO)); Assert.IsTrue(isSet); }
public static void SetIoPriorityHint(SafeFileHandle safeFileHandle, Kernel32Types.PRIORITY_HINT priorityHintInfo) { Kernel32Types.FileInformation fileInformation = new Kernel32Types.FileInformation(); fileInformation.FILE_IO_PRIORITY_HINT_INFO.PriorityHint = priorityHintInfo; bool isSet = FabricFile.SetFileInformationByHandle( safeFileHandle, Kernel32Types.FILE_INFO_BY_HANDLE_CLASS.FileIoPriorityHintInfo, ref fileInformation, Marshal.SizeOf(fileInformation.FILE_IO_PRIORITY_HINT_INFO)); if (isSet == false) { int status = Marshal.GetLastWin32Error(); Assert(false, "SetFileInformationByHandle failed: ErrorCode: {0}", status); } }
public static extern bool SetFileInformationByHandle(SafeHandle hFile, Kernel32Types.FILE_INFO_BY_HANDLE_CLASS FileInformationClass, ref Kernel32Types.FileInformation FileInformation, int dwBufferSize);