46#include <reactos/buildno.h>
50#define MAINWND_WIDTH 400
51#define MAINWND_HEIGHT 400
98 unsigned Reps, DidReps;
141 if (Duration <=
TICK)
152 Reps = (
int) ((
double) PerfInfo->
Seconds * 1000.0 * (
double) Reps / (
double) Duration) + 1;
163 Reps = (Reps + 1) * Exponent;
185 double exponent,
sign;
205 while (1000.0 <=
d / exponent);
206 d = (
double)((
int)(
d / exponent + 0.5));
213 while (
d * exponent < 100.0)
218 d = (
double)((
int)(
d * exponent + 0.5));
228 double MSecsPerObj, ObjsPerSec;
233 ObjsPerSec = (
double) Reps * 1000.0 / (
double)
Time;
239 wprintf(
L"%7d %s @ %8.4f msec (%8.1f/sec): %s\n",
240 Reps, Average ?
L"trep" :
L"reps", MSecsPerObj, ObjsPerSec,
Label);
244 wprintf(
L"%6d %sreps @ 0.0 msec (unmeasurably fast): %s\n",
245 Reps, Average ?
L"t" :
L"",
Label);
294 BOOL OsVersionInfoEx;
296 WCHAR ProductType[9] = {
L'\0' };
299 unsigned RosVersionLen;
309 if (! OsVersionInfoEx)
321 if (7 <= RosVersionLen && 0 ==
_wcsnicmp(RosVersion,
L"ReactOS", 7))
323 wprintf(
L"Running on %s\n", RosVersion);
335 wprintf(
L"Running on Microsoft Windows Server 2003, ");
339 wprintf(
L"Running on Microsoft Windows XP ");
343 wprintf(
L"Running on Microsoft Windows 2000 ");
347 wprintf(
L"Running on Microsoft Windows NT ");
414 wprintf(
L"Server 4.0, Enterprise Edition ");
426 L"SYSTEM\\CurrentControlSet\\Control\\ProductOptions",
433 BufLen =
sizeof(ProductType);
448 else if (0 ==
lstrcmpiW(
L"LANMANNT", ProductType))
452 else if (0 ==
lstrcmpiW(
L"SERVERNT", ProductType))
467 L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Hotfix\\Q246009",
497 wprintf(
L"Running on Microsoft Windows 95 ");
506 wprintf(
L"Running on Microsoft Windows 98 ");
515 wprintf(
L"Running on Microsoft Windows Millennium Edition");
522 wprintf(
L"Running on Microsoft Win32s\n");
530 wprintf(
L"RosPerf %S (Build %S)\n", KERNEL_VERSION_STR, KERNEL_VERSION_BUILD_STR);
591 RECT ClientRect, WindowRect;
675 L"ReactOS performance test",
705 fwprintf(
stderr,
L"Failed to create label window (last error 0x%lX)\n",
724 unsigned AllTestCount,
i,
j;
742 for (Arg = 1; Arg < ArgC; Arg++)
744 if (
L'/' == ArgV[Arg][0] ||
L'-' == ArgV[Arg][0])
746 if (0 ==
_wcsicmp(ArgV[Arg] + 1,
L"repeat"))
765 else if (0 ==
_wcsicmp(ArgV[Arg] + 1,
L"seconds"))
796 for (
i = 0;
i < AllTestCount;
i++)
802 for (
i = 0;
i < AllTestCount;
i++)
804 if (0 ==
_wcsicmp(ArgV[Arg], AllTests[
i].Option))
810 if (AllTestCount <=
i)
824 for (
i = 0;
i < AllTestCount;
i++)
831 for (
i = 0;
i < AllTestCount;
i++)
846 for (
i = 0;
i < AllTestCount;
i++)
850 (*Tests)[
j] = AllTests[
i];
896 fwprintf(
stderr,
L"Failed to create device contexts (last error %d)\n",
OSVERSIONINFOW VersionInfo
#define RegCloseKey(hKey)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
static const WCHAR Title[]
LPWSTR WINAPI GetCommandLineW(VOID)
DWORD WINAPI GetTickCount(VOID)
BOOL WINAPI GetVersionExW(IN LPOSVERSIONINFOW lpVersionInformation)
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
static const WCHAR Message[]
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
_Check_return_opt_ _CRTIMP int __cdecl fwprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const wchar_t *_Format,...)
_Check_return_ unsigned long __cdecl wcstoul(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
int _snwprintf(wchar_t *buffer, size_t count, const wchar_t *format,...)
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
static PLARGE_INTEGER Time
#define VER_PLATFORM_WIN32_NT
#define VER_PLATFORM_WIN32_WINDOWS
#define VER_PLATFORM_WIN32s
#define VER_SUITE_ENTERPRISE
#define VER_SUITE_DATACENTER
#define VER_SUITE_PERSONAL
#define WS_OVERLAPPEDWINDOW
static void ReportTimes(DWORD Time, int Reps, LPCWSTR Label, BOOL Average)
static void ClearWindow(PPERF_INFO PerfInfo)
static LRESULT CALLBACK LabelWndProc(HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam)
static double RoundTo3Digits(double d)
static void ProcessTest(PTEST Test, PPERF_INFO PerfInfo)
static void ProcessMessages(void)
static void PrintDisplayInfo(void)
void NullCleanup(void *Context, PPERF_INFO PerfInfo)
static unsigned CalibrateTest(PTEST Test, PPERF_INFO PerfInfo)
static void DisplayStatus(HWND Label, LPCWSTR Message, LPCWSTR Test, int Try)
unsigned NullInit(void **Context, PPERF_INFO PerfInfo, unsigned Reps)
static BOOL ProcessCommandLine(PPERF_INFO PerfInfo, unsigned *TestCount, PTEST *Tests)
static HWND CreatePerfWindows(HINSTANCE hInstance, PPERF_INFO PerfInfo)
static void PrintAppVersion(void)
static void PrintOSVersion(void)
static LRESULT CALLBACK MainWndProc(HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam)
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpszCmdLine, int nCmdShow)
static void PrintStartupInfo(void)
void GetTests(unsigned *TestCount, PTEST *Tests)
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
LPWSTR *WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int *numargs)
ULONG dwOSVersionInfoSize
TW_UINT32 TW_UINT16 TW_UINT16 MSG
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
DWORD WINAPI GetLastError(void)
BOOL WINAPI GetTextMetricsW(_In_ HDC, _Out_ LPTEXTMETRICW)
HGDIOBJ WINAPI GetStockObject(_In_ int)
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
BOOL WINAPI TextOutW(_In_ HDC hdc, _In_ int x, _In_ int y, _In_reads_(c) LPCWSTR lpString, _In_ int c)
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)
#define HKEY_LOCAL_MACHINE
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
BOOL WINAPI TranslateMessage(_In_ const MSG *)
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
BOOL WINAPI SetCursorPos(_In_ int, _In_ int)
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HWND WINAPI SetActiveWindow(_In_ HWND)
BOOL WINAPI PeekMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
BOOL WINAPI UpdateWindow(_In_ HWND)
HDC WINAPI GetDC(_In_opt_ HWND)
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
#define SWP_NOOWNERZORDER
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
#define VER_NT_WORKSTATION
#define VER_NT_DOMAIN_CONTROLLER
OSVERSIONINFOA OSVERSIONINFO
struct _OSVERSIONINFOEXW OSVERSIONINFOEXW