From 4fe72ab332e2433236ea31811fa16b95e1ad658b Mon Sep 17 00:00:00 2001 From: Bill Zissimopoulos Date: Wed, 25 Jan 2017 10:51:37 -0800 Subject: [PATCH] sys,dll: ReadDirectory: add Marker, remove Offset --- inc/winfsp/winfsp.h | 13 ++++++------- src/dll/fsop.c | 4 ++-- src/dll/fuse/fuse_intf.c | 5 ++--- tst/memfs/memfs.cpp | 5 ++--- 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/inc/winfsp/winfsp.h b/inc/winfsp/winfsp.h index c5b5b664..e28cf0b1 100644 --- a/inc/winfsp/winfsp.h +++ b/inc/winfsp/winfsp.h @@ -647,10 +647,6 @@ typedef struct _FSP_FILE_SYSTEM_INTERFACE * The file system on which this request is posted. * @param FileContext * The file context of the directory to be read. - * @param Buffer - * Pointer to a buffer that will receive the results of the read operation. - * @param Length - * Length of data to read. * @param Pattern * The pattern to match against files in this directory. Can be NULL. The file system * can choose to ignore this parameter as the FSD will always perform its own pattern @@ -659,6 +655,10 @@ typedef struct _FSP_FILE_SYSTEM_INTERFACE * A file name that marks where in the directory to start reading. Files with names * that are greater than (not equal to) this marker (in the directory order determined * by the file system) should be returned. Can be NULL. + * @param Buffer + * Pointer to a buffer that will receive the results of the read operation. + * @param Length + * Length of data to read. * @param PBytesTransferred [out] * Pointer to a memory location that will receive the actual number of bytes read. * @return @@ -668,9 +668,8 @@ typedef struct _FSP_FILE_SYSTEM_INTERFACE * FspFileSystemAddDirInfo */ NTSTATUS (*ReadDirectory)(FSP_FILE_SYSTEM *FileSystem, - PVOID FileContext, PVOID Buffer, ULONG Length, - PWSTR Pattern, PWSTR Marker, - PULONG PBytesTransferred); + PVOID FileContext, PWSTR Pattern, PWSTR Marker, + PVOID Buffer, ULONG Length, PULONG PBytesTransferred); /** * Resolve reparse points. * diff --git a/src/dll/fsop.c b/src/dll/fsop.c index a5a2ed8c..18252ec0 100644 --- a/src/dll/fsop.c +++ b/src/dll/fsop.c @@ -1133,12 +1133,12 @@ FSP_API NTSTATUS FspFileSystemOpQueryDirectory(FSP_FILE_SYSTEM *FileSystem, BytesTransferred = 0; Result = FileSystem->Interface->ReadDirectory(FileSystem, (PVOID)ValOfFileContext(Request->Req.QueryDirectory), - (PVOID)Request->Req.QueryDirectory.Address, - Request->Req.QueryDirectory.Length, 0 != Request->Req.QueryDirectory.Pattern.Size ? (PWSTR)(Request->Buffer + Request->Req.QueryDirectory.Pattern.Offset) : 0, 0 != Request->Req.QueryDirectory.Marker.Size ? (PWSTR)(Request->Buffer + Request->Req.QueryDirectory.Marker.Offset) : 0, + (PVOID)Request->Req.QueryDirectory.Address, + Request->Req.QueryDirectory.Length, &BytesTransferred); if (!NT_SUCCESS(Result)) return Result; diff --git a/src/dll/fuse/fuse_intf.c b/src/dll/fuse/fuse_intf.c index a4b12f7f..e36277c5 100644 --- a/src/dll/fuse/fuse_intf.c +++ b/src/dll/fuse/fuse_intf.c @@ -1661,9 +1661,8 @@ int fsp_fuse_intf_AddDirInfoOld(fuse_dirh_t dh, const char *name, } static NTSTATUS fsp_fuse_intf_ReadDirectory(FSP_FILE_SYSTEM *FileSystem, - PVOID FileContext, PVOID Buffer, ULONG Length, - PWSTR Pattern, PWSTR Marker, - PULONG PBytesTransferred) + PVOID FileContext, PWSTR Pattern, PWSTR Marker, + PVOID Buffer, ULONG Length, PULONG PBytesTransferred) { return STATUS_INVALID_DEVICE_REQUEST; #if 0 diff --git a/tst/memfs/memfs.cpp b/tst/memfs/memfs.cpp index c32a96dc..3e6c33ef 100644 --- a/tst/memfs/memfs.cpp +++ b/tst/memfs/memfs.cpp @@ -1341,9 +1341,8 @@ static BOOLEAN ReadDirectoryEnumFn(MEMFS_FILE_NODE *FileNode, PVOID Context0) } static NTSTATUS ReadDirectory(FSP_FILE_SYSTEM *FileSystem, - PVOID FileNode0, PVOID Buffer, ULONG Length, - PWSTR Pattern, PWSTR Marker, - PULONG PBytesTransferred) + PVOID FileNode0, PWSTR Pattern, PWSTR Marker, + PVOID Buffer, ULONG Length, PULONG PBytesTransferred) { MEMFS *Memfs = (MEMFS *)FileSystem->UserContext; MEMFS_FILE_NODE *FileNode = (MEMFS_FILE_NODE *)FileNode0;