2003-02-02 16:57:49 +00:00
|
|
|
/*
|
2011-07-23 18:51:32 +00:00
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS Win32 Base API
|
|
|
|
* FILE: dll/win32/kernel32/client/perfcnt.c
|
|
|
|
* PURPOSE: Performance Counter
|
|
|
|
* PROGRAMMER: Eric Kohl
|
2003-02-02 16:57:49 +00:00
|
|
|
*/
|
|
|
|
|
2011-07-23 18:51:32 +00:00
|
|
|
/* INCLUDES *******************************************************************/
|
2003-02-02 16:57:49 +00:00
|
|
|
|
|
|
|
#include <k32.h>
|
|
|
|
|
|
|
|
#define NDEBUG
|
2007-09-02 19:42:22 +00:00
|
|
|
#include <debug.h>
|
2003-02-02 16:57:49 +00:00
|
|
|
|
2011-07-23 18:51:32 +00:00
|
|
|
/* FUNCTIONS ******************************************************************/
|
2003-02-02 16:57:49 +00:00
|
|
|
|
2003-07-10 18:50:51 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2011-07-23 18:51:32 +00:00
|
|
|
BOOL
|
|
|
|
WINAPI
|
|
|
|
QueryPerformanceCounter(OUT PLARGE_INTEGER lpPerformanceCount)
|
2003-02-02 16:57:49 +00:00
|
|
|
{
|
2011-07-23 18:51:32 +00:00
|
|
|
LARGE_INTEGER Frequency;
|
|
|
|
NTSTATUS Status;
|
|
|
|
|
|
|
|
Status = NtQueryPerformanceCounter(lpPerformanceCount, &Frequency);
|
|
|
|
if (!Frequency.QuadPart) Status = STATUS_NOT_IMPLEMENTED;
|
|
|
|
|
|
|
|
if (!NT_SUCCESS(Status))
|
|
|
|
{
|
2011-07-23 18:54:29 +00:00
|
|
|
BaseSetLastNTError(Status);
|
2011-07-23 18:51:32 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
2003-02-02 16:57:49 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 18:50:51 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2011-07-23 18:51:32 +00:00
|
|
|
BOOL
|
|
|
|
WINAPI
|
|
|
|
QueryPerformanceFrequency(OUT PLARGE_INTEGER lpFrequency)
|
2003-02-02 16:57:49 +00:00
|
|
|
{
|
2011-07-23 18:51:32 +00:00
|
|
|
LARGE_INTEGER Count;
|
|
|
|
NTSTATUS Status;
|
|
|
|
|
|
|
|
Status = NtQueryPerformanceCounter(&Count, lpFrequency);
|
|
|
|
if (!Count.QuadPart) Status = STATUS_NOT_IMPLEMENTED;
|
|
|
|
|
|
|
|
if (!NT_SUCCESS(Status))
|
|
|
|
{
|
2011-07-23 18:54:29 +00:00
|
|
|
BaseSetLastNTError(Status);
|
2011-07-23 18:51:32 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
2003-02-02 16:57:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* EOF */
|