mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
more completely implement write operations
svn path=/trunk/; revision=164
This commit is contained in:
parent
2b59b2c1c2
commit
2d3181f734
1 changed files with 24 additions and 0 deletions
|
@ -171,6 +171,10 @@ NTSTATUS ZwWriteFile(HANDLE FileHandle,
|
|||
{
|
||||
return(Status);
|
||||
}
|
||||
if (ByteOffset==NULL)
|
||||
{
|
||||
ByteOffset = &(FileObject->CurrentByteOffset);
|
||||
}
|
||||
|
||||
KeInitializeEvent(&Event,NotificationEvent,FALSE);
|
||||
Irp = IoBuildSynchronousFsdRequest(IRP_MJ_WRITE,
|
||||
|
@ -181,6 +185,26 @@ NTSTATUS ZwWriteFile(HANDLE FileHandle,
|
|||
&Event,
|
||||
IoStatusBlock);
|
||||
DPRINT("FileObject->DeviceObject %x\n",FileObject->DeviceObject);
|
||||
StackPtr = IoGetNextIrpStackLocation(Irp);
|
||||
StackPtr->FileObject = FileObject;
|
||||
StackPtr->Parameters.Write.Length = Length;
|
||||
if (ByteOffset!=NULL)
|
||||
{
|
||||
StackPtr->Parameters.Write.ByteOffset = *ByteOffset;
|
||||
}
|
||||
else
|
||||
{
|
||||
SET_LARGE_INTEGER_LOW_PART(StackPtr->Parameters.Write.ByteOffset, 0);
|
||||
SET_LARGE_INTEGER_HIGH_PART(StackPtr->Parameters.Write.ByteOffset, 0);
|
||||
}
|
||||
if (Key!=NULL)
|
||||
{
|
||||
StackPtr->Parameters.Write.Key = *Key;
|
||||
}
|
||||
else
|
||||
{
|
||||
StackPtr->Parameters.Write.Key = 0;
|
||||
}
|
||||
Status = IoCallDriver(FileObject->DeviceObject,Irp);
|
||||
if (Status==STATUS_PENDING && (FileObject->Flags & FO_SYNCHRONOUS_IO))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue