mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-23 00:43:00 -05:00
sys: IRP_MJ_CREATE
This commit is contained in:
parent
b5cf090144
commit
9888d24854
@ -312,7 +312,7 @@ NTSTATUS FspFsvolCreatePrepare(
|
|||||||
FSP_FSVRT_DEVICE_EXTENSION *FsvrtDeviceExtension =
|
FSP_FSVRT_DEVICE_EXTENSION *FsvrtDeviceExtension =
|
||||||
FspFsvrtDeviceExtension(FsvolDeviceExtension->FsvrtDeviceObject);
|
FspFsvrtDeviceExtension(FsvolDeviceExtension->FsvrtDeviceObject);
|
||||||
|
|
||||||
/* if the user-mode file system is not doing access checks, there is nothing else to do */
|
/* is the user-mode file system doing access checks? */
|
||||||
if (!FsvrtDeviceExtension->VolumeParams.NoSystemAccessCheck)
|
if (!FsvrtDeviceExtension->VolumeParams.NoSystemAccessCheck)
|
||||||
{
|
{
|
||||||
ASSERT(0 == Request->Req.Create.AccessToken);
|
ASSERT(0 == Request->Req.Create.AccessToken);
|
||||||
@ -346,7 +346,7 @@ VOID FspFsvolCreateComplete(
|
|||||||
|
|
||||||
PFILE_OBJECT FileObject = IrpSp->FileObject;
|
PFILE_OBJECT FileObject = IrpSp->FileObject;
|
||||||
|
|
||||||
/* if the user-mode file system sent us a failure code, fail the request now */
|
/* did the user-mode file system sent us a failure code? */
|
||||||
if (!NT_SUCCESS(Response->IoStatus.Status))
|
if (!NT_SUCCESS(Response->IoStatus.Status))
|
||||||
{
|
{
|
||||||
FspFileContextDelete(FileObject->FsContext);
|
FspFileContextDelete(FileObject->FsContext);
|
||||||
@ -356,14 +356,22 @@ VOID FspFsvolCreateComplete(
|
|||||||
FSP_RETURN();
|
FSP_RETURN();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PDEVICE_OBJECT DeviceObject = IrpSp->DeviceObject;
|
||||||
|
FSP_FSVOL_DEVICE_EXTENSION *FsvolDeviceExtension = FspFsvolDeviceExtension(DeviceObject);
|
||||||
|
FSP_FSVRT_DEVICE_EXTENSION *FsvrtDeviceExtension =
|
||||||
|
FspFsvrtDeviceExtension(FsvolDeviceExtension->FsvrtDeviceObject);
|
||||||
|
|
||||||
|
/* are we doing access checks? */
|
||||||
|
if (FsvrtDeviceExtension->VolumeParams.NoSystemAccessCheck)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/* record the user-mode file system contexts */
|
/* record the user-mode file system contexts */
|
||||||
FSP_FILE_CONTEXT *FsContext = FileObject->FsContext;
|
FSP_FILE_CONTEXT *FsContext = FileObject->FsContext;
|
||||||
FsContext->UserContext = Response->Rsp.Create.UserContext;
|
FsContext->UserContext = Response->Rsp.Create.UserContext;
|
||||||
FileObject->FsContext2 = (PVOID)(UINT_PTR)Response->Rsp.Create.UserContext2;
|
FileObject->FsContext2 = (PVOID)(UINT_PTR)Response->Rsp.Create.UserContext2;
|
||||||
|
|
||||||
/* insert the new FsContext into our generic table */
|
/* insert the new FsContext into our generic table */
|
||||||
PDEVICE_OBJECT DeviceObject = IrpSp->DeviceObject;
|
|
||||||
FSP_FSVOL_DEVICE_EXTENSION *FsvolDeviceExtension = FspFsvolDeviceExtension(DeviceObject);
|
|
||||||
BOOLEAN Inserted;
|
BOOLEAN Inserted;
|
||||||
ExAcquireResourceExclusiveLite(&FsvolDeviceExtension->Base.Resource, TRUE);
|
ExAcquireResourceExclusiveLite(&FsvolDeviceExtension->Base.Resource, TRUE);
|
||||||
try
|
try
|
||||||
@ -382,8 +390,7 @@ VOID FspFsvolCreateComplete(
|
|||||||
if (0 == FsContext)
|
if (0 == FsContext)
|
||||||
{
|
{
|
||||||
FspFsvolCreateClose(Irp, Response);
|
FspFsvolCreateClose(Irp, Response);
|
||||||
Result = STATUS_INSUFFICIENT_RESOURCES;
|
FSP_RETURN(Result = STATUS_INSUFFICIENT_RESOURCES);
|
||||||
FSP_RETURN();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* does an FsContext with the same UserContext already exist? */
|
/* does an FsContext with the same UserContext already exist? */
|
||||||
@ -393,6 +400,9 @@ VOID FspFsvolCreateComplete(
|
|||||||
FileObject->FsContext = FsContext;
|
FileObject->FsContext = FsContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Irp->IoStatus.Information = Response->IoStatus.Information;
|
||||||
|
Result = Response->IoStatus.Status;
|
||||||
|
|
||||||
FSP_LEAVE_IOC(
|
FSP_LEAVE_IOC(
|
||||||
"FileObject=%p[%p:\"%wZ\"]",
|
"FileObject=%p[%p:\"%wZ\"]",
|
||||||
IrpSp->FileObject, IrpSp->FileObject->RelatedFileObject, IrpSp->FileObject->FileName);
|
IrpSp->FileObject, IrpSp->FileObject->RelatedFileObject, IrpSp->FileObject->FileName);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user