ntdll: Fix RtlQueryUnbiasedInterruptTime() prototype.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48239
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2019-12-16 18:44:07 +01:00
parent 6233add310
commit 8b0a7b2503
3 changed files with 43 additions and 3 deletions

View File

@ -1027,6 +1027,38 @@ static void test_GetTickCount(void)
ok(t2 <= t3, "out of order %d %d\n", t2, t3);
}
BOOL (WINAPI *pQueryUnbiasedInterruptTime)(ULONGLONG *time);
BOOL (WINAPI *pRtlQueryUnbiasedInterruptTime)(ULONGLONG *time);
static void test_QueryUnbiasedInterruptTime(void)
{
ULONGLONG time;
BOOL ret;
if (pQueryUnbiasedInterruptTime)
{
SetLastError( 0xdeadbeef );
ret = pQueryUnbiasedInterruptTime( &time );
ok( ret, "QueryUnbiasedInterruptTime failed err %u\n", GetLastError() );
SetLastError( 0xdeadbeef );
ret = pQueryUnbiasedInterruptTime( NULL );
ok( !ret, "QueryUnbiasedInterruptTime succeeded\n" );
ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
}
else win_skip( "QueryUnbiasedInterruptTime not supported\n" );
if (pRtlQueryUnbiasedInterruptTime)
{
SetLastError( 0xdeadbeef );
ret = pRtlQueryUnbiasedInterruptTime( &time );
ok( ret, "RtlQueryUnbiasedInterruptTime failed err %u\n", GetLastError() );
SetLastError( 0xdeadbeef );
ret = pRtlQueryUnbiasedInterruptTime( NULL );
ok( !ret, "RtlQueryUnbiasedInterruptTime succeeded\n" );
ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() );
}
else win_skip( "RtlQueryUnbiasedInterruptTime not supported\n" );
}
START_TEST(time)
{
HMODULE hKernel = GetModuleHandleA("kernel32");
@ -1039,7 +1071,9 @@ START_TEST(time)
pGetDynamicTimeZoneInformation = (void *)GetProcAddress(hKernel, "GetDynamicTimeZoneInformation");
pGetSystemTimePreciseAsFileTime = (void *)GetProcAddress(hKernel, "GetSystemTimePreciseAsFileTime");
pGetTimeZoneInformationForYear = (void *)GetProcAddress(hKernel, "GetTimeZoneInformationForYear");
pQueryUnbiasedInterruptTime = (void *)GetProcAddress(hKernel, "QueryUnbiasedInterruptTime");
pNtGetTickCount = (void *)GetProcAddress(hntdll, "NtGetTickCount");
pRtlQueryUnbiasedInterruptTime = (void *)GetProcAddress(hntdll, "RtlQueryUnbiasedInterruptTime");
test_conversions();
test_invalid_arg();
@ -1055,4 +1089,5 @@ START_TEST(time)
test_GetSystemTimePreciseAsFileTime();
test_GetTimeZoneInformationForYear();
test_GetTickCount();
test_QueryUnbiasedInterruptTime();
}

View File

@ -1121,8 +1121,13 @@ NTSTATUS WINAPI NtSetSystemTime(const LARGE_INTEGER *NewTime, LARGE_INTEGER *Old
/***********************************************************************
* RtlQueryUnbiasedInterruptTime [NTDLL.@]
*/
NTSTATUS WINAPI RtlQueryUnbiasedInterruptTime(ULONGLONG *time)
BOOL WINAPI RtlQueryUnbiasedInterruptTime(ULONGLONG *time)
{
if (!time)
{
RtlSetLastWin32ErrorAndNtStatusFromNtStatus( STATUS_INVALID_PARAMETER );
return FALSE;
}
*time = monotonic_counter();
return STATUS_SUCCESS;
return TRUE;
}

View File

@ -2849,7 +2849,7 @@ NTSYSAPI BOOL WINAPI RtlQueryPerformanceFrequency(LARGE_INTEGER*);
NTSYSAPI NTSTATUS WINAPI RtlQueryProcessDebugInformation(ULONG,ULONG,PDEBUG_BUFFER);
NTSYSAPI NTSTATUS WINAPI RtlQueryRegistryValues(ULONG, PCWSTR, PRTL_QUERY_REGISTRY_TABLE, PVOID, PVOID);
NTSYSAPI NTSTATUS WINAPI RtlQueryTimeZoneInformation(RTL_TIME_ZONE_INFORMATION*);
NTSYSAPI NTSTATUS WINAPI RtlQueryUnbiasedInterruptTime(ULONGLONG*);
NTSYSAPI BOOL WINAPI RtlQueryUnbiasedInterruptTime(ULONGLONG*);
NTSYSAPI NTSTATUS WINAPI RtlQueueWorkItem(PRTL_WORK_ITEM_ROUTINE,PVOID,ULONG);
NTSYSAPI void WINAPI RtlRaiseException(PEXCEPTION_RECORD);
NTSYSAPI void WINAPI RtlRaiseStatus(NTSTATUS);