openclos.c revision 78a072e1b56619e3230735ae073668311232ec94
/*++
Copyright (c) 1989 - 1999 Microsoft Corporation
Module Name:
Abstract:
This module implements the mini redirector call down routines pertaining to opening/
closing of file/directories.
--*/
#include "precomp.h"
#include "rdbss_vbox.h"
#pragma hdrstop
//
// forwards & pragmas
//
#ifdef __cplusplus
extern "C"
{
#endif
NTSTATUS VBoxMRxProcessCreate (IN PRX_CONTEXT RxContext, IN PUNICODE_STRING RemainingName, IN FILE_BASIC_INFORMATION *pFileBasicInfo, IN FILE_STANDARD_INFORMATION *pFileStandardInfo,
NTSTATUS VBoxMRxCreateFileSuccessTail (PRX_CONTEXT RxContext, PBOOLEAN MustRegainExclusiveResource, RX_FILE_TYPE StorageType, ULONG CreateAction, FILE_BASIC_INFORMATION* pFileBasicInfo,
VOID VBoxMRxSetSrvOpenFlags (PRX_CONTEXT RxContext, RX_FILE_TYPE StorageType, PMRX_SRV_OPEN SrvOpen);
#ifdef __cplusplus
}
#endif
#ifdef ALLOC_PRAGMA
#endif
/*++
Routine Description:
This routine determines if the mini knows of a good reason not
to try collapsing on this open. Presently, the only reason would
be if this were a copychunk open.
Arguments:
RxContext - the RDBSS context
Return Value:
NTSTATUS - The return status for the operation
SUCCESS --> okay to try collapse
other (MORE_PROCESSING_REQUIRED) --> dont collapse
--*/
{
#ifdef VBOX_SHFL_WITH_COLLAPSE
#else
#endif
PAGED_CODE();
return Status;
}
/*++
Routine Description:
This routine checks if it is a stream file and return the root file name if true.
Arguments:
FileName - the file name needs to be parsed
AdjustFileName - the file name contains only root name of the stream
Return Value:
BOOLEAN - stream file
--*/
{
USHORT i;
{
{
break;
}
}
if (AdjustFileName != NULL)
{
if (IsStream)
{
}
else
{
}
}
return IsStream;
}
PNULMRX_NETROOT_EXTENSION pExt = (((pNetRoot) == NULL) ? NULL : (PNULMRX_NETROOT_EXTENSION)((pNetRoot)->Context))
typedef struct _NULMRX_FCB_EXTENSION_
{
//
// Node type code and size
//
//
// NET_ROOT extension - stores state global to a root
//
typedef struct _NULMRX_NETROOT_EXTENSION
{
//
// Node type code and size
//
NTSTATUS NulMRxProcessCreate (IN PNULMRX_FCB_EXTENSION pFcbExtension, IN PVOID EaBuffer, IN ULONG EaLength, OUT PLONGLONG pEndOfFile, OUT PLONGLONG pAllocationSize)
/*++
Routine Description:
This routine processes a create calldown.
Arguments:
pFcbExtension - ptr to the FCB extension
EaBuffer - ptr to the EA param buffer
EaLength - len of EaBuffer
pEndOfFile - return end of file value
pAllocationSize - return allocation size (which maybe > EOF)
Notes:
It is possible to create a file with no EAs
Return Value:
None
--*/
{
*pAllocationSize = *pEndOfFile = 0;
return Status;
}
{
//
// set this only if cache manager will be used for mini-rdr handles !
//
SrvOpen->BufferingFlags |= (FCB_STATE_FILESIZECACHEING_ENABLED | FCB_STATE_FILETIMECACHEING_ENABLED | FCB_STATE_WRITEBUFFERING_ENABLED | FCB_STATE_LOCK_BUFFERING_ENABLED
#else
#endif
}
NTSTATUS NulMRxCreateFileSuccessTail (PRX_CONTEXT RxContext, PBOOLEAN MustRegainExclusiveResource, RX_FILE_TYPE StorageType, ULONG CreateAction, FILE_BASIC_INFORMATION* pFileBasicInfo,
/*++
Routine Description:
This routine finishes the initialization of the fcb and srvopen for a
successful open.
Arguments:
Return Value:
RXSTATUS - The return status for the operation
--*/
{
PAGED_CODE();
{ //this is required because of oplock breaks
}
// This Fobx should be cleaned up by the wrapper
{
return STATUS_INSUFFICIENT_RESOURCES;
}
RxFormInitPacket(InitPacket, &pFileBasicInfo->FileAttributes, &pFileStandardInfo->NumberOfLinks, &pFileBasicInfo->CreationTime, &pFileBasicInfo->LastAccessTime, &pFileBasicInfo->LastWriteTime,
&pFileBasicInfo->ChangeTime, &pFileStandardInfo->AllocationSize, &pFileStandardInfo->EndOfFile, &pFileStandardInfo->EndOfFile);
{
}
else
{
}
//transition happens later
return Status;
}
/*++
Routine Description:
This routine opens a file across the network
Arguments:
RxContext - the RDBSS context
Return Value:
RXSTATUS - The return status for the operation
--*/
{
PAGED_CODE();
if (RemainingName->Length)
{
#ifdef VBOX_GUEST
Log(("VBOXSF: VBoxMRxCreate: Attempt to open %.*ls Len is %d\n", RemainingName->Length/sizeof(WCHAR), RemainingName->Buffer, RemainingName->Length ));
#else
Log(("VBOXSF: VBoxMRxCreate: Attempt to open %wZ Len is %d\n", RemainingName, RemainingName->Length));
#endif
}
else
{
{
Log(("VBOXSF: VBoxMRxCreate: Empty name -> Only backslash used\n"));
}
}
{
case NET_ROOT_MAILSLOT:
case NET_ROOT_PIPE:
case NET_ROOT_PRINT:
default:
goto Exit;
case NET_ROOT_WILD: /** @todo what's this?? */
case NET_ROOT_DISK:
break;
}
//
// Squirrel away the scatter list in the FCB extension.
// This is done only for data files.
//
Status = VBoxMRxProcessCreate(RxContext, RemainingName, &FileBasicInfo, &FileStandardInfo, EaBuffer, EaLength, &CreateAction, &Handle);
if (Status != STATUS_SUCCESS)
{
//
// error..
//
Log(("VBOXSF: VBoxMRxCreate: Failed to initialize scatter list!\n"));
goto Exit;
}
//
// Complete CreateFile contract
//
Log(("VBOXSF: VBoxMRxCreate: EOF is %d AllocSize is %d\n", (ULONG)FileStandardInfo.EndOfFile.QuadPart, (ULONG)FileStandardInfo.AllocationSize.QuadPart));
Status = VBoxMRxCreateFileSuccessTail(RxContext, &fMustRegainExclusiveResource, StorageType, CreateAction, &FileBasicInfo, &FileStandardInfo, Handle);
if (Status != STATUS_SUCCESS)
{
//
// alloc error..
//
Log(("VBOXSF: VBoxMRxCreate: Failed to allocate Fobx!\n"));
goto Exit;
}
if (!RxIsFcbAcquiredExclusive(capFcb))
{
}
Log(("VBOXSF: VBoxMRxCreate: NetRoot is 0x%x, Fcb is 0x%x, SrvOpen is 0x%x, Fobx is 0x%x\n", NetRoot, capFcb, SrvOpen, RxContext->pFobx));
}
NTSTATUS VBoxMRxProcessCreate (IN PRX_CONTEXT RxContext, IN PUNICODE_STRING RemainingName, IN FILE_BASIC_INFORMATION *pFileBasicInfo, IN FILE_STANDARD_INFORMATION *pFileStandardInfo,
/*++
Routine Description:
This routine processes a create calldown.
Arguments:
pFcbExtension - ptr to the FCB extension
EaBuffer - ptr to the EA param buffer
EaLength - len of EaBuffer
pEndOfFile - return end of file value
pAllocationSize - return allocation size (which maybe > EOF)
Notes:
It is possible to create a file with no EAs
Return Value:
None
--*/
{
int vboxRC = VINF_SUCCESS;
/* Various boolean flags. */
struct
{
} bf;
SHFLCREATEPARMS *pCreateParms = 0;
Log(("VBOXSF: VBoxMRxProcessCreate\n"));
Log(("VBOXSF: VBoxMRxProcessCreate: FileAttributes = %08x\n", RxContext->Create.NtCreateParameters.FileAttributes));
Log(("VBOXSF: VBoxMRxProcessCreate: CreateOptions = %08x\n", RxContext->Create.NtCreateParameters.CreateOptions));
FileAttributes = (UCHAR)(RxContext->Create.NtCreateParameters.FileAttributes & ~FILE_ATTRIBUTE_NORMAL);
/* Extended attributes are not supported! */
if (EaLength)
{
Log(("VBOXSF: VBoxMRxProcessCreate: Unsupported: extended attributes!\n"));
goto failure;
}
/* We do not support opens by file ids yet. */
{
Log(("VBOXSF: VBoxMRxProcessCreate: Unsupported: file open by id!\n"));
goto failure;
}
/* Mask out unsupported attribute bits. */
FileAttributes &= (FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_ARCHIVE);
if (bf.DeleteOnClose)
Log(("VBOXSF: VBoxMRxProcessCreate: Delete on close!\n"));
if (bf.IsPagingFile)
{
Log(("VBOXSF: VBoxMRxProcessCreate: Unsupported: paging file!\n"));
goto failure;
}
bf.CreateDirectory = (BOOLEAN)(bf.DirectoryFile && ((CreateDisposition == FILE_CREATE) || (CreateDisposition == FILE_OPEN_IF)));
bf.OpenDirectory = (BOOLEAN)(bf.DirectoryFile && ((CreateDisposition == FILE_OPEN) || (CreateDisposition == FILE_OPEN_IF)));
bf.TemporaryFile = BooleanFlagOn(RxContext->Create.NtCreateParameters.FileAttributes, FILE_ATTRIBUTE_TEMPORARY );
Log(("VBOXSF: VBoxMRxProcessCreate: bf.TemporaryFile %d, bf.CreateDirectory %d, bf.DirectoryFile = %d\n", (ULONG)bf.TemporaryFile, (ULONG)bf.CreateDirectory, (ULONG)bf.DirectoryFile));
/* Check consistency in specified flags. */
if (bf.TemporaryFile && bf.CreateDirectory) /* Directories with temporary flag set are not allowed! */
{
Log(("VBOXSF: VBoxMRxProcessCreate: Not allowed: Temporary directories!\n"));
goto failure;
}
{
AssertMsgFailed(("VBOXSF: VBoxMRxProcessCreate: Unsupported combination: dir && !dir\n"));
goto failure;
}
/* Initialize create parameters. */
if (!pCreateParms)
{
goto failure;
}
if (bf.OpenTargetDirectory)
{
}
if (bf.DirectoryFile)
{
if (CreateDisposition != FILE_CREATE && CreateDisposition != FILE_OPEN && CreateDisposition != FILE_OPEN_IF)
{
AssertMsgFailed(("VBOXSF: VBoxMRxProcessCreate: Invalid disposition %x for directory!\n", CreateDisposition));
goto failure;
}
}
switch (CreateDisposition)
{
case FILE_SUPERSEDE:
Log(("VBOXSF: VBoxMRxProcessCreate: CreateFlags |= SHFL_CF_ACT_REPLACE_IF_EXISTS | SHFL_CF_ACT_CREATE_IF_NEW\n"));
break;
case FILE_OPEN:
Log(("VBOXSF: VBoxMRxProcessCreate: CreateFlags |= SHFL_CF_ACT_OPEN_IF_EXISTS | SHFL_CF_ACT_FAIL_IF_NEW\n"));
break;
case FILE_CREATE:
Log(("VBOXSF: VBoxMRxProcessCreate: CreateFlags |= SHFL_CF_ACT_FAIL_IF_EXISTS | SHFL_CF_ACT_CREATE_IF_NEW\n"));
break;
case FILE_OPEN_IF:
Log(("VBOXSF: VBoxMRxProcessCreate: CreateFlags |= SHFL_CF_ACT_OPEN_IF_EXISTS | SHFL_CF_ACT_CREATE_IF_NEW\n"));
break;
case FILE_OVERWRITE:
Log(("VBOXSF: VBoxMRxProcessCreate: CreateFlags |= SHFL_CF_ACT_OVERWRITE_IF_EXISTS | SHFL_CF_ACT_FAIL_IF_NEW\n"));
break;
case FILE_OVERWRITE_IF:
Log(("VBOXSF: VBoxMRxProcessCreate: CreateFlags |= SHFL_CF_ACT_OVERWRITE_IF_EXISTS | SHFL_CF_ACT_CREATE_IF_NEW\n"));
break;
default:
AssertMsgFailed(("VBOXSF: VBoxMRxProcessCreate: Unexpected create disposition: 0x%08X\n", CreateDisposition));
goto failure;
}
if (DesiredAccess & FILE_READ_DATA)
{
Log(("VBOXSF: VBoxMRxProcessCreate: FILE_READ_DATA\n"));
}
if (DesiredAccess & FILE_WRITE_DATA)
{
Log(("VBOXSF: VBoxMRxProcessCreate: FILE_WRITE_DATA\n"));
/* FILE_WRITE_DATA means write access regardless of FILE_APPEND_DATA bit.
*/
}
else if (DesiredAccess & FILE_APPEND_DATA)
{
Log(("VBOXSF: VBoxMRxProcessCreate: FILE_APPEND_DATA\n"));
/* FILE_APPEND_DATA without FILE_WRITE_DATA means append only mode.
*
* Both write and append access flags are required for shared folders,
* as on Windows FILE_APPEND_DATA implies write access.
*/
}
else if (ShareAccess & FILE_SHARE_READ)
else if (ShareAccess & FILE_SHARE_WRITE)
/* Set initial allocation size. */
if (FileAttributes == 0)
#ifdef VBOX_FAKE_IO_CREATE
{
}
#else
{
PSHFLSTRING ParsedPath = 0;
/* Calculate length required for parsed path.
*/
if (NULL == ParsedPath)
{
goto failure;
}
/* Call host. */
Log(("VBOXSF: VBoxMRxProcessCreate: vboxCallCreate called.\n"));
vboxRC = vboxCallCreate(&pDeviceExtension->hgcmClient, &pNetRootExtension->map, ParsedPath, pCreateParms);
}
Log(("VBOXSF: VBoxMRxProcessCreate: vboxCallCreate returns vboxRC = %Rrc, Result = %x\n", vboxRC, pCreateParms->Result));
if (RT_FAILURE(vboxRC))
{
/* Map some VBoxRC to STATUS codes expected by the system. */
switch (vboxRC)
{
case VERR_ALREADY_EXISTS:
{
}
goto failure;
break;
/* On POSIX systems, the "mkdir" command returns VERR_FILE_NOT_FOUND when
doing a recursive directory create. Handle this case in the next switch below. */
case VERR_FILE_NOT_FOUND:
break;
default:
{
}
goto failure;
break;
}
}
/*
* The request succeeded. Analyze host response,
*/
switch (pCreateParms->Result)
{
case SHFL_PATH_NOT_FOUND:
{
/* Path to object does not exist. */
Log(("VBOXSF: VBoxMRxProcessCreate: Path not found\n"));
goto failure;
}
case SHFL_FILE_NOT_FOUND:
{
Log(("VBOXSF: VBoxMRxProcessCreate: File not found\n"));
{
goto failure;
}
/* Here we can only have the OpenTargetDirectory mode. */
if (!bf.OpenTargetDirectory)
{
Log(("VBOXSF: VBoxMRxProcessCreate: File not found but have a handle!\n"));
goto failure;
}
/* File components does not exist but target directory was opened. */
break;
}
case SHFL_FILE_EXISTS:
{
{
if (CreateDisposition == FILE_CREATE)
{
/* File was not opened because we requested a create. */
goto failure;
}
/* Actually we should not go here, unless we have no rights to open the object. */
Log(("VBOXSF: VBoxMRxProcessCreate: Existing file was not opened!\n"));
goto failure;
}
if (bf.OpenTargetDirectory)
{
}
else
{
}
/* Existing file was opened. Go check flags and create FCB. */
break;
}
case SHFL_FILE_CREATED:
{
/* A new file was created. */
/* Go check flags and create FCB. */
break;
}
case SHFL_FILE_REPLACED:
{
/* Existing file was replaced or overwriting. */
if (CreateDisposition == FILE_SUPERSEDE)
{
}
else
{
}
/* Go check flags and create FCB. */
break;
}
default:
{
Log(("VBOXSF: VBoxMRxProcessCreate: Invalid CreateResult from host (0x%08X)\n", pCreateParms->Result));
goto failure;
}
}
/* Check flags. */
{
/* Caller wanted only a file, but the object is a directory. */
Log(("VBOXSF: VBoxMRxProcessCreate: File is a directory!\n"));
goto failure;
}
{
/* Caller wanted only a directory, but the object is not a directory. */
Log(("VBOXSF: VBoxMRxProcessCreate: File is not a directory!\n"));
goto failure;
}
/* Translate attributes */
/* Translate file times */
pFileBasicInfo->CreationTime.QuadPart = RTTimeSpecGetNtTime(&pCreateParms->Info.BirthTime); /* ridiculous name */
{
Log(("VBOXSF: VBoxMRxProcessCreate: AllocationSize = %RX64, EndOfFile = %RX64\n", pCreateParms->Info.cbAllocated, pCreateParms->Info.cbObject));
}
else
{
}
#endif
return Status;
{
#ifndef VBOX_FAKE_IO_CREATE
#endif
}
if (pCreateParms)
return Status;
}
VOID VBoxMRxSetSrvOpenFlags (PRX_CONTEXT RxContext, RX_FILE_TYPE StorageType, PMRX_SRV_OPEN SrvOpen)
{
//
// set this only if cache manager will be used for mini-rdr handles !
//
#if 0
/* This seems to be the root cause of the strange bug checks when enabling
* the driver verifier.
*/
#endif
}
NTSTATUS VBoxMRxCreateFileSuccessTail (PRX_CONTEXT RxContext, PBOOLEAN MustRegainExclusiveResource, RX_FILE_TYPE StorageType, ULONG CreateAction, FILE_BASIC_INFORMATION* pFileBasicInfo,
/*++
Routine Description:
This routine finishes the initialization of the fcb and srvopen for a
successful open.
Arguments:
Return Value:
RXSTATUS - The return status for the operation
--*/
{
Log(("VBOXSF: VBoxMRxCreateFileSuccessTail\n"));
PAGED_CODE();
{ //this is required because of oplock breaks
}
// This Fobx should be cleaned up by the wrapper
{
AssertFailed();
return STATUS_INSUFFICIENT_RESOURCES;
}
Log(("VBOXSF: VBoxMRxCreateFileSuccessTail: StorageType = 0x%08lx, Action = 0x%08lx\n", StorageType, CreateAction));
RxFormInitPacket(InitPacket, &pFileBasicInfo->FileAttributes, &pFileStandardInfo->NumberOfLinks, &pFileBasicInfo->CreationTime, &pFileBasicInfo->LastAccessTime, &pFileBasicInfo->LastWriteTime,
&pFileBasicInfo->ChangeTime, &pFileStandardInfo->AllocationSize, &pFileStandardInfo->EndOfFile, &pFileStandardInfo->EndOfFile);
{
}
else
{
}
//transition happens later
if (pVBoxFobx)
{
}
else return STATUS_INSUFFICIENT_RESOURCES;
return Status;
}
/*++
Routine Description:
This routine collapses a open locally
Arguments:
RxContext - the RDBSS context
Return Value:
RXSTATUS - The return status for the operation
--*/
{
#ifdef VBOX_SHFL_WITH_COLLAPSE
Log(("VBOXSF: VBoxMRxCollapseOpen: Old Fobx = %p, old VBoxFobx = %p\n", RxContext->pFobx, pVBoxFobx));
Log(("VBOXSF: VBoxMRxCollapseOpen: New Fobx = %p, new VBoxFobx = %p\n", RxContext->pFobx, pVBoxFobx));
{
int vboxRC;
/* Initialize create parameters. */
/* Assume it's a directory; open existing, read-only access, deny-none sharing */
--> incorrect
{
PSHFLSTRING ParsedPath = 0;
/* Calculate length required for parsed path.
*/
if (NULL == ParsedPath)
return STATUS_INSUFFICIENT_RESOURCES;
/* Call host. */
vboxRC = vboxCallCreate (&pDeviceExtension->hgcmClient, &pNetRootExtension->map, ParsedPath, &CreateParms);
if (ParsedPath)
}
if (RT_FAILURE(vboxRC))
{
return STATUS_UNSUCCESSFUL;
}
/*
* The request succeeded. Analyze host response,
*/
switch (CreateParms.Result)
{
case SHFL_PATH_NOT_FOUND:
{
/* Path to object does not exist. */
Log(("VBOXSF: Path not found\n"));
return STATUS_OBJECT_PATH_NOT_FOUND;
}
case SHFL_FILE_NOT_FOUND:
{
Log(("VBOXSF: File not found\n"));
return STATUS_OBJECT_NAME_NOT_FOUND;
}
case SHFL_FILE_EXISTS:
{
Log(("VBOXSF: Object exists.\n"));
break; /* existing dir opened */
}
default:
{
return STATUS_OBJECT_PATH_NOT_FOUND;
}
}
/* Translate attributes */
/* Translate file times */
pFileBasicInfo->CreationTime.QuadPart = RTTimeSpecGetNtTime(&CreateParms.Info.BirthTime); /* ridiculous name */
}
else
{
AssertFailed();
}
return Status;
#else
#ifdef DEBUG
Log(("VBOXSF: VBoxMRxCollapseOpen: Old Fobx = %p, old VBoxFobx = %p -> Not implemented!\n", RxContext->pFobx, pVBoxFobx));
#endif
return STATUS_NOT_IMPLEMENTED;
#endif
}
NTSTATUS VBoxMRxComputeNewBufferingState (IN OUT PMRX_SRV_OPEN pMRxSrvOpen, IN PVOID pMRxContext, OUT PULONG pNewBufferingState)
/*++
Routine Description:
This routine maps specific oplock levels into the appropriate RDBSS
buffering state flags
Arguments:
pMRxSrvOpen - the MRX SRV_OPEN extension
pMRxContext - the context passed to RDBSS at Oplock indication time
pNewBufferingState - the place holder for the new buffering state
Return Value:
Notes:
--*/
{
Log(("VBOXSF: VBoxMRxComputeNewBufferingState \n"));
return (Status);
}
{
Log(("VBOXSF: VBoxMRxDeallocateForFcb\n"));
return (Status);
}
/*++
Routine Description:
This routine truncates the contents of a file system object
Arguments:
pRxContext - the RDBSS context
Return Value:
RXSTATUS - The return status for the operation
--*/
{
Log(("VBoxMRxTruncate\n"));
AssertMsgFailed(("Found a truncate"));
return STATUS_NOT_IMPLEMENTED;
}
/*++
Routine Description:
This routine cleansup a file system object...normally a noop. unless it's a pipe in which case
we do the close at cleanup time and mark the file as being not open.
Arguments:
pRxContext - the RDBSS context
Return Value:
RXSTATUS - The return status for the operation
--*/
{
PAGED_CODE();
return STATUS_INVALID_PARAMETER;
/* Close file */
{
{
#ifndef VBOX_FAKE_IO_CREATE
int vboxRC = vboxCallClose(&pDeviceExtension->hgcmClient, &pNetRootExtension->map, pVBoxFobx->hFile);
#endif
}
}
{
Log(("VBOXSF: VBoxMRxCleanupFobx: File orphaned\n"));
return (STATUS_SUCCESS);
}
{
Log(("VBOXSF: VBoxMRxCleanupFobx: File not for closing at cleanup\n"));
return (STATUS_SUCCESS);
}
return Status;
}
/*++
Routine Description:
This routine closes a file system object
Arguments:
pSrvOpen - the instance to be closed
Return Value:
RXSTATUS - The return status for the operation
Notes:
--*/
{
Log(("VBOXSF: VBoxMRxForcedClose\n"));
return STATUS_NOT_IMPLEMENTED;
}
/*++
Routine Description:
This routine closes a file across the network
Arguments:
RxContext - the RDBSS context
Return Value:
RXSTATUS - The return status for the operation
--*/
{
int vboxRC = 0;
PAGED_CODE();
Log(("VBOXSF: VBoxMRxCloseSrvOpen: Remaining name = %.*ls, Len = %d\n", RemainingName->Length / sizeof(WCHAR), RemainingName->Buffer, RemainingName->Length));
return STATUS_INVALID_PARAMETER;
{
Log(("VBOXSF: VBoxMRxCloseSrvOpen: File was renamed; ignore close!\n"));
return STATUS_SUCCESS;
}
/* Close file */
{
#ifndef VBOX_FAKE_IO_CREATE
#endif
}
/* Remove file or directory if delete action is pending. */
{
}
return (Status);
}
{
Log(("VBOXSF: VBoxMRxDeallocateForFobx\n"));
return (STATUS_SUCCESS);
}
/*++
Routine Description:
This routine removes a file or directory
Arguments:
RxContext - the RDBSS context
Return Value:
NTSTATUS - The return status for the operation
--*/
{
int vboxRC;
PSHFLSTRING ParsedPath = 0;
Log(("VBOXSF: VBoxMRxRemove Delete %.*ls. open count = %d!!\n", RemainingName->Length / sizeof(WCHAR), RemainingName->Buffer, capFcb->OpenCount));
/* Close file first if not already done. */
{
#ifndef VBOX_FAKE_IO_CREATE
#endif
}
/* Calculate length required for parsed path.
*/
if (!ParsedPath)
return STATUS_INSUFFICIENT_RESOURCES;
Log(("Setup ParsedPath\n"));
/* Call host. */
#ifdef VBOX_FAKE_IO_DELETE
#else
vboxRC = vboxCallRemove(&pDeviceExtension->hgcmClient, &pNetRootExtension->map, ParsedPath, (pVBoxFobx->FileStandardInfo.Directory) ? SHFL_REMOVE_DIR : SHFL_REMOVE_FILE);
#endif
if (ParsedPath)
if (vboxRC != VINF_SUCCESS)
if (vboxRC == VINF_SUCCESS)
return Status;
}