[PATCH] ntdll: Fix the return value of NtQueryKey.
杨堃
yangkun at uniontech.com
Tue Jun 14 03:18:29 CDT 2022
From bc084bfcf6c342e483f77090593261ac76b6f513 Mon Sep 17 00:00:00 2001
From: Kun Yang <yangkun at uniontech.com>
Date: Tue, 14 Jun 2022 16:16:53 +0800
Subject: [PATCH] ntdll: Fix the return value of NtQueryKey.
Signed-off-by: Kun Yang <yangkun at uniontech.com>
---
dlls/ntdll/tests/reg.c | 2 +-
dlls/ntdll/unix/registry.c | 7 ++++++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/tests/reg.c b/dlls/ntdll/tests/reg.c
index 2c158be17b4..ab6f7914e4b 100644
--- a/dlls/ntdll/tests/reg.c
+++ b/dlls/ntdll/tests/reg.c
@@ -1831,7 +1831,7 @@ static void test_NtQueryKey(void)
pNtClose(key);
return;
}
- todo_wine ok(status == STATUS_BUFFER_TOO_SMALL, "NtQueryKey Failed: 0x%08lx\n", status);
+ ok(status == STATUS_BUFFER_TOO_SMALL, "NtQueryKey Failed: 0x%08lx\n", status);
info = HeapAlloc(GetProcessHeap(), 0, length);
/* non-zero buffer size, but insufficient */
diff --git a/dlls/ntdll/unix/registry.c b/dlls/ntdll/unix/registry.c
index 6628454440a..767fa36302d 100644
--- a/dlls/ntdll/unix/registry.c
+++ b/dlls/ntdll/unix/registry.c
@@ -321,7 +321,12 @@ static NTSTATUS enumerate_key( HANDLE handle, int index, KEY_INFORMATION_CLASS i
break;
}
*result_len = fixed_size + reply->total;
- if (length < *result_len) ret = STATUS_BUFFER_OVERFLOW;
+ if (length < *result_len){
+ if(min(length, fixed_size) == 0)
+ ret = STATUS_BUFFER_TOO_SMALL;
+ else
+ ret = STATUS_BUFFER_OVERFLOW;
+ }
}
}
SERVER_END_REQ;
--
2.20.1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ntdll-Fix-the-return-value-of-NtQueryKey.patch
Type: application/octet-stream
Size: 1648 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20220614/e67a12d1/attachment.obj>
More information about the wine-devel
mailing list