Make return value to work like in Windows where given size must match for STATUS_SUCCESS result.
For more context/background info see !4832
From: Dāvis Mosāns davispuh@gmail.com
Make return value to work like in Windows where given size must match for STATUS_SUCCESS result.
Co-authored-by: Haltinulo --- dlls/ntdll/unix/system.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c index 879a5893758..ea296b1097e 100644 --- a/dlls/ntdll/unix/system.c +++ b/dlls/ntdll/unix/system.c @@ -2805,7 +2805,12 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class, if (size >= len) { if (!info) ret = STATUS_ACCESS_VIOLATION; - else memcpy( info, sppi, len); + else + { + memcpy( info, sppi, len ); + if (size != len) + ret = STATUS_INFO_LENGTH_MISMATCH; + } } else ret = STATUS_INFO_LENGTH_MISMATCH;
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=141840
Your paranoid android.
=== debian11 (32 bit report) ===
ntdll: info.c:769: Test failed: KernelTime changed info.c:770: Test failed: UserTime changed info.c:771: Test failed: IdleTime changed
=== debian11b (64 bit WoW report) ===
ntdll: info.c:769: Test failed: KernelTime changed info.c:770: Test failed: UserTime changed info.c:771: Test failed: IdleTime changed
It copies but then gives `STATUS_INFO_LENGTH_MISMATCH`? And returning `STATUS_ACCESS_VIOLATION` has priority over `STATUS_INFO_LENGTH_MISMATCH`? Not saying you're wrong, just wondering. Would you mind adding tests for that?