AllocatedBuffer = TRUE;
}
- DPRINT1("Effective read: %lu at %lu for stream '%S'\n", RealLength, RealReadOffset, Fcb->Stream);
+ DPRINT("Effective read: %lu at %lu for stream '%S'\n", RealLength, RealReadOffset, Fcb->Stream);
RealLengthRead = ReadAttribute(DeviceExt, DataContext, RealReadOffset, (PCHAR)ReadBuffer, RealLength);
if (RealLengthRead == 0)
{
*LengthRead = ToRead;
- DPRINT1("%lu got read\n", *LengthRead);
+ DPRINT("%lu got read\n", *LengthRead);
if (AllocatedBuffer)
{
* @param IrpFlags
* TODO: flags are presently ignored in code.
*
+* @param CaseSensitive
+* Boolean indicating if the function should operate in case-sensitive mode. This will be TRUE
+* if an application opened the file with the FILE_FLAG_POSIX_SEMANTICS flag.
+*
* @param LengthWritten
* Pointer to a ULONG. This ULONG will be set to the number of bytes successfully written.
*
ULONG Length,
ULONG WriteOffset,
ULONG IrpFlags,
+ BOOLEAN CaseSensitive,
PULONG LengthWritten)
{
NTSTATUS Status = STATUS_NOT_IMPLEMENTED;
ULONG AttributeOffset;
ULONGLONG StreamSize;
- DPRINT("NtfsWriteFile(%p, %p, %p, %u, %u, %x, %p)\n", DeviceExt, FileObject, Buffer, Length, WriteOffset, IrpFlags, LengthWritten);
+ DPRINT("NtfsWriteFile(%p, %p, %p, %u, %u, %x, %s, %p)\n",
+ DeviceExt,
+ FileObject,
+ Buffer,
+ Length,
+ WriteOffset,
+ IrpFlags,
+ (CaseSensitive ? "TRUE" : "FALSE"),
+ LengthWritten);
*LengthWritten = 0;
return Status;
}
- // at this point the record in DataContext may be stale, so we need to refresh it
- ReleaseAttributeContext(DataContext);
-
- Status = FindAttribute(DeviceExt,
- FileRecord,
- AttributeData,
- Fcb->Stream,
- wcslen(Fcb->Stream),
- &DataContext,
- &AttributeOffset);
- if (!NT_SUCCESS(Status))
- {
- DPRINT1("DRIVER ERROR: Couldn't find $DATA attribute after setting size!\n");
- return Status;
- }
-
// now we need to update this file's size in every directory index entry that references it
// TODO: put this code in its own function and adapt it to work with every filename / hardlink
// stored in the file record.
filename.Length = fileNameAttribute->NameLength * sizeof(WCHAR);
filename.MaximumLength = filename.Length;
- Status = UpdateFileNameRecord(Fcb->Vcb, ParentMFTId, &filename, FALSE, DataSize.QuadPart, AllocationSize);
+ Status = UpdateFileNameRecord(Fcb->Vcb,
+ ParentMFTId,
+ &filename,
+ FALSE,
+ DataSize.QuadPart,
+ AllocationSize,
+ CaseSensitive);
}
else
Length,
ByteOffset.LowPart,
Irp->Flags,
+ (IrpContext->Stack->Flags & SL_CASE_SENSITIVE),
&ReturnedWriteLength);
IrpContext->Irp->IoStatus.Status = Status;