downlvli.c revision 78a072e1b56619e3230735ae073668311232ec94
/*++
Copyright (c) 1989 - 1999 Microsoft Corporation
Module Name:
Abstract:
This module implements downlevel fileinfo, volinfo, and dirctrl.
--*/
#include "precomp.h"
#pragma hdrstop
//
// The local debug trace level
//
#define Dbg (DEBUG_TRACE_DOWNLVLI)
NTSTATUS VBoxMRxSetEndOfFile (IN OUT struct _RX_CONTEXT * RxContext, IN OUT PLARGE_INTEGER pNewFileSize, OUT PLARGE_INTEGER pNewAllocationSize)
/*++
Routine Description:
This routine handles requests to truncate or extend the file
Arguments:
RxContext - the RDBSS context
Return Value:
NTSTATUS - The return status for the operation
--*/
{
PRTFSOBJINFO pObjInfo = 0;
int vboxRC;
Log(("VBOXSF: VBoxMRxSetEndOfFile: New size = %RX64 (0x%x), pNewAllocationSize = 0x%x\n", pNewFileSize->QuadPart, pNewFileSize, pNewAllocationSize));
cbBuffer = sizeof(RTFSOBJINFO);
if (pObjInfo == 0)
{
AssertFailed();
return STATUS_NO_MEMORY;
}
vboxRC = vboxCallFSInfo(&pDeviceExtension->hgcmClient, &pNetRootExtension->map, pVBoxFobx->hFile, SHFL_INFO_SET | SHFL_INFO_SIZE, &cbBuffer, (PSHFLDIRINFO)pObjInfo);
if (Status == STATUS_SUCCESS)
{
Log(("VBOXSF: VBoxMRxSetEndOfFile: vboxCallFSInfo new allocation size = %RX64\n", pObjInfo->cbAllocated));
/* Return new allocation size */
}
if (pObjInfo)
return Status;
}
/*++
Routine Description:
This routine handles requests to truncate the file
Arguments:
RxContext - the RDBSS context
Return Value:
NTSTATUS - The return status for the operation
--*/
{
Log(("VBOXSF: VBoxMRxTruncateFile not implemented!\n"));
return STATUS_NOT_IMPLEMENTED;
}
ULONG VBoxMRxExtendFile (IN OUT struct _RX_CONTEXT * RxContext, IN OUT PLARGE_INTEGER pNewFileSize, OUT PLARGE_INTEGER pNewAllocationSize)
/*++
Routine Description:
This routine handles requests to extend the file for cached IO.
Arguments:
RxContext - the RDBSS context
Return Value:
NTSTATUS - The return status for the operation
--*/
{
}
NTSTATUS VBoxMRxExtendStub (IN OUT struct _RX_CONTEXT * RxContext, IN OUT PLARGE_INTEGER pNewFileSize, OUT PLARGE_INTEGER pNewAllocationSize)
/*++
Routine Description:
This routine handles MRxExtendForCache and MRxExtendForNonCache requests. Since the write
itself will extend the file, we can pretty much just get out quickly.
Arguments:
RxContext - the RDBSS context
Return Value:
RXSTATUS - The return status for the operation
--*/
{
/* Note: On Windows hosts VBoxMRxSetEndOfFile returns ACCESS_DENIED if the file has been
* opened in APPEND mode. Therefore it is better to not call host at all and implement
* this MrxExtend* request just like in mrxsmb DDK sample.
*/
return(STATUS_SUCCESS);
}