-- v2: ntdll: Stub NtQuerySystemInformation(SystemLeapSecondInformation).
From: Hans Leidekker hans@codeweavers.com
--- dlls/ntdll/tests/info.c | 13 +++++++++++++ dlls/ntdll/unix/system.c | 19 +++++++++++++++++++ 2 files changed, 32 insertions(+)
diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c index 7741293d815..48411fa9d6e 100644 --- a/dlls/ntdll/tests/info.c +++ b/dlls/ntdll/tests/info.c @@ -1094,6 +1094,11 @@ static void test_query_interrupt(void)
static void test_time_adjustment(void) { + struct + { + BOOLEAN enabled; + ULONG flags; + } leap; SYSTEM_TIME_ADJUSTMENT_QUERY query; SYSTEM_TIME_ADJUSTMENT adjust; NTSTATUS status; @@ -1124,6 +1129,14 @@ static void test_time_adjustment(void) status = pNtSetSystemInformation( SystemTimeAdjustmentInformation, &adjust, sizeof(adjust)+1 ); todo_wine ok( status == STATUS_INFO_LENGTH_MISMATCH, "got %08lx\n", status ); + + len = 0; + memset( &leap, 0xcc, sizeof(leap) ); + status = pNtQuerySystemInformation( SystemLeapSecondInformation, &leap, sizeof(leap), &len ); + ok( status == STATUS_SUCCESS, "got %08lx\n", status ); + ok( len == sizeof(leap), "wrong len %lu\n", len ); + ok( leap.enabled == 1, "got %u\n", leap.enabled ); + ok( !leap.flags, "got %lx\n", leap.flags ); }
static void test_query_kerndebug(void) diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c index bfe59d4cf7e..3007a9b9f6f 100644 --- a/dlls/ntdll/unix/system.c +++ b/dlls/ntdll/unix/system.c @@ -3664,6 +3664,25 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class, case SystemCpuSetInformation: /* 175 */ return NtQuerySystemInformationEx(class, NULL, 0, info, size, ret_size);
+ case SystemLeapSecondInformation: /* 206 */ + { + struct + { + BOOLEAN enabled; + ULONG flags; + } *leap = info; + + len = sizeof(*leap); + if (size >= len) + { + FIXME( "SystemLeapSecondInformation - stub\n" ); + leap->enabled = 1; + leap->flags = 0; + } + else ret = STATUS_INFO_LENGTH_MISMATCH; + break; + } + /* Wine extensions */
case SystemWineVersionInformation: /* 1000 */
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=151160
Your paranoid android.
=== w7u_2qxl (32 bit report) ===
ntdll: info.c:1136: Test failed: got c0000003 info.c:1137: Test failed: wrong len 0 info.c:1138: Test failed: got 204 info.c:1139: Test failed: got cccccccc
=== w7u_adm (32 bit report) ===
ntdll: info.c:1136: Test failed: got c0000003 info.c:1137: Test failed: wrong len 0 info.c:1138: Test failed: got 204 info.c:1139: Test failed: got cccccccc
=== w7u_el (32 bit report) ===
ntdll: info.c:1136: Test failed: got c0000003 info.c:1137: Test failed: wrong len 0 info.c:1138: Test failed: got 204 info.c:1139: Test failed: got cccccccc
=== w8 (32 bit report) ===
ntdll: info.c:1136: Test failed: got c0000003 info.c:1137: Test failed: wrong len 0 info.c:1138: Test failed: got 204 info.c:1139: Test failed: got cccccccc
=== w8adm (32 bit report) ===
ntdll: info.c:1136: Test failed: got c0000003 info.c:1137: Test failed: wrong len 0 info.c:1138: Test failed: got 204 info.c:1139: Test failed: got cccccccc
=== w864 (32 bit report) ===
ntdll: info.c:1136: Test failed: got c0000003 info.c:1137: Test failed: wrong len 0 info.c:1138: Test failed: got 204 info.c:1139: Test failed: got cccccccc
=== w1064v1507 (32 bit report) ===
ntdll: info.c:1136: Test failed: got c0000003 info.c:1137: Test failed: wrong len 0 info.c:1138: Test failed: got 204 info.c:1139: Test failed: got cccccccc
=== w7pro64 (64 bit report) ===
ntdll: info.c:1136: Test failed: got c0000003 info.c:1137: Test failed: wrong len 0 info.c:1138: Test failed: got 204 info.c:1139: Test failed: got cccccccc
=== w864 (64 bit report) ===
ntdll: info.c:1136: Test failed: got c0000003 info.c:1137: Test failed: wrong len 0 info.c:1138: Test failed: got 204 info.c:1139: Test failed: got cccccccc
=== w1064v1507 (64 bit report) ===
ntdll: info.c:1136: Test failed: got c0000003 info.c:1137: Test failed: wrong len 0 info.c:1138: Test failed: got 204 info.c:1139: Test failed: got cccccccc
=== debian11b (64 bit WoW report) ===
user32: input.c:4306: Test succeeded inside todo block: button_down_hwnd_todo 1: got MSG_TEST_WIN hwnd 0000000000C500EE, msg WM_LBUTTONDOWN, wparam 0x1, lparam 0x320032
Report validation errors: d3d11:d3d11 crashed (c0000005)
Jinoh Kang (@iamahuman) commented about dlls/ntdll/unix/system.c:
case SystemCpuSetInformation: /* 175 */ return NtQuerySystemInformationEx(class, NULL, 0, info, size, ret_size);
- case SystemLeapSecondInformation: /* 206 */
- {
struct
{
BOOLEAN enabled;
ULONG flags;
} *leap = info;
len = sizeof(*leap);
if (size >= len)
{
FIXME( "SystemLeapSecondInformation - stub\n" );
leap->enabled = 1;
Since it's BOOLEAN:
```suggestion:-0+0 leap->enabled = TRUE; ```
Jinoh Kang (@iamahuman) commented about dlls/ntdll/unix/system.c:
case SystemCpuSetInformation: /* 175 */ return NtQuerySystemInformationEx(class, NULL, 0, info, size, ret_size);
- case SystemLeapSecondInformation: /* 206 */
- {
struct
{
BOOLEAN enabled;
ULONG flags;
} *leap = info;
len = sizeof(*leap);
if (size >= len)
{
FIXME( "SystemLeapSecondInformation - stub\n" );
Can you pull this FIXME out of this if statement so it's printed unconditionally?
(Otherwise, I'd like some tests for `STATUS_INFO_LENGTH_MISMATCH` case. Thanks!)
On Thu Jan 30 15:01:11 2025 +0000, Jinoh Kang wrote:
Can you pull this FIXME out of this if statement so it's printed unconditionally? (Otherwise, I'd like some tests for `STATUS_INFO_LENGTH_MISMATCH` case. Thanks!)
(That question mark was a typo, my apologies. Feel free to disregard this review, since I'm not maintaining here.)
I believe the case should also be added to `wow64_NtQuerySystemInformation`.
Where did you find the SYSTEM_LEAP_SECOND_INFORMATION definition? It's not in the SDK I have here but perhaps there's a newer version.
On Mon Feb 3 09:57:21 2025 +0000, Hans Leidekker wrote:
Where did you find the SYSTEM_LEAP_SECOND_INFORMATION definition? It's not in the SDK I have here but perhaps there's a newer version.
https://github.com/dotnet/runtime/blob/main/src/libraries/Common/src/Interop...
and
https://learn.microsoft.com/en-us/windows/win32/api/winternl/nf-winternl-ntq...