ReactOS 0.4.15-dev-6679-g945ee4b
perfcnt.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Win32 Base API
4 * FILE: dll/win32/kernel32/client/perfcnt.c
5 * PURPOSE: Performance Counter
6 * PROGRAMMER: Eric Kohl
7 */
8
9/* INCLUDES *******************************************************************/
10
11#include <k32.h>
12
13#define NDEBUG
14#include <debug.h>
15
16/* FUNCTIONS ******************************************************************/
17
18/*
19 * @implemented
20 */
21BOOL
24{
27
28 Status = NtQueryPerformanceCounter(lpPerformanceCount, &Frequency);
30
31 if (!NT_SUCCESS(Status))
32 {
34 return FALSE;
35 }
36
37 return TRUE;
38}
39
40/*
41 * @implemented
42 */
43BOOL
46{
49
50 Status = NtQueryPerformanceCounter(&Count, lpFrequency);
51 if (lpFrequency->QuadPart == 0) Status = STATUS_NOT_IMPLEMENTED;
52
53 if (!NT_SUCCESS(Status))
54 {
56 return FALSE;
57 }
58
59 return TRUE;
60}
61
62/* EOF */
LONG NTSTATUS
Definition: precomp.h:26
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
BOOL WINAPI QueryPerformanceFrequency(OUT PLARGE_INTEGER lpFrequency)
Definition: perfcnt.c:45
BOOL WINAPI QueryPerformanceCounter(OUT PLARGE_INTEGER lpPerformanceCount)
Definition: perfcnt.c:23
unsigned int BOOL
Definition: ntddk_ex.h:94
Status
Definition: gdiplustypes.h:25
int Count
Definition: noreturn.cpp:7
NTSTATUS NTAPI NtQueryPerformanceCounter(OUT PLARGE_INTEGER PerformanceCounter, OUT PLARGE_INTEGER PerformanceFrequency OPTIONAL)
Definition: profile.c:272
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:239
DWORD BaseSetLastNTError(IN NTSTATUS Status)
Definition: reactos.cpp:166
static LARGE_INTEGER Frequency
Definition: clock.c:41
#define OUT
Definition: typedefs.h:40
LONGLONG QuadPart
Definition: typedefs.h:114
#define WINAPI
Definition: msvc.h:6