Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NtApiDotNet/NtFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2379,6 +2379,8 @@ public IEnumerable<FileIdDirectoryEntry> QueryFileIdDirectoryInfo(string file_ma
/// <returns>The length of bytes read into the buffer.</returns>
public NtResult<int> Read(SafeBuffer buffer, long? position, bool throw_on_error)
{
//null is not the same as zero within RunFileCallSync. I did not investigate further than this fix.
position = position ?? 0;
return RunFileCallSync(r => NtSystemCalls.NtReadFile(Handle, r.EventHandle, IntPtr.Zero,
IntPtr.Zero, r.IoStatusBuffer, buffer,
buffer.GetLength(), position.ToLargeInteger(), IntPtr.Zero), throw_on_error)
Expand Down