mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-23 08:53:01 -05:00
sys: IRP_MJ_CLEANUP
This commit is contained in:
parent
162fd3e8c8
commit
707e53d99f
@ -53,8 +53,14 @@ static NTSTATUS FspFsvolCleanup(
|
|||||||
if (!FspFileContextIsValid(IrpSp->FileObject->FsContext))
|
if (!FspFileContextIsValid(IrpSp->FileObject->FsContext))
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
|
|
||||||
|
NTSTATUS Result;
|
||||||
|
FSP_FSVOL_DEVICE_EXTENSION *FsvolDeviceExtension = FspFsvolDeviceExtension(FsvolDeviceObject);
|
||||||
|
BOOLEAN FileNameRequired = 0 != FsvolDeviceExtension->VolumeParams.FileNameRequired;
|
||||||
PFILE_OBJECT FileObject = IrpSp->FileObject;
|
PFILE_OBJECT FileObject = IrpSp->FileObject;
|
||||||
FSP_FILE_CONTEXT *FsContext = FileObject->FsContext;
|
FSP_FILE_CONTEXT *FsContext = FileObject->FsContext;
|
||||||
|
UINT64 UserContext = FsContext->UserContext;
|
||||||
|
UINT64 UserContext2 = (UINT_PTR)FileObject->FsContext2;
|
||||||
|
FSP_FSCTL_TRANSACT_REQ *Request;
|
||||||
LONG OpenCount;
|
LONG OpenCount;
|
||||||
|
|
||||||
/* all handles on this FileObject are gone; close the FileObject */
|
/* all handles on this FileObject are gone; close the FileObject */
|
||||||
@ -69,8 +75,30 @@ static NTSTATUS FspFsvolCleanup(
|
|||||||
FspFsvolDeviceUnlockContextTable(FsvolDeviceObject);
|
FspFsvolDeviceUnlockContextTable(FsvolDeviceObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* create the user-mode file system request */
|
||||||
|
Result = FspIopCreateRequest(Irp, FileNameRequired ? &FsContext->FileName : 0, 0, &Request);
|
||||||
|
if (!NT_SUCCESS(Result))
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* This really should NOT, but can theoretically happen. One way around it would be to
|
||||||
|
* preallocate the Request at IRP_MJ_CREATE time. Unfortunately this becomes more
|
||||||
|
* complicated because of the FileNameRequired functionality.
|
||||||
|
*/
|
||||||
|
#if DBG
|
||||||
|
DEBUGLOG("FileObject=%p, UserContext=%llx, UserContext2=%llx: "
|
||||||
|
"error: the user-mode file system handle will be leaked!",
|
||||||
|
FileObject, UserContext, UserContext2);
|
||||||
|
#endif
|
||||||
Irp->IoStatus.Information = 0;
|
Irp->IoStatus.Information = 0;
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* populate the Cleanup request */
|
||||||
|
Request->Kind = FspFsctlTransactCleanupKind;
|
||||||
|
Request->Req.Cleanup.UserContext = UserContext;
|
||||||
|
Request->Req.Cleanup.UserContext2 = UserContext2;
|
||||||
|
|
||||||
|
return STATUS_PENDING;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID FspFsvolCleanupComplete(
|
VOID FspFsvolCleanupComplete(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user