IO_STATUS_BLOCK IoStatusBlock;
NTSTATUS Status;
+ /* Just return success if no file is associated with this hive */
+ if (HiveHandle == NULL)
+ return TRUE;
+
_FileOffset.QuadPart = *FileOffset;
- Status = ZwReadFile(HiveHandle, 0, 0, 0, &IoStatusBlock,
- Buffer, (ULONG)BufferLength, &_FileOffset, 0);
+ Status = ZwReadFile(HiveHandle, NULL, NULL, NULL, &IoStatusBlock,
+ Buffer, (ULONG)BufferLength, &_FileOffset, NULL);
return NT_SUCCESS(Status) ? TRUE : FALSE;
}
IO_STATUS_BLOCK IoStatusBlock;
NTSTATUS Status;
+ /* Just return success if no file is associated with this hive */
+ if (HiveHandle == NULL)
+ return TRUE;
+
+ /* Don't do anything if we're not supposed to */
+ if (CmpNoWrite)
+ return TRUE;
+
_FileOffset.QuadPart = *FileOffset;
- Status = ZwWriteFile(HiveHandle, 0, 0, 0, &IoStatusBlock,
- Buffer, (ULONG)BufferLength, &_FileOffset, 0);
+ Status = ZwWriteFile(HiveHandle, NULL, NULL, NULL, &IoStatusBlock,
+ Buffer, (ULONG)BufferLength, &_FileOffset, NULL);
return NT_SUCCESS(Status) ? TRUE : FALSE;
}
IO_STATUS_BLOCK IoStatusBlock;
NTSTATUS Status;
+ /* Just return success if no file is associated with this hive */
+ if (HiveHandle == NULL)
+ return TRUE;
+
EndOfFileInfo.EndOfFile.QuadPart = FileSize;
Status = ZwSetInformationFile(HiveHandle,
&IoStatusBlock,
IO_STATUS_BLOCK IoStatusBlock;
NTSTATUS Status;
+ /* Just return success if no file is associated with this hive */
+ if (HiveHandle == NULL)
+ return TRUE;
+
+ /* Don't do anything if we're not supposed to */
+ if (CmpNoWrite)
+ return TRUE;
+
Status = ZwFlushBuffersFile(HiveHandle, &IoStatusBlock);
return NT_SUCCESS(Status) ? TRUE : FALSE;
}