file.c revision 09c9a430ad2caac61753f90b04a4989c6d54d13a
/** @file
*
* VirtualBox Windows Guest Shared Folders
*
* File System Driver file routines
*/
/*
* Copyright (C) 2012 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#include "vbsf.h"
{
int vboxRC;
Log(("VBOXSF: vbsfReadInternal: AsyncIo = %d, Fcb->FileSize = 0x%RX64\n",
Log(("VBOXSF: vbsfReadInternal: UserBuffer %p, BufferMdl %p\n",
Log(("VBOXSF: vbsfReadInternal: ByteCount 0x%X, ByteOffset 0x%RX64, FileSize 0x%RX64\n",
/* @todo check if this is necessary. */
#else
#endif
{
if (ByteOffset >= FileSize)
{
Log(("VBOXSF: vbsfReadInternal: EOF\n"));
return STATUS_END_OF_FILE;
}
{
}
}
/* @todo read 0 bytes == always success? */
|| ByteCount == 0)
{
AssertFailed();
return STATUS_INVALID_PARAMETER;
}
/* @todo Split large reads. */
if (Status != STATUS_SUCCESS)
{
/* Nothing read. */
ByteCount = 0;
}
Log(("VBOXSF: vbsfReadInternal: Status = 0x%08X, ByteCount = 0x%X\n",
return Status;
}
{
Log(("VBOXSF: vbsfReadWorker: calling the worker\n"));
Log(("VBOXSF: vbsfReadWorker: Status 0x%08X\n",
}
{
Log(("VBOXSF: MRxRead: RxDispatchToWorkerThread: Status 0x%08X\n",
Status));
if (Status == STATUS_SUCCESS)
{
}
return Status;
}
{
int vboxRC;
Log(("VBOXSF: vbsfWriteInternal: AsyncIo = %d, Fcb->FileSize = 0x%RX64\n",
Log(("VBOXSF: vbsfWriteInternal: UserBuffer %p, BufferMdl %p\n",
Log(("VBOXSF: vbsfWriteInternal: ByteCount is 0x%X, ByteOffset is 0x%RX64, FileSize 0x%RX64\n",
/* @todo allow to write 0 bytes. */
|| ByteCount == 0)
{
AssertFailed();
return STATUS_INVALID_PARAMETER;
}
/* @todo Split large writes. */
if (Status != STATUS_SUCCESS)
{
/* Nothing written. */
ByteCount = 0;
}
Log(("VBOXSF: vbsfWriteInternal: Status = 0x%08X, ByteCount = 0x%X\n",
return Status;
}
{
Log(("VBOXSF: vbsfWriteWorker: calling the worker\n"));
Log(("VBOXSF: vbsfWriteWorker: Status 0x%08X\n",
}
{
Log(("VBOXSF: MRxWrite: RxDispatchToWorkerThread: Status 0x%08X\n",
Status));
if (Status == STATUS_SUCCESS)
{
}
return Status;
}
{
int vboxRC;
Log(("VBOXSF: MRxLocks: Operation %d\n",
switch (LowIoContext->Operation)
{
default:
AssertMsgFailed(("VBOXSF: MRxLocks: Unsupported lock/unlock type %d detected!\n",
return STATUS_NOT_IMPLEMENTED;
case LOWIO_OP_UNLOCK_MULTIPLE:
/* @todo Remove multiple locks listed in LowIoContext.ParamsFor.Locks.LockList. */
Log(("VBOXSF: MRxLocks: Unsupported LOWIO_OP_UNLOCK_MULTIPLE!\n",
return STATUS_NOT_IMPLEMENTED;
case LOWIO_OP_SHAREDLOCK:
break;
case LOWIO_OP_EXCLUSIVELOCK:
break;
case LOWIO_OP_UNLOCK:
break;
}
{
}
else
{
}
Log(("VBOXSF: MRxLocks: Returned 0x%08X\n",
Status));
return Status;
}
{
Log(("VBOXSF: MRxCompleteBufferingStateChangeRequest: not implemented\n"));
return STATUS_NOT_IMPLEMENTED;
}
{
int vboxRC;
Log(("VBOXSF: MRxFlush\n"));
/* Do the actual flushing of file buffers */
Log(("VBOXSF: MRxFlush: Returned 0x%08X\n",
Status));
return Status;
}
{
int vboxRC;
Log(("VBOXSF: vbsfSetEndOfFile: New size = %RX64 (%p), pNewAllocationSize = %p\n",
cbBuffer = sizeof(SHFLFSOBJINFO);
{
AssertFailed();
return STATUS_INSUFFICIENT_RESOURCES;
}
Log(("VBOXSF: vbsfSetEndOfFile: vboxCallFSInfo returned %Rrc\n",
vboxRC));
if (Status == STATUS_SUCCESS)
{
Log(("VBOXSF: vbsfSetEndOfFile: vboxCallFSInfo new allocation size = %RX64\n",
pObjInfo->cbAllocated));
/* Return new allocation size */
}
if (pObjInfo)
{
}
Log(("VBOXSF: vbsfSetEndOfFile: Returned 0x%08X\n",
Status));
return Status;
}
{
/* Note: On Windows hosts vbsfSetEndOfFile returns ACCESS_DENIED if the file has been
* opened in APPEND mode. Writes to a file will extend it anyway, therefore it is
* better to not call the host at all and tell the caller that the file was extended.
*/
Log(("VBOXSF: MRxExtendStub: new size = %RX64\n",
pNewFileSize->QuadPart));
return STATUS_SUCCESS;
}