reactos/dll/win32/kernel32/misc/perfcnt.c
Amine Khaldi c424146e2c Create a branch for cmake bringup.
svn path=/branches/cmake-bringup/; revision=48236
2010-07-24 18:52:44 +00:00

73 lines
1.3 KiB
C

/* $Id$ */
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib/kernel32/misc/perfcnt.c
* PURPOSE: Performance counter
* PROGRAMMER: Eric Kohl
*/
/* INCLUDES *****************************************************************/
#include <k32.h>
#define NDEBUG
#include <debug.h>
/* FUNCTIONS ****************************************************************/
/*
* @implemented
*/
BOOL WINAPI
QueryPerformanceCounter(LARGE_INTEGER *lpPerformanceCount)
{
LARGE_INTEGER Frequency;
NTSTATUS Status;
Status = NtQueryPerformanceCounter(lpPerformanceCount,
&Frequency);
if (!NT_SUCCESS(Status))
{
SetLastErrorByStatus(Status);
return(FALSE);
}
if (Frequency.QuadPart == 0ULL)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return(FALSE);
}
return(TRUE);
}
/*
* @implemented
*/
BOOL WINAPI
QueryPerformanceFrequency(LARGE_INTEGER *lpFrequency)
{
LARGE_INTEGER Count;
NTSTATUS Status;
Status = NtQueryPerformanceCounter(&Count,
lpFrequency);
if (!NT_SUCCESS(Status))
{
SetLastErrorByStatus(Status);
return(FALSE);
}
if (lpFrequency->QuadPart == 0ULL)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return(FALSE);
}
return(TRUE);
}
/* EOF */