mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-23 17:03:12 -05:00
sys: IRP_MN_QUERY_DIRECTORY: prep work to handle non-NULL Irp->MdlAddress
This commit is contained in:
parent
23dadcf8a0
commit
3cfa4156d2
@ -71,7 +71,7 @@ FSP_DRIVER_DISPATCH FspDirectoryControl;
|
|||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
/* QueryDirectory */
|
/* QueryDirectory */
|
||||||
RequestFileNode = 0,
|
RequestIrp = 0,
|
||||||
RequestMdl = 1,
|
RequestMdl = 1,
|
||||||
RequestAddress = 2,
|
RequestAddress = 2,
|
||||||
RequestProcess = 3,
|
RequestProcess = 3,
|
||||||
@ -348,7 +348,7 @@ static NTSTATUS FspFsvolQueryDirectoryCopyInPlace(
|
|||||||
UINT64 DirectoryOffset = FileDesc->DirectoryOffset;
|
UINT64 DirectoryOffset = FileDesc->DirectoryOffset;
|
||||||
|
|
||||||
ASSERT(DirInfo == DestBuf);
|
ASSERT(DirInfo == DestBuf);
|
||||||
static_assert(
|
FSP_FSCTL_STATIC_ASSERT(
|
||||||
FIELD_OFFSET(FSP_FSCTL_DIR_INFO, FileNameBuf) >=
|
FIELD_OFFSET(FSP_FSCTL_DIR_INFO, FileNameBuf) >=
|
||||||
FIELD_OFFSET(FILE_ID_BOTH_DIR_INFORMATION, FileName),
|
FIELD_OFFSET(FILE_ID_BOTH_DIR_INFORMATION, FileName),
|
||||||
"FSP_FSCTL_DIR_INFO must be bigger than FILE_ID_BOTH_DIR_INFORMATION");
|
"FSP_FSCTL_DIR_INFO must be bigger than FILE_ID_BOTH_DIR_INFORMATION");
|
||||||
@ -588,7 +588,7 @@ static NTSTATUS FspFsvolQueryDirectoryRetry(
|
|||||||
}
|
}
|
||||||
|
|
||||||
FspFileNodeSetOwner(FileNode, Full, Request);
|
FspFileNodeSetOwner(FileNode, Full, Request);
|
||||||
FspIopRequestContext(Request, RequestFileNode) = FileNode;
|
FspIopRequestContext(Request, RequestIrp) = Irp;
|
||||||
|
|
||||||
return FSP_STATUS_IOQ_POST;
|
return FSP_STATUS_IOQ_POST;
|
||||||
|
|
||||||
@ -942,7 +942,7 @@ NTSTATUS FspFsvolDirectoryControlComplete(
|
|||||||
Request->Req.QueryDirectory.Offset = FileDesc->DirectoryOffset;
|
Request->Req.QueryDirectory.Offset = FileDesc->DirectoryOffset;
|
||||||
|
|
||||||
FspFileNodeSetOwner(FileNode, Full, Request);
|
FspFileNodeSetOwner(FileNode, Full, Request);
|
||||||
FspIopRequestContext(Request, RequestFileNode) = FileNode;
|
FspIopRequestContext(Request, RequestIrp) = Irp;
|
||||||
|
|
||||||
FspIoqPostIrp(FsvolDeviceExtension->Ioq, Irp, &Result);
|
FspIoqPostIrp(FsvolDeviceExtension->Ioq, Irp, &Result);
|
||||||
}
|
}
|
||||||
@ -964,7 +964,7 @@ static VOID FspFsvolQueryDirectoryRequestFini(FSP_FSCTL_TRANSACT_REQ *Request, P
|
|||||||
{
|
{
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
FSP_FILE_NODE *FileNode = Context[RequestFileNode];
|
PIRP Irp = Context[RequestIrp];
|
||||||
PMDL Mdl = Context[RequestMdl];
|
PMDL Mdl = Context[RequestMdl];
|
||||||
PVOID Address = Context[RequestAddress];
|
PVOID Address = Context[RequestAddress];
|
||||||
PEPROCESS Process = Context[RequestProcess];
|
PEPROCESS Process = Context[RequestProcess];
|
||||||
@ -989,8 +989,13 @@ static VOID FspFsvolQueryDirectoryRequestFini(FSP_FSCTL_TRANSACT_REQ *Request, P
|
|||||||
if (0 != Mdl)
|
if (0 != Mdl)
|
||||||
IoFreeMdl(Mdl);
|
IoFreeMdl(Mdl);
|
||||||
|
|
||||||
if (0 != FileNode)
|
if (0 != Irp)
|
||||||
|
{
|
||||||
|
PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation(Irp);
|
||||||
|
FSP_FILE_NODE *FileNode = IrpSp->FileObject->FsContext;
|
||||||
|
|
||||||
FspFileNodeReleaseOwner(FileNode, Full, Request);
|
FspFileNodeReleaseOwner(FileNode, Full, Request);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS FspDirectoryControl(
|
NTSTATUS FspDirectoryControl(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user