From 2c3800077f9efad42ead3c2e8aa78024f5481f8e Mon Sep 17 00:00:00 2001 From: Bill Zissimopoulos Date: Mon, 26 Sep 2022 17:26:25 +0100 Subject: [PATCH] tst: passthrough: GetFileInfoInternal: fix IndexNumber --- doc/WinFsp-Tutorial.asciidoc | 3 ++- tst/passthrough/passthrough.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/WinFsp-Tutorial.asciidoc b/doc/WinFsp-Tutorial.asciidoc index bf2c20a6..b792f6b6 100644 --- a/doc/WinFsp-Tutorial.asciidoc +++ b/doc/WinFsp-Tutorial.asciidoc @@ -538,7 +538,8 @@ static NTSTATUS GetFileInfoInternal(HANDLE Handle, FSP_FSCTL_FILE_INFO *FileInfo FileInfo->LastAccessTime = ((PLARGE_INTEGER)&ByHandleFileInfo.ftLastAccessTime)->QuadPart; FileInfo->LastWriteTime = ((PLARGE_INTEGER)&ByHandleFileInfo.ftLastWriteTime)->QuadPart; FileInfo->ChangeTime = FileInfo->LastWriteTime; - FileInfo->IndexNumber = 0; + FileInfo->IndexNumber = + ((UINT64)ByHandleFileInfo.nFileIndexHigh << 32) | (UINT64)ByHandleFileInfo.nFileIndexLow; FileInfo->HardLinks = 0; return STATUS_SUCCESS; diff --git a/tst/passthrough/passthrough.c b/tst/passthrough/passthrough.c index 0ba05ee9..c0c4122b 100644 --- a/tst/passthrough/passthrough.c +++ b/tst/passthrough/passthrough.c @@ -62,7 +62,8 @@ static NTSTATUS GetFileInfoInternal(HANDLE Handle, FSP_FSCTL_FILE_INFO *FileInfo FileInfo->LastAccessTime = ((PLARGE_INTEGER)&ByHandleFileInfo.ftLastAccessTime)->QuadPart; FileInfo->LastWriteTime = ((PLARGE_INTEGER)&ByHandleFileInfo.ftLastWriteTime)->QuadPart; FileInfo->ChangeTime = FileInfo->LastWriteTime; - FileInfo->IndexNumber = 0; + FileInfo->IndexNumber = + ((UINT64)ByHandleFileInfo.nFileIndexHigh << 32) | (UINT64)ByHandleFileInfo.nFileIndexLow; FileInfo->HardLinks = 0; return STATUS_SUCCESS;