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
23b4956488
commit
f32db0ed2e
@ -116,7 +116,7 @@ static NTSTATUS FspFsvolCreate(
|
|||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* impossible create options set? */
|
/* impossible create options sent? */
|
||||||
if (FlagOn(CreateOptions, FILE_NON_DIRECTORY_FILE) &&
|
if (FlagOn(CreateOptions, FILE_NON_DIRECTORY_FILE) &&
|
||||||
FlagOn(CreateOptions, FILE_DIRECTORY_FILE))
|
FlagOn(CreateOptions, FILE_DIRECTORY_FILE))
|
||||||
{
|
{
|
||||||
@ -247,6 +247,10 @@ static NTSTATUS FspFsvolCreate(
|
|||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The new request is associated with our IRP and will be deleted during its completion.
|
||||||
|
*/
|
||||||
|
|
||||||
/* populate the Create request */
|
/* populate the Create request */
|
||||||
Request->Kind = FspFsctlTransactCreateKind;
|
Request->Kind = FspFsctlTransactCreateKind;
|
||||||
Request->Req.Create.CreateDisposition = CreateDisposition;
|
Request->Req.Create.CreateDisposition = CreateDisposition;
|
||||||
@ -372,6 +376,8 @@ VOID FspFsvolCreateComplete(
|
|||||||
FspFsvrtDeviceExtension(FsvolDeviceExtension->FsvrtDeviceObject);
|
FspFsvrtDeviceExtension(FsvolDeviceExtension->FsvrtDeviceObject);
|
||||||
PFILE_OBJECT FileObject = IrpSp->FileObject;
|
PFILE_OBJECT FileObject = IrpSp->FileObject;
|
||||||
PACCESS_STATE AccessState = IrpSp->Parameters.Create.SecurityContext->AccessState;
|
PACCESS_STATE AccessState = IrpSp->Parameters.Create.SecurityContext->AccessState;
|
||||||
|
ULONG CreateOptions = IrpSp->Parameters.Create.Options & 0xffffff;
|
||||||
|
UINT32 ResponseFileAttributes = Response->Rsp.Create.Opened.FileAttributes;
|
||||||
PSECURITY_DESCRIPTOR SecurityDescriptor;
|
PSECURITY_DESCRIPTOR SecurityDescriptor;
|
||||||
ULONG SecurityDescriptorSize;
|
ULONG SecurityDescriptorSize;
|
||||||
UNICODE_STRING ReparseFileName;
|
UNICODE_STRING ReparseFileName;
|
||||||
@ -492,6 +498,20 @@ VOID FspFsvolCreateComplete(
|
|||||||
ClearFlag(AccessState->RemainingDesiredAccess, GrantedAccess);
|
ClearFlag(AccessState->RemainingDesiredAccess, GrantedAccess);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* were we asked to open a directory or non-directory? */
|
||||||
|
if (FlagOn(CreateOptions, FILE_DIRECTORY_FILE) &&
|
||||||
|
!FlagOn(ResponseFileAttributes, FILE_ATTRIBUTE_DIRECTORY))
|
||||||
|
{
|
||||||
|
FspFsvolCreateClose(Irp, Response);
|
||||||
|
FSP_RETURN(Result = STATUS_NOT_A_DIRECTORY);
|
||||||
|
}
|
||||||
|
if (FlagOn(CreateOptions, FILE_NON_DIRECTORY_FILE) &&
|
||||||
|
FlagOn(ResponseFileAttributes, FILE_ATTRIBUTE_DIRECTORY))
|
||||||
|
{
|
||||||
|
FspFsvolCreateClose(Irp, Response);
|
||||||
|
FSP_RETURN(Result = STATUS_FILE_IS_A_DIRECTORY);
|
||||||
|
}
|
||||||
|
|
||||||
/* record the user-mode file system contexts */
|
/* record the user-mode file system contexts */
|
||||||
FsContext->UserContext = Response->Rsp.Create.Opened.UserContext;
|
FsContext->UserContext = Response->Rsp.Create.Opened.UserContext;
|
||||||
FileObject->FsContext2 = (PVOID)(UINT_PTR)Response->Rsp.Create.Opened.UserContext2;
|
FileObject->FsContext2 = (PVOID)(UINT_PTR)Response->Rsp.Create.Opened.UserContext2;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user