mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-23 08:53:01 -05:00
sys: FSP_STATUS_IGNORE_BIT
This commit is contained in:
parent
8f25dd6cab
commit
1713ce9c9e
@ -40,6 +40,7 @@
|
|||||||
|
|
||||||
/* private NTSTATUS codes */
|
/* private NTSTATUS codes */
|
||||||
#define FSP_STATUS_PRIVATE_BIT (0x20000000)
|
#define FSP_STATUS_PRIVATE_BIT (0x20000000)
|
||||||
|
#define FSP_STATUS_IGNORE_BIT (0x10000000)
|
||||||
#define FSP_STATUS_IOQ_POST (FSP_STATUS_PRIVATE_BIT | 0x0000)
|
#define FSP_STATUS_IOQ_POST (FSP_STATUS_PRIVATE_BIT | 0x0000)
|
||||||
#define FSP_STATUS_IOQ_POST_BEST_EFFORT (FSP_STATUS_PRIVATE_BIT | 0x0001)
|
#define FSP_STATUS_IOQ_POST_BEST_EFFORT (FSP_STATUS_PRIVATE_BIT | 0x0001)
|
||||||
|
|
||||||
@ -198,7 +199,7 @@ VOID FspDebugLogIrp(const char *func, PIRP Irp, NTSTATUS Result);
|
|||||||
} while (0,0)
|
} while (0,0)
|
||||||
#define FSP_LEAVE_MJ(fmt, ...) \
|
#define FSP_LEAVE_MJ(fmt, ...) \
|
||||||
FSP_LEAVE_( \
|
FSP_LEAVE_( \
|
||||||
if (STATUS_PENDING != Result) \
|
if (STATUS_PENDING != Result && !(FSP_STATUS_IGNORE_BIT & Result))\
|
||||||
{ \
|
{ \
|
||||||
ASSERT(0 == (FSP_STATUS_PRIVATE_BIT & Result) ||\
|
ASSERT(0 == (FSP_STATUS_PRIVATE_BIT & Result) ||\
|
||||||
FSP_STATUS_IOQ_POST == Result || FSP_STATUS_IOQ_POST_BEST_EFFORT == Result);\
|
FSP_STATUS_IOQ_POST == Result || FSP_STATUS_IOQ_POST_BEST_EFFORT == Result);\
|
||||||
@ -225,6 +226,8 @@ VOID FspDebugLogIrp(const char *func, PIRP Irp, NTSTATUS Result);
|
|||||||
else \
|
else \
|
||||||
FspIopCompleteIrpEx(Irp, Result, fsp_device_deref);\
|
FspIopCompleteIrpEx(Irp, Result, fsp_device_deref);\
|
||||||
} \
|
} \
|
||||||
|
else \
|
||||||
|
Result &= ~FSP_STATUS_IGNORE_BIT;\
|
||||||
IoSetTopLevelIrp(fsp_top_level_irp);\
|
IoSetTopLevelIrp(fsp_top_level_irp);\
|
||||||
); \
|
); \
|
||||||
return Result
|
return Result
|
||||||
|
@ -1872,21 +1872,21 @@ NTSTATUS FspFileNodeProcessLockIrp(FSP_FILE_NODE *FileNode, PIRP Irp)
|
|||||||
{
|
{
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
IoMarkIrpPending(Irp);
|
NTSTATUS Result;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
FsRtlProcessFileLock(&FileNode->FileLock, Irp, FileNode);
|
Result = FsRtlProcessFileLock(&FileNode->FileLock, Irp, FileNode);
|
||||||
}
|
}
|
||||||
except (EXCEPTION_EXECUTE_HANDLER)
|
except (EXCEPTION_EXECUTE_HANDLER)
|
||||||
{
|
{
|
||||||
Irp->IoStatus.Status = GetExceptionCode();
|
Irp->IoStatus.Status = GetExceptionCode();
|
||||||
Irp->IoStatus.Information = 0;
|
Irp->IoStatus.Information = 0;
|
||||||
|
|
||||||
FspFileNodeCompleteLockIrp(FileNode, Irp);
|
Result = FspFileNodeCompleteLockIrp(FileNode, Irp);
|
||||||
}
|
}
|
||||||
|
|
||||||
return STATUS_PENDING;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS FspFileNodeCompleteLockIrp(PVOID Context, PIRP Irp)
|
static NTSTATUS FspFileNodeCompleteLockIrp(PVOID Context, PIRP Irp)
|
||||||
|
@ -450,18 +450,15 @@ static NTSTATUS FspFsvolFileSystemControlOplock(
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* FspOplockFsctrl takes ownership of the IRP under all circumstances.
|
* FspOplockFsctrl takes ownership of the IRP under all circumstances.
|
||||||
*
|
|
||||||
* We mark the IRP pending so that we can safely return STATUS_PENDING.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
IoSetTopLevelIrp(0);
|
IoSetTopLevelIrp(0);
|
||||||
|
|
||||||
IoMarkIrpPending(Irp);
|
|
||||||
Result = FspFileNodeOplockFsctl(FileNode, Irp, OplockCount);
|
Result = FspFileNodeOplockFsctl(FileNode, Irp, OplockCount);
|
||||||
|
|
||||||
FspFileNodeRelease(FileNode, Main);
|
FspFileNodeRelease(FileNode, Main);
|
||||||
|
|
||||||
return STATUS_PENDING;
|
return Result | FSP_STATUS_IGNORE_BIT;
|
||||||
|
|
||||||
unlock_exit:
|
unlock_exit:
|
||||||
FspFileNodeRelease(FileNode, Main);
|
FspFileNodeRelease(FileNode, Main);
|
||||||
|
@ -66,11 +66,10 @@ static NTSTATUS FspFsvolLockControlRetry(
|
|||||||
|
|
||||||
/* let the FSRTL package handle this one! */
|
/* let the FSRTL package handle this one! */
|
||||||
Result = FspFileNodeProcessLockIrp(FileNode, Irp);
|
Result = FspFileNodeProcessLockIrp(FileNode, Irp);
|
||||||
ASSERT(STATUS_PENDING == Result);
|
|
||||||
|
|
||||||
FspFileNodeReleaseF(FileNode, IrpFlags);
|
FspFileNodeReleaseF(FileNode, IrpFlags);
|
||||||
|
|
||||||
return Result;
|
return Result | FSP_STATUS_IGNORE_BIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS FspFsvolLockControl(
|
static NTSTATUS FspFsvolLockControl(
|
||||||
|
@ -145,7 +145,7 @@ static VOID FspWqWorkRoutine(PVOID Context)
|
|||||||
IoSetTopLevelIrp(Irp);
|
IoSetTopLevelIrp(Irp);
|
||||||
|
|
||||||
Result = WorkRoutine(DeviceObject, Irp, IrpSp, TRUE);
|
Result = WorkRoutine(DeviceObject, Irp, IrpSp, TRUE);
|
||||||
if (STATUS_PENDING != Result)
|
if (STATUS_PENDING != Result && !(FSP_STATUS_IGNORE_BIT & Result))
|
||||||
{
|
{
|
||||||
ASSERT(0 == (FSP_STATUS_PRIVATE_BIT & Result) ||
|
ASSERT(0 == (FSP_STATUS_PRIVATE_BIT & Result) ||
|
||||||
FSP_STATUS_IOQ_POST == Result || FSP_STATUS_IOQ_POST_BEST_EFFORT == Result);
|
FSP_STATUS_IOQ_POST == Result || FSP_STATUS_IOQ_POST_BEST_EFFORT == Result);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user