Commit 78c772e9 authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Use a syscall thunk for NtQueryPerformanceCounter().

parent 4752e252
......@@ -307,7 +307,7 @@
@ stdcall -syscall NtQueryMutant(long long ptr long ptr)
@ stdcall -syscall NtQueryObject(long long ptr long ptr)
@ stub NtQueryOpenSubKeys
@ stdcall NtQueryPerformanceCounter(ptr ptr)
@ stdcall -syscall NtQueryPerformanceCounter(ptr ptr)
# @ stub NtQueryPortInformationProcess
# @ stub NtQueryQuotaInformationFile
@ stdcall -syscall NtQuerySection(long long ptr long ptr)
......@@ -1295,7 +1295,7 @@
@ stdcall -private -syscall ZwQueryMutant(long long ptr long ptr) NtQueryMutant
@ stdcall -private -syscall ZwQueryObject(long long ptr long ptr) NtQueryObject
@ stub ZwQueryOpenSubKeys
@ stdcall -private ZwQueryPerformanceCounter(ptr ptr) NtQueryPerformanceCounter
@ stdcall -private -syscall ZwQueryPerformanceCounter(ptr ptr) NtQueryPerformanceCounter
# @ stub ZwQueryPortInformationProcess
# @ stub ZwQueryQuotaInformationFile
@ stdcall -private -syscall ZwQuerySection(long long ptr long ptr) NtQuerySection
......
......@@ -376,30 +376,11 @@ LONGLONG WINAPI RtlGetSystemTimePrecise( void )
}
/******************************************************************************
* NtQueryPerformanceCounter [NTDLL.@]
*/
NTSTATUS WINAPI NtQueryPerformanceCounter( LARGE_INTEGER *counter, LARGE_INTEGER *frequency )
{
NTSTATUS status;
__TRY
{
status = unix_funcs->NtQueryPerformanceCounter( counter, frequency );
}
__EXCEPT_PAGE_FAULT
{
return STATUS_ACCESS_VIOLATION;
}
__ENDTRY
return status;
}
/******************************************************************************
* RtlQueryPerformanceCounter [NTDLL.@]
*/
BOOL WINAPI DECLSPEC_HOTPATCH RtlQueryPerformanceCounter( LARGE_INTEGER *counter )
{
unix_funcs->NtQueryPerformanceCounter( counter, NULL );
NtQueryPerformanceCounter( counter, NULL );
return TRUE;
}
......
......@@ -1362,7 +1362,6 @@ static struct unix_funcs unix_funcs =
{
NtCurrentTeb,
NtGetContextThread,
NtQueryPerformanceCounter,
DbgUiIssueRemoteBreakin,
RtlGetSystemTimePrecise,
RtlWaitOnAddress,
......
......@@ -69,6 +69,7 @@
#include "winternl.h"
#include "ddk/wdm.h"
#include "wine/server.h"
#include "wine/exception.h"
#include "wine/debug.h"
#include "unix_private.h"
......@@ -1361,8 +1362,16 @@ NTSTATUS WINAPI NtDelayExecution( BOOLEAN alertable, const LARGE_INTEGER *timeou
*/
NTSTATUS WINAPI NtQueryPerformanceCounter( LARGE_INTEGER *counter, LARGE_INTEGER *frequency )
{
__TRY
{
counter->QuadPart = monotonic_counter();
if (frequency) frequency->QuadPart = TICKSPERSEC;
}
__EXCEPT_PAGE_FAULT
{
return STATUS_ACCESS_VIOLATION;
}
__ENDTRY
return STATUS_SUCCESS;
}
......
......@@ -28,14 +28,13 @@ struct msghdr;
struct _DISPATCHER_CONTEXT;
/* increment this when you change the function table */
#define NTDLL_UNIXLIB_VERSION 89
#define NTDLL_UNIXLIB_VERSION 90
struct unix_funcs
{
/* Nt* functions */
TEB * (WINAPI *NtCurrentTeb)(void);
NTSTATUS (WINAPI *NtGetContextThread)( HANDLE handle, CONTEXT *context );
NTSTATUS (WINAPI *NtQueryPerformanceCounter)( LARGE_INTEGER *counter, LARGE_INTEGER *frequency );
/* other Win32 API functions */
NTSTATUS (WINAPI *DbgUiIssueRemoteBreakin)( HANDLE process );
......
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