mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-23 00:43:00 -05:00
sys: FspIrpContext*
This commit is contained in:
parent
6fcab43120
commit
253de21708
@ -346,7 +346,7 @@ NTSTATUS FspFsvolCreatePrepare(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* send the user-mode handle to the user-mode file system */
|
/* send the user-mode handle to the user-mode file system */
|
||||||
Irp->Tail.Overlay.DriverContext[1] = UserModeAccessToken;
|
FspIrpContextHandle(Irp) = UserModeAccessToken;
|
||||||
Request->Req.Create.AccessToken = (UINT_PTR)UserModeAccessToken;
|
Request->Req.Create.AccessToken = (UINT_PTR)UserModeAccessToken;
|
||||||
|
|
||||||
FSP_LEAVE_IOP();
|
FSP_LEAVE_IOP();
|
||||||
@ -388,8 +388,7 @@ VOID FspFsvolCreateComplete(
|
|||||||
ULONG Flags = IrpSp->Flags;
|
ULONG Flags = IrpSp->Flags;
|
||||||
KPROCESSOR_MODE RequestorMode =
|
KPROCESSOR_MODE RequestorMode =
|
||||||
FlagOn(Flags, SL_FORCE_ACCESS_CHECK) ? UserMode : Irp->RequestorMode;
|
FlagOn(Flags, SL_FORCE_ACCESS_CHECK) ? UserMode : Irp->RequestorMode;
|
||||||
BOOLEAN HasTrailingBackslash =
|
BOOLEAN HasTrailingBackslash = 0 != FspIrpContextRequest(Irp)->Req.Create.HasTrailingBackslash;
|
||||||
0 != ((FSP_FSCTL_TRANSACT_REQ *)Irp->Tail.Overlay.DriverContext[0])->Req.Create.HasTrailingBackslash;
|
|
||||||
FSP_FILE_CONTEXT *FsContext = FileObject->FsContext;
|
FSP_FILE_CONTEXT *FsContext = FileObject->FsContext;
|
||||||
ACCESS_MASK GrantedAccess;
|
ACCESS_MASK GrantedAccess;
|
||||||
BOOLEAN Inserted = FALSE;
|
BOOLEAN Inserted = FALSE;
|
||||||
|
@ -263,6 +263,10 @@ PIRP FspIoqEndProcessingIrp(FSP_IOQ *Ioq, UINT_PTR IrpHint);
|
|||||||
/* I/O processing */
|
/* I/O processing */
|
||||||
#define FSP_FSCTL_WORK \
|
#define FSP_FSCTL_WORK \
|
||||||
CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 0x800 + 'W', METHOD_NEITHER, FILE_ANY_ACCESS)
|
CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 0x800 + 'W', METHOD_NEITHER, FILE_ANY_ACCESS)
|
||||||
|
#define FspIrpContextRequest(Irp) \
|
||||||
|
(*(FSP_FSCTL_TRANSACT_REQ **)&(Irp)->Tail.Overlay.DriverContext[0])
|
||||||
|
#define FspIrpContextHandle(Irp) \
|
||||||
|
(*(HANDLE *)&(Irp)->Tail.Overlay.DriverContext[1])
|
||||||
NTSTATUS FspIopCreateRequest(
|
NTSTATUS FspIopCreateRequest(
|
||||||
PIRP Irp, PUNICODE_STRING FileName, ULONG ExtraSize, FSP_FSCTL_TRANSACT_REQ **PRequest);
|
PIRP Irp, PUNICODE_STRING FileName, ULONG ExtraSize, FSP_FSCTL_TRANSACT_REQ **PRequest);
|
||||||
NTSTATUS FspIopPostWorkRequest(PDEVICE_OBJECT DeviceObject, FSP_FSCTL_TRANSACT_REQ *Request);
|
NTSTATUS FspIopPostWorkRequest(PDEVICE_OBJECT DeviceObject, FSP_FSCTL_TRANSACT_REQ *Request);
|
||||||
|
@ -391,7 +391,7 @@ retry:
|
|||||||
ASSERT((PUINT8)Request + FSP_FSCTL_TRANSACT_REQ_SIZEMAX <= SystemBufferEnd);
|
ASSERT((PUINT8)Request + FSP_FSCTL_TRANSACT_REQ_SIZEMAX <= SystemBufferEnd);
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
PendingIrpRequest = PendingIrp->Tail.Overlay.DriverContext[0];
|
PendingIrpRequest = FspIrpContextRequest(PendingIrp);
|
||||||
|
|
||||||
Result = FspIopDispatchPrepare(PendingIrp, PendingIrpRequest);
|
Result = FspIopDispatchPrepare(PendingIrp, PendingIrpRequest);
|
||||||
if (!NT_SUCCESS(Result))
|
if (!NT_SUCCESS(Result))
|
||||||
|
@ -42,7 +42,7 @@ static NTSTATUS FspFsvolInternalDeviceControl(
|
|||||||
|
|
||||||
/* associate the passed Request with our Irp; acquire ownership of the Request */
|
/* associate the passed Request with our Irp; acquire ownership of the Request */
|
||||||
Request->Hint = (UINT_PTR)Irp;
|
Request->Hint = (UINT_PTR)Irp;
|
||||||
Irp->Tail.Overlay.DriverContext[0] = Request;
|
FspIrpContextRequest(Irp) = Request;
|
||||||
|
|
||||||
if (!FspIoqPostIrp(&FsvrtDeviceExtension->Ioq, Irp))
|
if (!FspIoqPostIrp(&FsvrtDeviceExtension->Ioq, Irp))
|
||||||
{
|
{
|
||||||
@ -51,7 +51,7 @@ static NTSTATUS FspFsvolInternalDeviceControl(
|
|||||||
|
|
||||||
/* disocciate the Request from our Irp; release ownership back to caller */
|
/* disocciate the Request from our Irp; release ownership back to caller */
|
||||||
Request->Hint = 0;
|
Request->Hint = 0;
|
||||||
Irp->Tail.Overlay.DriverContext[0] = 0;
|
FspIrpContextRequest(Irp) = 0;
|
||||||
|
|
||||||
Result = STATUS_CANCELLED;
|
Result = STATUS_CANCELLED;
|
||||||
goto exit;
|
goto exit;
|
||||||
|
@ -58,7 +58,7 @@ NTSTATUS FspIopCreateRequest(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (0 != Irp)
|
if (0 != Irp)
|
||||||
Irp->Tail.Overlay.DriverContext[0] = Request;
|
FspIrpContextRequest(Irp) = Request;
|
||||||
*PRequest = Request;
|
*PRequest = Request;
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
@ -125,24 +125,24 @@ VOID FspIopCompleteIrpEx(PIRP Irp, NTSTATUS Result, BOOLEAN DeviceRelease)
|
|||||||
ASSERT(STATUS_PENDING != Result);
|
ASSERT(STATUS_PENDING != Result);
|
||||||
ASSERT(0 == Irp->Tail.Overlay.DriverContext[3]);
|
ASSERT(0 == Irp->Tail.Overlay.DriverContext[3]);
|
||||||
|
|
||||||
if (0 != Irp->Tail.Overlay.DriverContext[0])
|
if (0 != FspIrpContextRequest(Irp))
|
||||||
{
|
{
|
||||||
FspIopDeleteRequest(Irp->Tail.Overlay.DriverContext[0]);
|
FspIopDeleteRequest(FspIrpContextRequest(Irp));
|
||||||
Irp->Tail.Overlay.DriverContext[0] = 0;
|
FspIrpContextRequest(Irp) = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0 != Irp->Tail.Overlay.DriverContext[1])
|
if (0 != FspIrpContextHandle(Irp))
|
||||||
{
|
{
|
||||||
#if DBG
|
#if DBG
|
||||||
NTSTATUS Result0;
|
NTSTATUS Result0;
|
||||||
Result0 = ObCloseHandle(Irp->Tail.Overlay.DriverContext[1], KernelMode);
|
Result0 = ObCloseHandle(FspIrpContextHandle(Irp), KernelMode);
|
||||||
if (!NT_SUCCESS(Result0))
|
if (!NT_SUCCESS(Result0))
|
||||||
DEBUGLOG("ObCloseHandle() = %s", NtStatusSym(Result0));
|
DEBUGLOG("ObCloseHandle() = %s", NtStatusSym(Result0));
|
||||||
#else
|
#else
|
||||||
ObCloseHandle(Irp->Tail.Overlay.DriverContext[1], KernelMode);
|
ObCloseHandle(FspIrpContextHandle(Irp), KernelMode);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Irp->Tail.Overlay.DriverContext[1] = 0;
|
FspIrpContextHandle(Irp) = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
PDEVICE_OBJECT DeviceObject = IoGetCurrentIrpStackLocation(Irp)->DeviceObject;
|
PDEVICE_OBJECT DeviceObject = IoGetCurrentIrpStackLocation(Irp)->DeviceObject;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user