mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-24 09:23:37 -05:00
sys: IRP_MJ_CREATE
This commit is contained in:
parent
0fb9de1ebd
commit
23b4956488
@ -135,16 +135,21 @@ typedef struct
|
||||
} IoStatus;
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
UINT64 UserContext; /* user context attached to an open file (unique file id) */
|
||||
UINT64 UserContext2; /* user context attached to a kernel file object */
|
||||
/* (only low 32 bits valid in 32-bit mode) */
|
||||
union
|
||||
{
|
||||
FSP_FSCTL_TRANSACT_BUF SecurityDescriptor; /* security descriptor for existing files */
|
||||
FSP_FSCTL_TRANSACT_BUF ReparseFileName; /* file name to use for STATUS_REPARSE */
|
||||
} Buf;
|
||||
/* IoStatus.Status == STATUS_SUCCESS */
|
||||
struct
|
||||
{
|
||||
UINT64 UserContext; /* open file user context (unique file id) */
|
||||
UINT64 UserContext2; /* kernel file object user context (only low 32 bits valid) */
|
||||
UINT32 FileAttributes; /* FILE_ATTRIBUTE_{NORMAL,DIRECTORY,etc.} */
|
||||
FSP_FSCTL_TRANSACT_BUF SecurityDescriptor; /* security descriptor */
|
||||
} Opened;
|
||||
/* IoStatus.Status == STATUS_REPARSE */
|
||||
struct
|
||||
{
|
||||
FSP_FSCTL_TRANSACT_BUF FileName; /* file name to use for STATUS_REPARSE */
|
||||
} Reparse;
|
||||
} Create;
|
||||
} Rsp;
|
||||
FSP_FSCTL_DECLSPEC_ALIGN UINT8 Buffer[];
|
||||
|
@ -116,6 +116,14 @@ static NTSTATUS FspFsvolCreate(
|
||||
goto exit;
|
||||
}
|
||||
|
||||
/* impossible create options set? */
|
||||
if (FlagOn(CreateOptions, FILE_NON_DIRECTORY_FILE) &&
|
||||
FlagOn(CreateOptions, FILE_DIRECTORY_FILE))
|
||||
{
|
||||
Result = STATUS_INVALID_PARAMETER;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
/* check security descriptor validity */
|
||||
if (0 != SecurityDescriptor)
|
||||
{
|
||||
@ -392,9 +400,9 @@ VOID FspFsvolCreateComplete(
|
||||
if (STATUS_REPARSE == Result)
|
||||
{
|
||||
ReparseFileName.Buffer =
|
||||
(PVOID)(Response->Buffer + Response->Rsp.Create.Buf.ReparseFileName.Offset);
|
||||
(PVOID)(Response->Buffer + Response->Rsp.Create.Reparse.FileName.Offset);
|
||||
ReparseFileName.Length = ReparseFileName.MaximumLength =
|
||||
Response->Rsp.Create.Buf.ReparseFileName.Size;
|
||||
Response->Rsp.Create.Reparse.FileName.Size;
|
||||
|
||||
Result = STATUS_ACCESS_DENIED;
|
||||
if (IO_REPARSE == Response->IoStatus.Information)
|
||||
@ -439,8 +447,8 @@ VOID FspFsvolCreateComplete(
|
||||
}
|
||||
|
||||
SecurityDescriptor =
|
||||
(PVOID)(Response->Buffer + Response->Rsp.Create.Buf.SecurityDescriptor.Offset);
|
||||
SecurityDescriptorSize = Response->Rsp.Create.Buf.SecurityDescriptor.Size;
|
||||
(PVOID)(Response->Buffer + Response->Rsp.Create.Opened.SecurityDescriptor.Offset);
|
||||
SecurityDescriptorSize = Response->Rsp.Create.Opened.SecurityDescriptor.Size;
|
||||
|
||||
/* are we doing access checks? */
|
||||
if (FsvrtDeviceExtension->VolumeParams.NoSystemAccessCheck &&
|
||||
@ -485,8 +493,8 @@ VOID FspFsvolCreateComplete(
|
||||
}
|
||||
|
||||
/* record the user-mode file system contexts */
|
||||
FsContext->UserContext = Response->Rsp.Create.UserContext;
|
||||
FileObject->FsContext2 = (PVOID)(UINT_PTR)Response->Rsp.Create.UserContext2;
|
||||
FsContext->UserContext = Response->Rsp.Create.Opened.UserContext;
|
||||
FileObject->FsContext2 = (PVOID)(UINT_PTR)Response->Rsp.Create.Opened.UserContext2;
|
||||
|
||||
/*
|
||||
* The following must be done under the file system volume device Resource,
|
||||
|
Loading…
x
Reference in New Issue
Block a user