From: Pierre Schweitzer Date: Fri, 4 Aug 2017 19:23:42 +0000 (+0000) Subject: [RDBSS] X-Git-Tag: backups/GSoC_2017/rapps@75905~4^2~198 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=29a235cb9be8a7dae030833c4a6bbbdb5438f474 [RDBSS] Implement RxSetDispositionInfo(): this allows deleting files on a remote NFS share! CORE-8204 CORE-11327 CORE-13636 svn path=/trunk/; revision=75482 --- diff --git a/reactos/sdk/lib/drivers/rdbsslib/rdbss.c b/reactos/sdk/lib/drivers/rdbsslib/rdbss.c index 0d1863d3a27..904befe1094 100644 --- a/reactos/sdk/lib/drivers/rdbsslib/rdbss.c +++ b/reactos/sdk/lib/drivers/rdbsslib/rdbss.c @@ -8605,12 +8605,47 @@ RxSetBasicInfo( return Status; } +/* + * @implemented + */ NTSTATUS RxSetDispositionInfo( PRX_CONTEXT RxContext) { - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; + NTSTATUS Status; + + PAGED_CODE(); + + /* First, make the mini-rdr work! */ + Status = RxpSetInfoMiniRdr(RxContext, FileDispositionInformation); + /* If it succeed, we'll keep track of the change */ + if (NT_SUCCESS(Status)) + { + PFCB Fcb; + PFILE_OBJECT FileObject; + PFILE_DISPOSITION_INFORMATION FileDispo; + + Fcb = (PFCB)RxContext->pFcb; + FileObject = RxContext->CurrentIrpSp->FileObject; + FileDispo = RxContext->CurrentIrp->AssociatedIrp.SystemBuffer; + /* Caller asks for deletion: mark as delete on close */ + if (FileDispo->DeleteFile) + { + SetFlag(Fcb->FcbState, FCB_STATE_DELETE_ON_CLOSE); + FileObject->DeletePending = TRUE; + } + /* Otherwise, clear it */ + else + { + ClearFlag(Fcb->FcbState, FCB_STATE_DELETE_ON_CLOSE); + FileObject->DeletePending = FALSE; + } + + /* Sanitize output */ + Status = STATUS_SUCCESS; + } + + return Status; } NTSTATUS