Commit 8b0a7b25 authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Fix RtlQueryUnbiasedInterruptTime() prototype.

parent 6233add3
...@@ -1027,6 +1027,38 @@ static void test_GetTickCount(void) ...@@ -1027,6 +1027,38 @@ static void test_GetTickCount(void)
ok(t2 <= t3, "out of order %d %d\n", t2, t3); 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) START_TEST(time)
{ {
HMODULE hKernel = GetModuleHandleA("kernel32"); HMODULE hKernel = GetModuleHandleA("kernel32");
...@@ -1039,7 +1071,9 @@ START_TEST(time) ...@@ -1039,7 +1071,9 @@ START_TEST(time)
pGetDynamicTimeZoneInformation = (void *)GetProcAddress(hKernel, "GetDynamicTimeZoneInformation"); pGetDynamicTimeZoneInformation = (void *)GetProcAddress(hKernel, "GetDynamicTimeZoneInformation");
pGetSystemTimePreciseAsFileTime = (void *)GetProcAddress(hKernel, "GetSystemTimePreciseAsFileTime"); pGetSystemTimePreciseAsFileTime = (void *)GetProcAddress(hKernel, "GetSystemTimePreciseAsFileTime");
pGetTimeZoneInformationForYear = (void *)GetProcAddress(hKernel, "GetTimeZoneInformationForYear"); pGetTimeZoneInformationForYear = (void *)GetProcAddress(hKernel, "GetTimeZoneInformationForYear");
pQueryUnbiasedInterruptTime = (void *)GetProcAddress(hKernel, "QueryUnbiasedInterruptTime");
pNtGetTickCount = (void *)GetProcAddress(hntdll, "NtGetTickCount"); pNtGetTickCount = (void *)GetProcAddress(hntdll, "NtGetTickCount");
pRtlQueryUnbiasedInterruptTime = (void *)GetProcAddress(hntdll, "RtlQueryUnbiasedInterruptTime");
test_conversions(); test_conversions();
test_invalid_arg(); test_invalid_arg();
...@@ -1055,4 +1089,5 @@ START_TEST(time) ...@@ -1055,4 +1089,5 @@ START_TEST(time)
test_GetSystemTimePreciseAsFileTime(); test_GetSystemTimePreciseAsFileTime();
test_GetTimeZoneInformationForYear(); test_GetTimeZoneInformationForYear();
test_GetTickCount(); test_GetTickCount();
test_QueryUnbiasedInterruptTime();
} }
...@@ -1121,8 +1121,13 @@ NTSTATUS WINAPI NtSetSystemTime(const LARGE_INTEGER *NewTime, LARGE_INTEGER *Old ...@@ -1121,8 +1121,13 @@ NTSTATUS WINAPI NtSetSystemTime(const LARGE_INTEGER *NewTime, LARGE_INTEGER *Old
/*********************************************************************** /***********************************************************************
* RtlQueryUnbiasedInterruptTime [NTDLL.@] * RtlQueryUnbiasedInterruptTime [NTDLL.@]
*/ */
NTSTATUS WINAPI RtlQueryUnbiasedInterruptTime(ULONGLONG *time) BOOL WINAPI RtlQueryUnbiasedInterruptTime(ULONGLONG *time)
{ {
if (!time)
{
RtlSetLastWin32ErrorAndNtStatusFromNtStatus( STATUS_INVALID_PARAMETER );
return FALSE;
}
*time = monotonic_counter(); *time = monotonic_counter();
return STATUS_SUCCESS; return TRUE;
} }
...@@ -2849,7 +2849,7 @@ NTSYSAPI BOOL WINAPI RtlQueryPerformanceFrequency(LARGE_INTEGER*); ...@@ -2849,7 +2849,7 @@ NTSYSAPI BOOL WINAPI RtlQueryPerformanceFrequency(LARGE_INTEGER*);
NTSYSAPI NTSTATUS WINAPI RtlQueryProcessDebugInformation(ULONG,ULONG,PDEBUG_BUFFER); NTSYSAPI NTSTATUS WINAPI RtlQueryProcessDebugInformation(ULONG,ULONG,PDEBUG_BUFFER);
NTSYSAPI NTSTATUS WINAPI RtlQueryRegistryValues(ULONG, PCWSTR, PRTL_QUERY_REGISTRY_TABLE, PVOID, PVOID); NTSYSAPI NTSTATUS WINAPI RtlQueryRegistryValues(ULONG, PCWSTR, PRTL_QUERY_REGISTRY_TABLE, PVOID, PVOID);
NTSYSAPI NTSTATUS WINAPI RtlQueryTimeZoneInformation(RTL_TIME_ZONE_INFORMATION*); 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 NTSTATUS WINAPI RtlQueueWorkItem(PRTL_WORK_ITEM_ROUTINE,PVOID,ULONG);
NTSYSAPI void WINAPI RtlRaiseException(PEXCEPTION_RECORD); NTSYSAPI void WINAPI RtlRaiseException(PEXCEPTION_RECORD);
NTSYSAPI void WINAPI RtlRaiseStatus(NTSTATUS); NTSYSAPI void WINAPI RtlRaiseStatus(NTSTATUS);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment