ReactOS  0.4.13-dev-92-gf251225
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  */
21 BOOL
22 WINAPI
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  */
43 BOOL
44 WINAPI
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 */
#define TRUE
Definition: types.h:120
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS NTAPI NtQueryPerformanceCounter(OUT PLARGE_INTEGER PerformanceCounter, OUT PLARGE_INTEGER PerformanceFrequency OPTIONAL)
Definition: profile.c:278
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI QueryPerformanceFrequency(OUT PLARGE_INTEGER lpFrequency)
Definition: perfcnt.c:45
DWORD BaseSetLastNTError(IN NTSTATUS Status)
Definition: reactos.cpp:166
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define WINAPI
Definition: msvc.h:8
BOOL WINAPI QueryPerformanceCounter(OUT PLARGE_INTEGER lpPerformanceCount)
Definition: perfcnt.c:23
Status
Definition: gdiplustypes.h:24
static LARGE_INTEGER Frequency
Definition: clock.c:41
#define OUT
Definition: typedefs.h:39
LONGLONG QuadPart
Definition: typedefs.h:112