From 6363f7820dbe6a7a3b3f4e73d5e0bbc30d787a4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 29 Dec 2024 22:16:34 +0100 Subject: [PATCH] [NTOS:IO] Fix special case in IopQueryNameInternal() (#7592) CORE-13525 This case is invoked from NtQueryObject(ObjectNameInformation). --- ntoskrnl/io/iomgr/file.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ntoskrnl/io/iomgr/file.c b/ntoskrnl/io/iomgr/file.c index bfe11ab295b..865cd52fc78 100644 --- a/ntoskrnl/io/iomgr/file.c +++ b/ntoskrnl/io/iomgr/file.c @@ -2108,10 +2108,11 @@ IopQueryNameInternal(IN PVOID ObjectBody, _SEH2_LEAVE; } - /* In such case, zero output */ + /* In such case, zero the output and reset the status */ LocalReturnLength = FIELD_OFFSET(FILE_NAME_INFORMATION, FileName); LocalFileInfo->FileNameLength = 0; LocalFileInfo->FileName[0] = OBJ_NAME_PATH_SEPARATOR; + Status = STATUS_SUCCESS; } else {