sys: create: FspFsvolCreate

Replace FspMainFileOpenCheck with inline code
This commit is contained in:
Bill Zissimopoulos
2018-09-06 13:26:53 -07:00
parent a168b96b76
commit 4551766f7a
2 changed files with 26 additions and 24 deletions

View File

@ -126,8 +126,32 @@ static NTSTATUS FspFsvolCreate(
{
PAGED_CODE();
NTSTATUS Result = STATUS_SUCCESS;
BOOLEAN MainFileOpen = FspMainFileOpenCheck(Irp);
NTSTATUS Result;
PECP_LIST ExtraCreateParameters;
PVOID ExtraCreateParameter;
BOOLEAN MainFileOpen = FALSE;
/*
* Check if the IRP has ECP's.
*
* We do this check for the following reason:
*
* - To determine whether this is a "main file open", i.e. the opening
* of the main file for a stream. In this case this is a reentrant open
* and we should be careful not to try to acquire the rename resource,
* which is already acquired (otherwise DEADLOCK).
*/
ExtraCreateParameters = 0;
Result = FsRtlGetEcpListFromIrp(Irp, &ExtraCreateParameters);
if (NT_SUCCESS(Result) && 0 != ExtraCreateParameters)
{
ExtraCreateParameter = 0;
MainFileOpen =
NT_SUCCESS(FsRtlFindExtraCreateParameter(ExtraCreateParameters,
&FspMainFileOpenEcpGuid, &ExtraCreateParameter, 0)) &&
0 != ExtraCreateParameter &&
!FsRtlIsEcpFromUserMode(ExtraCreateParameter);
}
if (!MainFileOpen)
{