mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-24 01:13:04 -05:00
sys: fsctl: WIP
This commit is contained in:
parent
2d98e2a42d
commit
f69b5f7864
@ -80,11 +80,19 @@
|
||||
NtStatusSym(Result), \
|
||||
!NT_SUCCESS(Result) ? 0 : Irp->IoStatus.Information);\
|
||||
if (STATUS_PENDING == Result) \
|
||||
{\
|
||||
ASSERT(FspFsvrtDeviceExtensionKind == FspDeviceExtension(DeviceObject)->Kind);\
|
||||
FspIoqPostIrp(&FspFsvrtDeviceExtension(DeviceObject)->Ioq, Irp);\
|
||||
/* also marks the IRP pending */\
|
||||
}\
|
||||
{ \
|
||||
if (0 == (IrpSp->Control & SL_PENDING_RETURNED))\
|
||||
{ \
|
||||
/* if the IRP has not been marked pending already */\
|
||||
ASSERT(FspFsvolDeviceExtensionKind == FspDeviceExtension(DeviceObject)->Kind);\
|
||||
FSP_FSVOL_DEVICE_EXTENSION *FsvolDeviceExtension =\
|
||||
FspFsvolDeviceExtension(DeviceObject);\
|
||||
FSP_FSVRT_DEVICE_EXTENSION *FsvrtDeviceExtension =\
|
||||
FspFsvrtDeviceExtension(FsvolDeviceExtension->FsvrtDeviceObject);\
|
||||
if (!FspIoqPostIrp(&FsvrtDeviceExtension->Ioq, Irp))\
|
||||
FspCompleteRequest(Irp, STATUS_ACCESS_DENIED);\
|
||||
} \
|
||||
} \
|
||||
else \
|
||||
FspCompleteRequest(Irp, Result);\
|
||||
); \
|
||||
@ -198,6 +206,7 @@ typedef struct
|
||||
typedef struct
|
||||
{
|
||||
FSP_DEVICE_EXTENSION Base;
|
||||
PDEVICE_OBJECT FsvrtDeviceObject;
|
||||
} FSP_FSVOL_DEVICE_EXTENSION;
|
||||
static inline
|
||||
FSP_DEVICE_EXTENSION *FspDeviceExtension(PDEVICE_OBJECT DeviceObject)
|
||||
|
@ -125,6 +125,9 @@ static NTSTATUS FspFsvrtTransact(
|
||||
|
||||
NTSTATUS Result;
|
||||
FSP_FSVRT_DEVICE_EXTENSION *FsvrtDeviceExtension = FspFsvrtDeviceExtension(DeviceObject);
|
||||
PUINT8 SystemBufferEnd;
|
||||
FSP_TRANSACT_RSP *Response;
|
||||
PIRP ProcessIrp;
|
||||
|
||||
/* access check */
|
||||
Result = FspSecuritySubjectContextAccessCheck(
|
||||
@ -132,7 +135,32 @@ static NTSTATUS FspFsvrtTransact(
|
||||
if (!NT_SUCCESS(Result))
|
||||
return Result;
|
||||
|
||||
return STATUS_INVALID_DEVICE_REQUEST;
|
||||
/* process any user-mode file system responses */
|
||||
Response = SystemBuffer;
|
||||
SystemBufferEnd = (PUINT8)SystemBuffer + InputBufferLength;
|
||||
for (;;)
|
||||
{
|
||||
if ((PUINT8)Response + sizeof(Response->Size) > SystemBufferEnd ||
|
||||
sizeof(FSP_TRANSACT_RSP) > Response->Size ||
|
||||
(PUINT8)Response + Response->Size > SystemBufferEnd)
|
||||
break;
|
||||
|
||||
ProcessIrp = FspIoqEndProcessingIrp(&FsvrtDeviceExtension->Ioq, Response->Hint);
|
||||
if (0 == ProcessIrp)
|
||||
/* either IRP was canceled or a bogus IrpHint was provided */
|
||||
continue;
|
||||
|
||||
//FspDispatchProcessedIrp(ProcessIrp, Response);
|
||||
|
||||
Response = (PVOID)((PUINT8)Response + Response->Size);
|
||||
}
|
||||
|
||||
if (FspIoqPostIrp(&FsvrtDeviceExtension->TransactIoq, Irp))
|
||||
Result = STATUS_PENDING;
|
||||
else
|
||||
Result = STATUS_ACCESS_DENIED;
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
||||
static NTSTATUS FspFsctlFileSystemControl(
|
||||
|
Loading…
x
Reference in New Issue
Block a user