Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

bench.c File Reference

#include "precomp.h"
#include "bench.h"
#include "usrbench.h"
#include "resource.h"
#include "awtest.inc"
#include "abtest.inc"

Go to the source code of this file.

Defines

#define APIENTRY   FAR PASCAL
#define SETWINDOWLONGVAL   99999L
#define ASSERT(expr)
#define PROPCLASSNAME   TEXT("PropWindow")
#define WM_SYSTIMER   0x0118
#define WIDE   1
#define A1   A
#define A2   A
#define A1   A
#define A2   W
#define A1   W
#define A2   A
#define A1   W
#define A2   W
#define TEST_DEFAULT   300

Typedefs

typedef int INT
typedef char CHAR

Functions

INT_PTR APIENTRY FileOpenDlgProc (HWND, UINT, WPARAM, LPARAM)
INT_PTR APIENTRY ClearDlg (HWND, UINT, WPARAM, LPARAM)
INT_PTR APIENTRY ClearDlgNoState (HWND, UINT, WPARAM, LPARAM)
LRESULT APIENTRY CreateDestroyWndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
LRESULT APIENTRY CreateDestroyWndProcW (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
void DispErrorMsg (const char *title)
_int64 BeginTimeMeasurement ()
ULONGLONG EndTimeMeasurement (_int64 StartTime, ULONG Iter)
ULONGLONG msProfRegisterClass (HDC hdc, ULONG Iter)
ULONGLONG msProfClassGroup (HDC hdc, ULONG Iter)
ULONGLONG msProfClipboardGroup (HDC hdc, ULONG Iter)
ULONGLONG msProfAvgDlgDraw (HDC hdc, ULONG Iter)
ULONGLONG msProfAvgDlgCreate (HDC hdc, ULONG Iter)
ULONGLONG msProfAvgDlgCreateDestroy (HDC hdc, ULONG Iter)
ULONGLONG msProfAvgDlgCreateDestroyNoMenu (HDC hdc, ULONG Iter)
ULONGLONG msProfAvgDlgCreateDestroyNoFont (HDC hdc, ULONG Iter)
ULONGLONG msProfAvgDlgCreateDestroyEmpty (HDC hdc, ULONG Iter)
ULONGLONG msProfCreateDestroyWindow (HDC hdc, ULONG Iter)
ULONGLONG msProfCreateDestroyChildWindow (HDC hdc, ULONG Iter)
ULONGLONG msProfLocalAllocFree (HDC hdc, ULONG Iter)
ULONGLONG msProfGetWindowLong (HDC hdc, ULONG Iter)
ULONGLONG msProfSetWindowLong (HDC hdc, ULONG Iter)
ULONGLONG msProfCreateDestroyListbox (HDC hdc, ULONG Iter)
ULONGLONG msProfCreateDestroyButton (HDC hdc, ULONG Iter)
ULONGLONG msProfCreateDestroyCombobox (HDC hdc, ULONG Iter)
ULONGLONG msProfCreateDestroyEdit (HDC hdc, ULONG Iter)
ULONGLONG msProfCreateDestroyStatic (HDC hdc, ULONG Iter)
ULONGLONG msProfCreateDestroyScrollbar (HDC hdc, ULONG Iter)
ULONGLONG msProfListboxInsert1 (HDC hdc, ULONG Iter)
ULONGLONG msProfListboxInsert2 (HDC hdc, ULONG Iter)
ULONGLONG msProfListboxInsert3 (HDC hdc, ULONG Iter)
ULONGLONG msProfSize (HDC hdc, ULONG Iter)
ULONGLONG msProfMove (HDC hdc, ULONG Iter)
ULONGLONG msProfMenu (HDC hdc, ULONG Iter)
ULONGLONG msProfGetClientRect (HDC hdc, ULONG Iter)
ULONGLONG msProfScreenToClient (HDC hdc, ULONG Iter)
ULONGLONG msProfGetInputState (HDC hdc, ULONG Iter)
ULONGLONG msProfGetKeyState (HDC hdc, ULONG Iter)
ULONGLONG msProfGetAsyncKeyState (HDC hdc, ULONG Iter)
ULONGLONG msProfDispatchMessage (HDC hdc, ULONG Iter)
ULONGLONG msProfCallback (HDC hdc, ULONG Iter)
ULONGLONG msProfSendMessage (HDC hdc, ULONG Iter)
DWORD SendMessageDiffThreadFunc (PVOID pdwData)
ULONGLONG msProfSendMessageDiffThread (HDC hdc, ULONG Iter)
ULONGLONG msProfUpdateWindow (HDC hDC, ULONG Iter)
ULONGLONG msProfTranslateMessage (HDC hDC, ULONG Iter)

Variables

CHARaszTypical []
INT NStrings = sizeof(aszTypical)/sizeof(aszTypical[0])
BOOL gfSetFocus = TRUE
HWND ghwndFrame
HWND ghwndMDIClient
HANDLE ghinst
BOOL gfPentium
HWND hwndShare
TEST_ENTRY gTestEntry []
ULONG gNumTests = sizeof gTestEntry / sizeof gTestEntry[0]
ULONG gNumQTests = 10


Define Documentation

#define A1   W
 

Definition at line 1913 of file bench.c.

#define A1   W
 

Definition at line 1913 of file bench.c.

#define A1   A
 

Definition at line 1913 of file bench.c.

#define A1   A
 

Definition at line 1913 of file bench.c.

Referenced by main().

#define A2   W
 

Definition at line 1914 of file bench.c.

#define A2   A
 

Definition at line 1914 of file bench.c.

#define A2   W
 

Definition at line 1914 of file bench.c.

#define A2   A
 

Definition at line 1914 of file bench.c.

#define APIENTRY   FAR PASCAL
 

Definition at line 48 of file bench.c.

Referenced by _CreateAcceleratorTable(), _GetKeyNameText(), _SetDoubleClickTime(), _SwapMouseButton(), ButtonWndProcWorker(), ClearDlg(), ClearDlgNoState(), CollectUserPerformanceData(), ComboBoxWndProcWorker(), CopyInflateRect(), CopyOffsetRect(), CopyRect(), CreateDestroyWndProc(), CreateDestroyWndProcW(), DefWindowProc(), DispatchMessage(), DllMain(), EndTaskDlgProc(), EqualRect(), FillRect(), FrameRect(), FreeDDElParam(), GetClassLongPtr(), GetMessage(), GetProp(), GetWindowLongPtr(), ImeWndProcWorker(), InflateRect(), InitializeInstance(), IntersectRect(), InvertRect(), IsRectEmpty(), ListBoxWndProcWorker(), main(), MDIChildWndProc(), OffsetRect(), CAddProfileDialog::OpenFileHookProc(), OpenUserPerformanceData(), PackDDElParam(), PeekMessage(), PostMessage(), PostThreadMessage(), PtInRect(), ReuseDDElParam(), SendMessage(), SendMessageCallback(), SendMessageTimeout(), SendNotifyMessage(), SetClassLongPtr(), SetRect(), SetRectEmpty(), SetWindowLongPtr(), StaticWndProcWorker(), SubtractRect(), SystemParametersInfo(), UnionRect(), UnpackDDElParam(), and xxxSetSysColors().

#define ASSERT expr   ) 
 

Value:

if (!(expr)) { char szBuf[256]; \ sprintf(szBuf,"Assertion Failure %s %ld:"#expr"\n", __FILE__, __LINE__); \ MessageBox(NULL, szBuf, "Assert Failure", MB_OK); }

Definition at line 67 of file bench.c.

#define PROPCLASSNAME   TEXT("PropWindow")
 

Definition at line 101 of file bench.c.

Referenced by msProfClassGroup(), and msProfRegisterClass().

#define SETWINDOWLONGVAL   99999L
 

Definition at line 53 of file bench.c.

Referenced by msProfSetWindowLong().

#define TEST_DEFAULT   300
 

Definition at line 1920 of file bench.c.

#define WIDE   1
 

Definition at line 1899 of file bench.c.

#define WM_SYSTIMER   0x0118
 

Definition at line 1433 of file bench.c.

Referenced by CalcWakeMask(), DialogBox2(), DispatchMessageWorker(), DoTimer(), MLEditWndProc(), msProfMenu(), TimersProc(), xxxDispatchMessage(), xxxHandleMenuMessages(), and xxxMNLoop().


Typedef Documentation

typedef char CHAR
 

Definition at line 50 of file bench.c.

Referenced by AlAddSystemPartition(), AlGetPathnameFromComponent(), AlGetString(), CharLowerA(), CharUpperA(), ChooseDisk(), ClientThread(), CmpAddAliasEntry(), CmpCreateControlSet(), CmpFindControlSet(), CmpGetBiosDate(), CmpGetBiosVersion(), CmpGetInfData(), CmpMatchAcpiCreatorIdRule(), CmpMatchAcpiOemIdRule(), CmpMatchAcpiOemTableIdRule(), CmpMatchDateRule(), CmpMatchMemoryRule(), CmpMatchNextMatchRule(), CmpMatchPModeRule(), CmpMatchPointerRule(), CmpMatchSearchRule(), CmReplaceKey(), CompareNamesCaseSensitive(), CompStrAToStringA(), CompStrAToStringExA(), CompStrAToUndetA(), CompStrWToStringA(), CompStrWToStringExA(), CompStrWToUndetA(), ConsoleWindowProc(), ConvertOutputToOem(), ConvertOutputToUnicode(), CreateAcceleratorTableA(), CsrProbeForRead(), CsrProbeForWrite(), DefWindowProcWorker(), DoStringPaste(), DrawCommandListPopup(), DrawTextExA(), dumpHiveFromFile(), DumpObjectDirs(), dwrWorker(), ECNcCreate(), ECWord(), EnterNew(), EnumRegisterWordProcA(), ExpSystemErrorHandler(), ExpUuidLoadSequenceNumber(), FalseUnicodeToRealUnicode(), FE_StreamWriteToScreenBuffer(), FileOpenHookProc(), FileSaveHookProc(), FillProfileFromLog(), FmtQueryFatPartitionList(), FsRtlNotifyFullChangeDirectory(), FsRtlNotifyFullReportChange(), GetChar(), GetConsoleTitleA(), GetMenuAncestors(), GetMenuDepth(), ImmConfigureIMEW(), ImmEnumRegisterWordA(), ImmEscapeA(), ImmEscapeW(), ImmInstallIMEA(), ImmReconversionWorker(), ImmRegisterWordA(), ImmRequestMessageWorker(), ImmUnregisterWordA(), InitializeFullScreen(), InstallProfiles(), InternalDdeQueryString(), InternalEnumObjects(), InternalGetCandidateListWtoA(), InternalGetCompositionStringA(), InternalGetCompositionStringW(), InternalSCS_CHANGEATTR(), InternalSCS_SETSTR(), InternalUpgradeICM(), IoCreateDevice(), IopAddRemoteBootValuesToRegistry(), IopApplySystemPartitionProt(), IopChangeDeviceObjectFromRegistryProperties(), IopCopyBootLogRegistryToFile(), IopErrorLogThread(), IopMarkBootPartition(), IopReassignSystemRoot(), IopSendMessageToTrackService(), IopWriteIpAddressToRegistry(), IsCharAlphaA(), IsCharAlphaNumericA(), IsCharLowerA(), IsCharLowerW(), IsCharUpperA(), IsCharUpperW(), JohabToKs(), JzDeleteVariableSegment(), KdpTrap(), Ke386GetGdtEntryThread(), KeConnectInterrupt(), KeIA32GetGdtEntryThread(), KeUserModeCallback(), KiEmulateByteWord(), KsToJohab(), LdrpCheckForLoadedDll(), LowGetPartitionGeometry(), main(), MapVirtualKey(), MemPrint(), MESSAGECALL(), MiDoMappedCopy(), MiDoPoolCopy(), MigrateSystemNT(), MiInitMachineDependent(), MiLoadSystemImage(), MiSessionCommitPageTables(), MiSnapThunk(), MmCopyToCachedPage(), MmInitSystem(), MmProbeAndLockPages(), MmSecureVirtualMemory(), msProfAvgDlgCreate(), msProfAvgDlgCreateDestroy(), msProfAvgDlgCreateDestroyEmpty(), msProfAvgDlgCreateDestroyNoFont(), msProfAvgDlgCreateDestroyNoMenu(), msProfAvgDlgDraw(), MyNewDeviceLink(), NativeDosCharLength(), NtAllocateUuids(), NtReplyWaitSendChannel(), NtSetUuidSeed(), NtUserfnHkINLPCBTCREATESTRUCT(), NullTerminateString(), ParseInstSpecificAtom(), PnPBiosExpandProductId(), PnPBiosFindMatchingDevNode(), PrivMain(), ProbeForWrite(), ProcessCDError(), ProcessCommandNumberInput(), ReadConsoleOutputCharacterA(), ReadOutputString(), RealUnicodeToFalseUnicode(), ResizeScreenBuffer(), RtlCharToInteger(), RtlDnsHostNameToComputerName(), RtlIntegerToChar(), RtlLargeIntegerToChar(), RtlLoadStringOrError(), RtlMBMessageWParamCharToWCS(), RtlpDebugPageHeapRobustProtectVM(), RtlpWaitThread(), RtlUnicodeToMultiByteN(), RtlVolumeDeviceToDosName(), SaveToFile(), ScanKeyNode(), ScanKeyValue(), Scroll1(), Scroll2(), Scroll3(), Scroll4(), SearchFile(), SepAdtInitializeAuditingOptions(), SepAdtInitializeCrashOnFail(), SepAdtInitializePrivilegeAuditing(), ServerThread(), SetFontForMCWVERTICAL(), SrvGetConsoleAliases(), SrvGetConsoleAliasExes(), SrvGetConsoleCommandHistory(), SrvReadConsoleOutputString(), SrvWriteConsoleOutputString(), StaticWndProcWorker(), SubstituteDeviceName(), TestParent(), TransHanjaMode(), TranslateOutputToOem(), UdfConvertCS0DstringToUnicode(), UdfCS0DstringContainsLegalCharacters(), UdfEqualCountedString(), UdfIs8dot3Name(), UpgradeClass(), UserIsFullWidth(), VkKeyScan(), VkKeyScanEx(), WinHelpW(), WINNLSTranslateMessageK(), WriteConsoleOutputCharacterA(), wvsprintfA(), wvsprintfW(), WWSB_DoWriteConsole(), WWSB_FillOutput(), WWSB_WriteChars(), WWSB_WriteOutputString(), WWSB_WriteRectToScreenBuffer(), and xxxMKMouseMove().

typedef int INT
 

Definition at line 49 of file bench.c.


Function Documentation

_int64 BeginTimeMeasurement  ) 
 

Definition at line 126 of file bench.c.

References BOOL, FALSE, GetCycleCount(), gfPentium, gfUseCycleCount, and TRUE.

00127 { 00128 _int64 PerformanceCount; 00129 extern BOOL gfUseCycleCount; 00130 00131 #ifdef _X86_ 00132 SYSTEM_INFO SystemInfo; 00133 GetSystemInfo(&SystemInfo); 00134 if(gfUseCycleCount&&(PROCESSOR_INTEL_PENTIUM==SystemInfo.dwProcessorType)) 00135 gfPentium = TRUE; 00136 else 00137 #endif 00138 gfPentium = FALSE; 00139 #ifdef _X86_ 00140 if(gfPentium) 00141 PerformanceCount = GetCycleCount(); 00142 else 00143 #endif 00144 QueryPerformanceCounter((LARGE_INTEGER *)&PerformanceCount); 00145 00146 return(PerformanceCount); 00147 }

INT_PTR APIENTRY ClearDlg HWND  ,
UINT  ,
WPARAM  ,
LPARAM 
 

Definition at line 1284 of file bench.c.

References APIENTRY, BOOL, CheckRadioButton(), dc(), EnableWindow(), FALSE, GetDC, GetDlgItem(), gfSetFocus, ID2, ID256, IDHEIGHT, IDIN, IDPELS, IDWIDTH, INT, NULL, ReleaseDC(), SetDlgItemInt(), and TRUE.

Referenced by msProfAvgDlgCreate(), msProfAvgDlgCreateDestroy(), msProfAvgDlgCreateDestroyNoFont(), msProfAvgDlgCreateDestroyNoMenu(), and msProfAvgDlgDraw().

01285 { 01286 static BOOL bChangeOk = TRUE; 01287 01288 HDC dc; 01289 INT wid, hgt, numcolors; 01290 01291 switch (message) { 01292 case WM_INITDIALOG: 01293 /* 01294 * standard init stuff for pbrush 01295 */ 01296 dc = GetDC(NULL); 01297 numcolors = GetDeviceCaps(dc, NUMCOLORS); 01298 ReleaseDC(NULL, dc); 01299 01300 dc = GetDC(NULL); 01301 wid = GetDeviceCaps(dc, HORZRES); 01302 hgt = GetDeviceCaps(dc, VERTRES); 01303 ReleaseDC(NULL, dc); 01304 01305 CheckRadioButton (hDlg, ID2, ID256, ID2); 01306 01307 EnableWindow(GetDlgItem(hDlg, ID256), FALSE); 01308 CheckRadioButton(hDlg, ID2, ID256, ID256); 01309 01310 CheckRadioButton(hDlg, ID2, ID256, ID2); 01311 EnableWindow(GetDlgItem(hDlg, ID256), FALSE); 01312 CheckRadioButton(hDlg, ID2, ID256, ID256); 01313 01314 SetDlgItemInt(hDlg, IDWIDTH, 0, FALSE); 01315 SetDlgItemInt(hDlg, IDHEIGHT, 0, FALSE); 01316 CheckRadioButton(hDlg, IDIN, IDPELS, TRUE); 01317 01318 if (!gfSetFocus) 01319 return FALSE; 01320 01321 break; 01322 01323 default: 01324 return FALSE; 01325 } 01326 01327 return TRUE; 01328 }

INT_PTR APIENTRY ClearDlgNoState HWND  ,
UINT  ,
WPARAM  ,
LPARAM 
 

Definition at line 1331 of file bench.c.

References APIENTRY, BOOL, dc(), FALSE, gfSetFocus, INT, and TRUE.

Referenced by msProfAvgDlgCreateDestroyEmpty().

01332 { 01333 static BOOL bChangeOk = TRUE; 01334 01335 HDC dc; 01336 INT wid, hgt, numcolors; 01337 01338 switch (message) { 01339 case WM_INITDIALOG: 01340 if (!gfSetFocus) 01341 return FALSE; 01342 01343 break; 01344 01345 default: 01346 return FALSE; 01347 } 01348 01349 return TRUE; 01350 }

LRESULT APIENTRY CreateDestroyWndProc HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 609 of file bench.c.

References APIENTRY, DefWindowProc(), and msg.

Referenced by msProfClassGroup(), msProfCreateDestroyButton(), msProfCreateDestroyChildWindow(), msProfCreateDestroyCombobox(), msProfCreateDestroyEdit(), msProfCreateDestroyListbox(), msProfCreateDestroyScrollbar(), msProfCreateDestroyStatic(), msProfCreateDestroyWindow(), msProfDispatchMessage(), msProfGetWindowLong(), msProfListboxInsert1(), msProfListboxInsert2(), msProfListboxInsert3(), msProfRegisterClass(), msProfSendMessage(), msProfSetWindowLong(), msProfTranslateMessage(), msProfUpdateWindow(), and SendMessageDiffThreadFunc().

00614 { 00615 switch (msg) { 00616 case WM_SETTEXT: 00617 case WM_GETTEXTLENGTH: 00618 break; 00619 default: 00620 return DefWindowProc(hwnd, msg, wParam, lParam); 00621 00622 } 00623 00624 return 0; 00625 }

LRESULT APIENTRY CreateDestroyWndProcW HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 627 of file bench.c.

References APIENTRY, and msg.

Referenced by msProfCallback().

00632 { 00633 switch (msg) { 00634 case WM_SETTEXT: 00635 case WM_GETTEXTLENGTH: 00636 break; 00637 default: 00638 return DefWindowProcW(hwnd, msg, wParam, lParam); 00639 } 00640 00641 return 0; 00642 }

void DispErrorMsg const char *  title  )  [static]
 

Definition at line 72 of file bench.c.

References LPVOID, and NULL.

00073 { 00074 LPVOID msgbuf; 00075 00076 if (title == NULL) { 00077 title = "Error"; 00078 } 00079 FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, 00080 NULL, 00081 GetLastError(), 00082 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language 00083 (LPTSTR) &msgbuf, 00084 0, 00085 NULL); 00086 MessageBox(NULL, msgbuf, title, MB_OK | MB_ICONEXCLAMATION); 00087 LocalFree(msgbuf); 00088 }

ULONGLONG EndTimeMeasurement _int64  StartTime,
ULONG  Iter
 

Definition at line 166 of file bench.c.

References BOOL, CCNT_OVERHEAD, GetCycleCount(), gfPentium, and PerformanceFreq.

00169 { 00170 00171 _int64 PerformanceCount; 00172 extern _int64 PerformanceFreq; 00173 extern BOOL gfPentium; 00174 00175 #ifdef _X86_ 00176 if(gfPentium) 00177 { 00178 PerformanceCount = GetCycleCount(); 00179 PerformanceCount -= CCNT_OVERHEAD; 00180 } 00181 else 00182 #endif 00183 QueryPerformanceCounter((LARGE_INTEGER *)&PerformanceCount); 00184 00185 PerformanceCount -= StartTime ; 00186 00187 #ifdef _X86_ 00188 if(gfPentium) 00189 PerformanceCount /= Iter; 00190 else 00191 #endif 00192 PerformanceCount /= (PerformanceFreq * Iter); // Result is in 100ns units 00193 // because PerformanceFreq 00194 // was set to Counts/(100ns) 00195 return((ULONGLONG)PerformanceCount); 00196 }

INT_PTR APIENTRY FileOpenDlgProc HWND  ,
UINT  ,
WPARAM  ,
LPARAM 
 

ULONGLONG msProfAvgDlgCreate HDC  hdc,
ULONG  Iter
 

Definition at line 369 of file bench.c.

References CHAR, CLEARBOX, ClearDlg(), DestroyWindow, END_TIMER_NO_RETURN, ghinst, ghwndFrame, INIT_TIMER, RETURN_STOP_TIME, ShowWindow, START_TIMER, szFile, TRUE, and UpdateWindow().

00370 { 00371 00372 HWND hwnd; 00373 CHAR szFile[128]; 00374 INIT_TIMER; 00375 00376 START_TIMER; 00377 00378 while (ix--) 00379 { 00380 hwnd = CreateDialogParam(ghinst, MAKEINTRESOURCE(CLEARBOX), ghwndFrame, 00381 ClearDlg, MAKELONG(szFile,0)); 00382 ShowWindow(hwnd, TRUE); 00383 UpdateWindow(hwnd); 00384 DestroyWindow(hwnd); 00385 } 00386 00387 END_TIMER_NO_RETURN; 00388 00389 RETURN_STOP_TIME; 00390 }

ULONGLONG msProfAvgDlgCreateDestroy HDC  hdc,
ULONG  Iter
 

Definition at line 393 of file bench.c.

References CHAR, CLEARBOX, ClearDlg(), DestroyWindow, END_TIMER_NO_RETURN, FALSE, gfSetFocus, ghinst, ghwndFrame, INIT_TIMER, RETURN_STOP_TIME, START_TIMER, szFile, and TRUE.

00394 { 00395 00396 HWND hwnd; 00397 CHAR szFile[128]; 00398 INIT_TIMER; 00399 00400 gfSetFocus = FALSE; // Trying to minimize GDI's impact. 00401 00402 START_TIMER; 00403 00404 while (ix--) 00405 { 00406 hwnd = CreateDialogParam(ghinst, MAKEINTRESOURCE(CLEARBOX), ghwndFrame, 00407 ClearDlg, MAKELONG(szFile,0)); 00408 DestroyWindow(hwnd); 00409 } 00410 00411 END_TIMER_NO_RETURN; 00412 00413 gfSetFocus = TRUE; 00414 00415 RETURN_STOP_TIME; 00416 00417 }

ULONGLONG msProfAvgDlgCreateDestroyEmpty HDC  hdc,
ULONG  Iter
 

Definition at line 473 of file bench.c.

References CHAR, ClearDlgNoState(), DestroyWindow, EMPTY, END_TIMER_NO_RETURN, FALSE, gfSetFocus, ghinst, ghwndFrame, INIT_TIMER, RETURN_STOP_TIME, START_TIMER, szFile, and TRUE.

00474 { 00475 00476 HWND hwnd; 00477 CHAR szFile[128]; 00478 INIT_TIMER; 00479 00480 gfSetFocus = FALSE; // Trying to minimize GDI's impact. 00481 00482 START_TIMER; 00483 00484 while (ix--) 00485 { 00486 hwnd = CreateDialogParam(ghinst, MAKEINTRESOURCE(EMPTY), ghwndFrame, 00487 ClearDlgNoState, MAKELONG(szFile,0)); 00488 DestroyWindow(hwnd); 00489 } 00490 00491 END_TIMER_NO_RETURN; 00492 00493 gfSetFocus = TRUE; 00494 00495 RETURN_STOP_TIME; 00496 00497 }

ULONGLONG msProfAvgDlgCreateDestroyNoFont HDC  hdc,
ULONG  Iter
 

Definition at line 446 of file bench.c.

References CHAR, CLEARBOXNOFONT, ClearDlg(), DestroyWindow, END_TIMER_NO_RETURN, FALSE, gfSetFocus, ghinst, ghwndFrame, INIT_TIMER, RETURN_STOP_TIME, START_TIMER, szFile, and TRUE.

00447 { 00448 00449 HWND hwnd; 00450 CHAR szFile[128]; 00451 INIT_TIMER; 00452 00453 gfSetFocus = FALSE; // Trying to minimize GDI's impact. 00454 00455 START_TIMER; 00456 00457 while (ix--) 00458 { 00459 hwnd = CreateDialogParam(ghinst, MAKEINTRESOURCE(CLEARBOXNOFONT), ghwndFrame, 00460 ClearDlg, MAKELONG(szFile,0)); 00461 DestroyWindow(hwnd); 00462 } 00463 00464 END_TIMER_NO_RETURN; 00465 00466 gfSetFocus = TRUE; 00467 00468 RETURN_STOP_TIME; 00469 00470 }

ULONGLONG msProfAvgDlgCreateDestroyNoMenu HDC  hdc,
ULONG  Iter
 

Definition at line 420 of file bench.c.

References CHAR, CLEARBOXNOMENU, ClearDlg(), DestroyWindow, END_TIMER_NO_RETURN, FALSE, gfSetFocus, ghinst, ghwndFrame, INIT_TIMER, RETURN_STOP_TIME, START_TIMER, szFile, and TRUE.

00421 { 00422 00423 HWND hwnd; 00424 CHAR szFile[128]; 00425 INIT_TIMER; 00426 00427 gfSetFocus = FALSE; // Trying to minimize GDI's impact. 00428 00429 START_TIMER; 00430 00431 while (ix--) 00432 { 00433 hwnd = CreateDialogParam(ghinst, MAKEINTRESOURCE(CLEARBOXNOMENU), ghwndFrame, 00434 ClearDlg, MAKELONG(szFile,0)); 00435 DestroyWindow(hwnd); 00436 } 00437 00438 END_TIMER_NO_RETURN; 00439 00440 gfSetFocus = TRUE; 00441 00442 RETURN_STOP_TIME; 00443 }

ULONGLONG msProfAvgDlgDraw HDC  hdc,
ULONG  Iter
 

Definition at line 342 of file bench.c.

References CHAR, CLEARBOX, ClearDlg(), DestroyWindow, END_TIMER_NO_RETURN, FALSE, ghinst, ghwndFrame, INIT_TIMER, RETURN_STOP_TIME, ShowWindow, START_TIMER, szFile, TRUE, and UpdateWindow().

00343 { 00344 00345 CHAR szFile[128]; 00346 INIT_TIMER; 00347 00348 HWND hwnd = CreateDialogParam(ghinst, MAKEINTRESOURCE(CLEARBOX), ghwndFrame, 00349 ClearDlg, MAKELONG(szFile,0)); 00350 00351 START_TIMER; 00352 00353 while (ix--) 00354 { 00355 ShowWindow(hwnd, TRUE); 00356 UpdateWindow(hwnd); 00357 ShowWindow(hwnd, FALSE); 00358 } 00359 00360 END_TIMER_NO_RETURN; 00361 00362 DestroyWindow(hwnd); 00363 00364 RETURN_STOP_TIME; 00365 00366 }

ULONGLONG msProfCallback HDC  hdc,
ULONG  Iter
 

Definition at line 1613 of file bench.c.

References CreateDestroyWndProcW(), DestroyWindow, END_TIMER_NO_RETURN, ghinst, ghwndMDIClient, IDUSERBENCH, INIT_TIMER, L, NULL, RETURN_STOP_TIME, SendMessage(), START_TIMER, and UnregisterClass().

01614 { 01615 01616 HWND hwnd; 01617 INIT_TIMER; 01618 WNDCLASSW wc; 01619 01620 wc.style = 0; 01621 wc.lpfnWndProc = CreateDestroyWndProcW; 01622 wc.cbClsExtra = 0; 01623 wc.cbWndExtra = 0; 01624 wc.hInstance = ghinst; 01625 wc.hIcon = LoadIcon(ghinst, (LPSTR)IDUSERBENCH); 01626 wc.hCursor = LoadCursor(NULL, IDC_ARROW); 01627 wc.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE + 1); 01628 wc.lpszMenuName = NULL; 01629 wc.lpszClassName = L"CreateDestroyWindow"; 01630 01631 if (!RegisterClassW(&wc)) { 01632 // Fails On Chicago 01633 // MessageBox(GetParent(ghwndMDIClient), "15RegisterClass call failed.", 01634 // "ERROR!", MB_OK); 01635 return (ULONGLONG)(0); 01636 } 01637 01638 hwnd = CreateWindow("CreateDestroyWindow", NULL, WS_CHILD, 01639 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 01640 ghwndMDIClient, NULL, ghinst, NULL); 01641 01642 START_TIMER; 01643 01644 while (ix--) 01645 { 01646 SendMessage(hwnd, WM_GETTEXTLENGTH, 0, 0); 01647 } 01648 01649 END_TIMER_NO_RETURN; 01650 01651 DestroyWindow(hwnd); 01652 UnregisterClass("CreateDestroyWindow", ghinst); 01653 01654 RETURN_STOP_TIME; 01655 01656 }

ULONGLONG msProfClassGroup HDC  hdc,
ULONG  Iter
 

Definition at line 262 of file bench.c.

References CreateDestroyWndProc(), END_TIMER_NO_RETURN, GetClassInfo(), GetClassLongPtr(), ghinst, ghwndFrame, IDUSERBENCH, INIT_TIMER, NULL, PROPCLASSNAME, RegisterClass, RETURN_STOP_TIME, SetClassLongPtr(), START_TIMER, and UnregisterClass().

00263 { 00264 00265 char szBuf[50]; 00266 HICON hIcon; 00267 INIT_TIMER; 00268 WNDCLASS wc; 00269 00270 wc.style = 0; 00271 wc.lpfnWndProc = CreateDestroyWndProc; 00272 wc.cbClsExtra = 0; 00273 wc.cbWndExtra = 0; 00274 wc.hInstance = ghinst; 00275 wc.hIcon = hIcon = LoadIcon(ghinst, (LPSTR)IDUSERBENCH); 00276 wc.hCursor = LoadCursor(NULL, IDC_ARROW); 00277 wc.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE + 1); 00278 wc.lpszMenuName = NULL; 00279 wc.lpszClassName = PROPCLASSNAME; 00280 RegisterClass(&wc); 00281 00282 START_TIMER; 00283 00284 while (ix--) 00285 { 00286 GetClassInfo(ghinst, PROPCLASSNAME, &wc); 00287 GetClassName(ghwndFrame, szBuf, sizeof(szBuf)/sizeof(szBuf[0])); 00288 GetClassLongPtr(ghwndFrame, GCLP_HBRBACKGROUND); 00289 SetClassLongPtr(ghwndFrame, GCLP_HICON, (LONG_PTR)hIcon); 00290 } 00291 00292 END_TIMER_NO_RETURN; 00293 00294 UnregisterClass(PROPCLASSNAME, ghinst); 00295 00296 RETURN_STOP_TIME; 00297 }

ULONGLONG msProfClipboardGroup HDC  hdc,
ULONG  Iter
 

Definition at line 307 of file bench.c.

References CloseClipboard, END_OVERHEAD, END_TIMER_NO_RETURN, GetClipboardData(), ghwndFrame, INIT_TIMER, OpenClipboard(), RETURN_STOP_TIME, SetClipboardData(), START_OVERHEAD, and START_TIMER.

00308 { 00309 00310 INIT_TIMER; 00311 HGLOBAL h; 00312 int i; 00313 00314 START_TIMER; 00315 00316 while (ix--) 00317 { 00318 START_OVERHEAD; 00319 h = GlobalAlloc(GPTR | GMEM_DDESHARE, 80); 00320 strcpy( h, "hello"); 00321 END_OVERHEAD; 00322 00323 OpenClipboard(ghwndFrame); 00324 EmptyClipboard(); 00325 SetClipboardData(CF_TEXT, h); 00326 GetClipboardData(CF_TEXT); 00327 CloseClipboard(); 00328 } 00329 00330 END_TIMER_NO_RETURN; 00331 RETURN_STOP_TIME; 00332 }

ULONGLONG msProfCreateDestroyButton HDC  hdc,
ULONG  Iter
 

Definition at line 828 of file bench.c.

References CreateDestroyWndProc(), DestroyWindow, END_TIMER_NO_RETURN, GetParent(), ghinst, ghwndMDIClient, IDUSERBENCH, INIT_TIMER, NULL, RegisterClass, RETURN_STOP_TIME, START_TIMER, and UnregisterClass().

00829 { 00830 00831 HWND hwnd, hwndParent; 00832 INIT_TIMER; 00833 WNDCLASS wc; 00834 00835 wc.style = 0; 00836 wc.lpfnWndProc = CreateDestroyWndProc; 00837 wc.cbClsExtra = 0; 00838 wc.cbWndExtra = 0; 00839 wc.hInstance = ghinst; 00840 wc.hIcon = LoadIcon(ghinst, (LPSTR)IDUSERBENCH); 00841 wc.hCursor = LoadCursor(NULL, IDC_ARROW); 00842 wc.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE + 1); 00843 wc.lpszMenuName = NULL; 00844 wc.lpszClassName = "CreateDestroyWindow"; 00845 00846 if (!RegisterClass(&wc)) { 00847 MessageBox(GetParent(ghwndMDIClient), "6RegisterClass call failed.", 00848 "ERROR!", MB_OK); 00849 return (ULONGLONG)(0); 00850 } 00851 00852 hwndParent = CreateWindow("CreateDestroyWindow", NULL, WS_CHILD, 00853 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 00854 ghwndMDIClient, NULL, ghinst, NULL); 00855 00856 START_TIMER; 00857 00858 while (ix--) 00859 { 00860 hwnd = CreateWindow("Button", "OK", WS_CHILD | BS_PUSHBUTTON, 00861 50, 50, 200, 250, hwndParent, NULL, ghinst, NULL); 00862 if (hwnd == NULL) { 00863 MessageBox(GetParent(ghwndMDIClient), "CreateWindow call failed.", 00864 "ERROR!", MB_OK); 00865 return (ULONGLONG)(0); 00866 } 00867 DestroyWindow(hwnd); 00868 } 00869 00870 END_TIMER_NO_RETURN; 00871 00872 DestroyWindow(hwndParent); 00873 UnregisterClass("CreateDestroyWindow", ghinst); 00874 00875 RETURN_STOP_TIME; 00876 00877 }

ULONGLONG msProfCreateDestroyChildWindow HDC  hdc,
ULONG  Iter
 

Definition at line 555 of file bench.c.

References CreateDestroyWndProc(), DestroyWindow, END_TIMER_NO_RETURN, GetParent(), ghinst, ghwndMDIClient, IDUSERBENCH, INIT_TIMER, NULL, RegisterClass, RETURN_STOP_TIME, START_TIMER, and UnregisterClass().

00556 { 00557 00558 HWND hwnd, hwndParent; 00559 INIT_TIMER; 00560 00561 WNDCLASS wc; 00562 00563 wc.style = 0; 00564 wc.lpfnWndProc = CreateDestroyWndProc; 00565 wc.cbClsExtra = 0; 00566 wc.cbWndExtra = 0; 00567 wc.hInstance = ghinst; 00568 wc.hIcon = LoadIcon(ghinst, (LPSTR)IDUSERBENCH); 00569 wc.hCursor = LoadCursor(NULL, IDC_ARROW); 00570 wc.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE + 1); 00571 wc.lpszMenuName = NULL; 00572 wc.lpszClassName = "CreateDestroyWindow"; 00573 00574 if (!RegisterClass(&wc)) { 00575 MessageBox(GetParent(ghwndMDIClient), "2RegisterClass call failed.", 00576 "ERROR!", MB_OK); 00577 return (ULONGLONG)(0); 00578 } 00579 00580 hwndParent = CreateWindow("CreateDestroyWindow", NULL, WS_CHILD, 00581 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 00582 ghwndMDIClient, NULL, ghinst, NULL); 00583 00584 START_TIMER; 00585 00586 while (ix--) 00587 { 00588 hwnd = CreateWindow("CreateDestroyWindow", "Create/DestroyWindow test", 00589 WS_CHILD, 00590 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 00591 hwndParent, NULL, ghinst, NULL); 00592 if (hwnd == NULL) { 00593 MessageBox(GetParent(ghwndMDIClient), "CreateWindow call failed.", 00594 "ERROR!", MB_OK); 00595 break; 00596 } 00597 DestroyWindow(hwnd); 00598 } 00599 00600 END_TIMER_NO_RETURN; 00601 00602 DestroyWindow(hwndParent); 00603 UnregisterClass("CreateDestroyWindow", ghinst); 00604 00605 RETURN_STOP_TIME; 00606 }

ULONGLONG msProfCreateDestroyCombobox HDC  hdc,
ULONG  Iter
 

Definition at line 880 of file bench.c.

References CreateDestroyWndProc(), DestroyWindow, END_TIMER_NO_RETURN, GetParent(), ghinst, ghwndMDIClient, IDUSERBENCH, INIT_TIMER, NULL, RegisterClass, RETURN_STOP_TIME, START_TIMER, and UnregisterClass().

00881 { 00882 00883 HWND hwnd, hwndParent; 00884 INIT_TIMER; 00885 WNDCLASS wc; 00886 00887 wc.style = 0; 00888 wc.lpfnWndProc = CreateDestroyWndProc; 00889 wc.cbClsExtra = 0; 00890 wc.cbWndExtra = 0; 00891 wc.hInstance = ghinst; 00892 wc.hIcon = LoadIcon(ghinst, (LPSTR)IDUSERBENCH); 00893 wc.hCursor = LoadCursor(NULL, IDC_ARROW); 00894 wc.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE + 1); 00895 wc.lpszMenuName = NULL; 00896 wc.lpszClassName = "CreateDestroyWindow"; 00897 00898 if (!RegisterClass(&wc)) { 00899 MessageBox(GetParent(ghwndMDIClient), "7RegisterClass call failed.", 00900 "ERROR!", MB_OK); 00901 return (ULONGLONG)(0); 00902 } 00903 00904 hwndParent = CreateWindow("CreateDestroyWindow", NULL, WS_CHILD, 00905 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 00906 ghwndMDIClient, NULL, ghinst, NULL); 00907 00908 START_TIMER; 00909 00910 while (ix--) 00911 { 00912 hwnd = CreateWindow("Combobox", NULL, WS_CHILD | CBS_SIMPLE | CBS_HASSTRINGS | WS_VISIBLE, 00913 50, 50, 200, 250, hwndParent, NULL, ghinst, NULL); 00914 if (hwnd == NULL) { 00915 MessageBox(GetParent(ghwndMDIClient), "CreateWindow call failed.", 00916 "ERROR!", MB_OK); 00917 return (ULONGLONG)(0); 00918 } 00919 DestroyWindow(hwnd); 00920 } 00921 00922 END_TIMER_NO_RETURN; 00923 00924 DestroyWindow(hwndParent); 00925 UnregisterClass("CreateDestroyWindow", ghinst); 00926 00927 RETURN_STOP_TIME; 00928 00929 }

ULONGLONG msProfCreateDestroyEdit HDC  hdc,
ULONG  Iter
 

Definition at line 932 of file bench.c.

References CreateDestroyWndProc(), DestroyWindow, END_TIMER_NO_RETURN, GetParent(), ghinst, ghwndMDIClient, IDUSERBENCH, INIT_TIMER, NULL, RegisterClass, RETURN_STOP_TIME, START_TIMER, and UnregisterClass().

00933 { 00934 00935 HWND hwnd, hwndParent; 00936 INIT_TIMER; 00937 WNDCLASS wc; 00938 00939 wc.style = 0; 00940 wc.lpfnWndProc = CreateDestroyWndProc; 00941 wc.cbClsExtra = 0; 00942 wc.cbWndExtra = 0; 00943 wc.hInstance = ghinst; 00944 wc.hIcon = LoadIcon(ghinst, (LPSTR)IDUSERBENCH); 00945 wc.hCursor = LoadCursor(NULL, IDC_ARROW); 00946 wc.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE + 1); 00947 wc.lpszMenuName = NULL; 00948 wc.lpszClassName = "CreateDestroyWindow"; 00949 00950 if (!RegisterClass(&wc)) { 00951 MessageBox(GetParent(ghwndMDIClient), "8RegisterClass call failed.", 00952 "ERROR!", MB_OK); 00953 return (ULONGLONG)(0); 00954 } 00955 00956 hwndParent = CreateWindow("CreateDestroyWindow", NULL, WS_CHILD, 00957 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 00958 ghwndMDIClient, NULL, ghinst, NULL); 00959 00960 START_TIMER; 00961 00962 while (ix--) 00963 { 00964 hwnd = CreateWindow("Edit", NULL, WS_CHILD | WS_VISIBLE, 00965 50, 50, 200, 250, hwndParent, NULL, ghinst, NULL); 00966 if (hwnd == NULL) { 00967 MessageBox(GetParent(ghwndMDIClient), "CreateWindow call failed.", 00968 "ERROR!", MB_OK); 00969 return (ULONGLONG)(0); 00970 } 00971 DestroyWindow(hwnd); 00972 } 00973 00974 END_TIMER_NO_RETURN; 00975 00976 DestroyWindow(hwndParent); 00977 UnregisterClass("CreateDestroyWindow", ghinst); 00978 00979 RETURN_STOP_TIME; 00980 00981 }

ULONGLONG msProfCreateDestroyListbox HDC  hdc,
ULONG  Iter
 

Definition at line 776 of file bench.c.

References CreateDestroyWndProc(), DestroyWindow, END_TIMER_NO_RETURN, GetParent(), ghinst, ghwndMDIClient, IDUSERBENCH, INIT_TIMER, NULL, RegisterClass, RETURN_STOP_TIME, START_TIMER, and UnregisterClass().

00777 { 00778 00779 HWND hwnd, hwndParent; 00780 INIT_TIMER; 00781 WNDCLASS wc; 00782 00783 wc.style = 0; 00784 wc.lpfnWndProc = CreateDestroyWndProc; 00785 wc.cbClsExtra = 0; 00786 wc.cbWndExtra = 0; 00787 wc.hInstance = ghinst; 00788 wc.hIcon = LoadIcon(ghinst, (LPSTR)IDUSERBENCH); 00789 wc.hCursor = LoadCursor(NULL, IDC_ARROW); 00790 wc.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE + 1); 00791 wc.lpszMenuName = NULL; 00792 wc.lpszClassName = "CreateDestroyWindow"; 00793 00794 if (!RegisterClass(&wc)) { 00795 MessageBox(GetParent(ghwndMDIClient), "5RegisterClass call failed.", 00796 "ERROR!", MB_OK); 00797 return (ULONGLONG)(0); 00798 } 00799 00800 hwndParent = CreateWindow("CreateDestroyWindow", NULL, WS_CHILD, 00801 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 00802 ghwndMDIClient, NULL, ghinst, NULL); 00803 00804 START_TIMER; 00805 00806 while (ix--) 00807 { 00808 hwnd = CreateWindow("ListBox", NULL, WS_CHILD | LBS_STANDARD | WS_VISIBLE, 00809 50, 50, 200, 250, hwndParent, NULL, ghinst, NULL); 00810 if (hwnd == NULL) { 00811 MessageBox(GetParent(ghwndMDIClient), "CreateWindow call failed.", 00812 "ERROR!", MB_OK); 00813 return (ULONGLONG)(0); 00814 } 00815 DestroyWindow(hwnd); 00816 } 00817 00818 END_TIMER_NO_RETURN; 00819 00820 DestroyWindow(hwndParent); 00821 UnregisterClass("CreateDestroyWindow", ghinst); 00822 00823 RETURN_STOP_TIME; 00824 00825 }

ULONGLONG msProfCreateDestroyScrollbar HDC  hdc,
ULONG  Iter
 

Definition at line 1036 of file bench.c.

References CreateDestroyWndProc(), DestroyWindow, END_TIMER_NO_RETURN, GetParent(), ghinst, ghwndMDIClient, IDUSERBENCH, INIT_TIMER, NULL, RegisterClass, RETURN_STOP_TIME, START_TIMER, and UnregisterClass().

01037 { 01038 01039 HWND hwnd, hwndParent; 01040 INIT_TIMER; 01041 WNDCLASS wc; 01042 01043 wc.style = 0; 01044 wc.lpfnWndProc = CreateDestroyWndProc; 01045 wc.cbClsExtra = 0; 01046 wc.cbWndExtra = 0; 01047 wc.hInstance = ghinst; 01048 wc.hIcon = LoadIcon(ghinst, (LPSTR)IDUSERBENCH); 01049 wc.hCursor = LoadCursor(NULL, IDC_ARROW); 01050 wc.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE + 1); 01051 wc.lpszMenuName = NULL; 01052 wc.lpszClassName = "CreateDestroyWindow"; 01053 01054 if (!RegisterClass(&wc)) { 01055 MessageBox(GetParent(ghwndMDIClient), "10RegisterClass call failed.", 01056 "ERROR!", MB_OK); 01057 return (ULONGLONG)(0); 01058 } 01059 01060 hwndParent = CreateWindow("CreateDestroyWindow", NULL, WS_CHILD, 01061 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 01062 ghwndMDIClient, NULL, ghinst, NULL); 01063 01064 START_TIMER; 01065 01066 while (ix--) 01067 { 01068 hwnd = CreateWindow("Scrollbar", "Hello", WS_CHILD | SBS_HORZ | SBS_TOPALIGN, 01069 50, 50, 100, 100, hwndParent, NULL, ghinst, NULL); 01070 if (hwnd == NULL) { 01071 MessageBox(GetParent(ghwndMDIClient), "CreateWindow call failed.", 01072 "ERROR!", MB_OK); 01073 return (ULONGLONG)(0); 01074 } 01075 DestroyWindow(hwnd); 01076 } 01077 01078 END_TIMER_NO_RETURN; 01079 01080 DestroyWindow(hwndParent); 01081 UnregisterClass("CreateDestroyWindow", ghinst); 01082 01083 RETURN_STOP_TIME; 01084 01085 }

ULONGLONG msProfCreateDestroyStatic HDC  hdc,
ULONG  Iter
 

Definition at line 984 of file bench.c.

References CreateDestroyWndProc(), DestroyWindow, END_TIMER_NO_RETURN, GetParent(), ghinst, ghwndMDIClient, IDUSERBENCH, INIT_TIMER, NULL, RegisterClass, RETURN_STOP_TIME, START_TIMER, and UnregisterClass().

00985 { 00986 00987 HWND hwnd, hwndParent; 00988 INIT_TIMER; 00989 WNDCLASS wc; 00990 00991 wc.style = 0; 00992 wc.lpfnWndProc = CreateDestroyWndProc; 00993 wc.cbClsExtra = 0; 00994 wc.cbWndExtra = 0; 00995 wc.hInstance = ghinst; 00996 wc.hIcon = LoadIcon(ghinst, (LPSTR)IDUSERBENCH); 00997 wc.hCursor = LoadCursor(NULL, IDC_ARROW); 00998 wc.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE + 1); 00999 wc.lpszMenuName = NULL; 01000 wc.lpszClassName = "CreateDestroyWindow"; 01001 01002 if (!RegisterClass(&wc)) { 01003 MessageBox(GetParent(ghwndMDIClient), "9RegisterClass call failed.", 01004 "ERROR!", MB_OK); 01005 return (ULONGLONG)(0); 01006 } 01007 01008 hwndParent = CreateWindow("CreateDestroyWindow", NULL, WS_CHILD, 01009 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 01010 ghwndMDIClient, NULL, ghinst, NULL); 01011 01012 START_TIMER; 01013 01014 while (ix--) 01015 { 01016 hwnd = CreateWindow("Static", "Hello", WS_CHILD | SS_SIMPLE, 01017 50, 50, 200, 250, hwndParent, NULL, ghinst, NULL); 01018 if (hwnd == NULL) { 01019 MessageBox(GetParent(ghwndMDIClient), "CreateWindow call failed.", 01020 "ERROR!", MB_OK); 01021 return (ULONGLONG)(0); 01022 } 01023 DestroyWindow(hwnd); 01024 } 01025 01026 END_TIMER_NO_RETURN; 01027 01028 DestroyWindow(hwndParent); 01029 UnregisterClass("CreateDestroyWindow", ghinst); 01030 01031 RETURN_STOP_TIME; 01032 01033 }

ULONGLONG msProfCreateDestroyWindow HDC  hdc,
ULONG  Iter
 

Definition at line 501 of file bench.c.

References CreateDestroyWndProc(), DestroyWindow, END_TIMER_NO_RETURN, GetParent(), ghinst, ghwndMDIClient, IDUSERBENCH, INIT_TIMER, NULL, RegisterClass, RETURN_STOP_TIME, START_TIMER, and UnregisterClass().

00502 { 00503 00504 HWND hwnd; 00505 INIT_TIMER; 00506 WNDCLASS wc; 00507 00508 if(!ghinst)MessageBox(GetParent(ghwndMDIClient), "1ghinst==0","ERROR!", MB_OK); 00509 00510 00511 wc.style = 0; 00512 wc.lpfnWndProc = CreateDestroyWndProc; 00513 wc.cbClsExtra = 0; 00514 wc.cbWndExtra = 0; 00515 wc.hInstance = ghinst; 00516 wc.hIcon = LoadIcon(ghinst, (LPSTR)IDUSERBENCH); 00517 wc.hCursor = LoadCursor((HINSTANCE)NULL, IDC_ARROW); 00518 wc.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE + 1); 00519 wc.lpszMenuName = NULL; 00520 wc.lpszClassName = "CreateDestroyWindow"; 00521 00522 00523 if (!RegisterClass(&wc)) { 00524 MessageBox(GetParent(ghwndMDIClient), "1RegisterClass call failed.", 00525 "ERROR!", MB_OK); 00526 return (ULONGLONG)(0); 00527 } 00528 00529 00530 START_TIMER; 00531 00532 while (ix--) 00533 { 00534 hwnd = CreateWindow("CreateDestroyWindow", "Create/DestroyWindow test", 00535 WS_OVERLAPPEDWINDOW, 00536 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 00537 NULL, NULL, ghinst, NULL); 00538 if (hwnd == NULL) { 00539 MessageBox(GetParent(ghwndMDIClient), "CreateWindow call failed.", 00540 "ERROR!", MB_OK); 00541 break; 00542 } 00543 DestroyWindow(hwnd); 00544 } 00545 00546 END_TIMER_NO_RETURN; 00547 00548 UnregisterClass("CreateDestroyWindow", ghinst); 00549 00550 RETURN_STOP_TIME; 00551 00552 }

ULONGLONG msProfDispatchMessage HDC  hdc,
ULONG  Iter
 

Definition at line 1559 of file bench.c.

References CreateDestroyWndProc(), DestroyWindow, DispatchMessage(), END_TIMER_NO_RETURN, GetParent(), ghinst, ghwndMDIClient, IDUSERBENCH, INIT_TIMER, msg, NULL, RegisterClass, RETURN_STOP_TIME, START_TIMER, and UnregisterClass().

01560 { 01561 01562 HWND hwnd; 01563 MSG msg; 01564 INIT_TIMER; 01565 WNDCLASS wc; 01566 01567 wc.style = 0; 01568 wc.lpfnWndProc = CreateDestroyWndProc; 01569 wc.cbClsExtra = 0; 01570 wc.cbWndExtra = 0; 01571 wc.hInstance = ghinst; 01572 wc.hIcon = LoadIcon(ghinst, (LPSTR)IDUSERBENCH); 01573 wc.hCursor = LoadCursor(NULL, IDC_ARROW); 01574 wc.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE + 1); 01575 wc.lpszMenuName = NULL; 01576 wc.lpszClassName = "CreateDestroyWindow"; 01577 01578 if (!RegisterClass(&wc)) { 01579 MessageBox(GetParent(ghwndMDIClient), "14RegisterClass call failed.", 01580 "ERROR!", MB_OK); 01581 return (ULONGLONG)(0); 01582 } 01583 01584 hwnd = CreateWindow("CreateDestroyWindow", NULL, WS_CHILD, 01585 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 01586 ghwndMDIClient, NULL, ghinst, NULL); 01587 01588 msg.hwnd = hwnd; 01589 msg.message = WM_MOUSEMOVE; 01590 msg.wParam = 1; 01591 msg.lParam = 2; 01592 msg.time = 3; 01593 msg.pt.x = 4; 01594 msg.pt.y = 5; 01595 01596 START_TIMER; 01597 01598 while (ix--) 01599 { 01600 DispatchMessage(&msg); 01601 } 01602 01603 END_TIMER_NO_RETURN; 01604 01605 DestroyWindow(hwnd); 01606 UnregisterClass("CreateDestroyWindow", ghinst); 01607 01608 RETURN_STOP_TIME; 01609 01610 }

ULONGLONG msProfGetAsyncKeyState HDC  hdc,
ULONG  Iter
 

Definition at line 1543 of file bench.c.

References END_TIMER, GetAsyncKeyState(), INIT_TIMER, and START_TIMER.

01544 { 01545 01546 INIT_TIMER; 01547 01548 START_TIMER; 01549 01550 while (ix--) 01551 { 01552 GetAsyncKeyState(VK_ESCAPE); 01553 } 01554 01555 END_TIMER; 01556 }

ULONGLONG msProfGetClientRect HDC  hdc,
ULONG  Iter
 

Definition at line 1474 of file bench.c.

References END_TIMER, GetClientRect(), ghwndMDIClient, INIT_TIMER, and START_TIMER.

01475 { 01476 01477 RECT rc; 01478 INIT_TIMER; 01479 01480 START_TIMER; 01481 01482 while (ix--) 01483 { 01484 GetClientRect(ghwndMDIClient, &rc); 01485 } 01486 01487 END_TIMER; 01488 }

ULONGLONG msProfGetInputState HDC  hdc,
ULONG  Iter
 

Definition at line 1511 of file bench.c.

References END_TIMER, GetInputState(), INIT_TIMER, and START_TIMER.

01512 { 01513 01514 INIT_TIMER; 01515 01516 START_TIMER; 01517 01518 while (ix--) 01519 { 01520 GetInputState(); 01521 } 01522 01523 END_TIMER; 01524 }

ULONGLONG msProfGetKeyState HDC  hdc,
ULONG  Iter
 

Definition at line 1527 of file bench.c.

References END_TIMER, GetKeyState(), INIT_TIMER, and START_TIMER.

01528 { 01529 01530 INIT_TIMER; 01531 01532 START_TIMER; 01533 01534 while (ix--) 01535 { 01536 GetKeyState(VK_ESCAPE); 01537 } 01538 01539 END_TIMER; 01540 }

ULONGLONG msProfGetWindowLong HDC  hdc,
ULONG  Iter
 

Definition at line 674 of file bench.c.

References CreateDestroyWndProc(), DestroyWindow, END_TIMER_NO_RETURN, GetParent(), ghinst, ghwndMDIClient, IDUSERBENCH, INIT_TIMER, NULL, RegisterClass, RETURN_STOP_TIME, START_TIMER, and UnregisterClass().

00675 { 00676 00677 HWND hwnd; 00678 INIT_TIMER; 00679 LONG l; 00680 WNDCLASS wc; 00681 00682 wc.style = 0; 00683 wc.lpfnWndProc = CreateDestroyWndProc; 00684 wc.cbClsExtra = 0; 00685 wc.cbWndExtra = 4; 00686 wc.hInstance = ghinst; 00687 wc.hIcon = LoadIcon(ghinst, (LPSTR)IDUSERBENCH); 00688 wc.hCursor = LoadCursor(NULL, IDC_ARROW); 00689 wc.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE + 1); 00690 wc.lpszMenuName = NULL; 00691 wc.lpszClassName = "CreateDestroyWindow"; 00692 00693 if (!RegisterClass(&wc)) { 00694 MessageBox(GetParent(ghwndMDIClient), "3RegisterClass call failed.", 00695 "ERROR!", MB_OK); 00696 return (ULONGLONG)(0); 00697 } 00698 00699 hwnd = CreateWindow("CreateDestroyWindow", "Create/DestroyWindow test", 00700 WS_OVERLAPPEDWINDOW, 00701 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 00702 NULL, NULL, ghinst, NULL); 00703 00704 if (hwnd == NULL) { 00705 MessageBox(GetParent(ghwndMDIClient), "CreateWindow call failed.", 00706 "ERROR!", MB_OK); 00707 return (ULONGLONG)(0); 00708 } 00709 00710 START_TIMER; 00711 00712 while (ix--) 00713 l = GetWindowLong(hwnd, 0); 00714 00715 END_TIMER_NO_RETURN; 00716 00717 DestroyWindow(hwnd); 00718 UnregisterClass("CreateDestroyWindow", ghinst); 00719 00720 RETURN_STOP_TIME; 00721 00722 }

ULONGLONG msProfListboxInsert1 HDC  hdc,
ULONG  Iter
 

Definition at line 1088 of file bench.c.

References aszTypical, CreateDestroyWndProc(), DestroyWindow, END_TIMER_NO_RETURN, GetParent(), ghinst, ghwndMDIClient, IDUSERBENCH, INIT_TIMER, NStrings, NULL, RegisterClass, RETURN_STOP_TIME, SendMessage(), START_TIMER, and UnregisterClass().

01089 { 01090 01091 ULONG i; 01092 HWND hwndParent; 01093 INIT_TIMER; 01094 WNDCLASS wc; 01095 HWND *ahwnd = LocalAlloc(LPTR,Iter*sizeof(HANDLE)); 01096 if(!ahwnd) 01097 MessageBox(GetParent(ghwndMDIClient), 01098 "Could not Allocate Memory for Handle Array", 01099 "ERROR!", MB_OK); 01100 01101 wc.style = 0; 01102 wc.lpfnWndProc = CreateDestroyWndProc; 01103 wc.cbClsExtra = 0; 01104 wc.cbWndExtra = 0; 01105 wc.hInstance = ghinst; 01106 wc.hIcon = LoadIcon(ghinst, IDUSERBENCH); 01107 wc.hCursor = LoadCursor(NULL, IDC_ARROW); 01108 wc.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE + 1); 01109 wc.lpszMenuName = NULL; 01110 wc.lpszClassName = "CreateDestroyWindow"; 01111 01112 if (!RegisterClass(&wc)) { 01113 MessageBox(GetParent(ghwndMDIClient), "11RegisterClass call failed.", 01114 "ERROR!", MB_OK); 01115 return (ULONGLONG)(0); 01116 } 01117 01118 hwndParent = CreateWindow("CreateDestroyWindow", NULL, WS_CHILD, 01119 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 01120 ghwndMDIClient, NULL, ghinst, NULL); 01121 01122 for (i=0; i < Iter; i++) 01123 { 01124 ahwnd[i] = CreateWindow("ListBox", NULL, WS_CHILD | LBS_STANDARD, 01125 50, 50, 200, 250, hwndParent, NULL, ghinst, NULL); 01126 if (ahwnd[i] == NULL) { 01127 MessageBox(GetParent(ghwndMDIClient), "CreateWindow call failed.", 01128 "ERROR!", MB_OK); 01129 return (ULONGLONG)(0); 01130 } 01131 } 01132 01133 START_TIMER; 01134 01135 while (ix--) 01136 for (i = 0; i < 200; i++) 01137 SendMessage(ahwnd[ix], LB_ADDSTRING, 0, (LPARAM)aszTypical[i % NStrings]); 01138 01139 END_TIMER_NO_RETURN; 01140 01141 for (i = 0; i < Iter; i++) 01142 DestroyWindow(ahwnd[i]); 01143 01144 DestroyWindow(hwndParent); 01145 UnregisterClass("CreateDestroyWindow", ghinst); 01146 LocalFree(ahwnd); 01147 01148 RETURN_STOP_TIME; 01149 01150 }

ULONGLONG msProfListboxInsert2 HDC  hdc,
ULONG  Iter
 

Definition at line 1153 of file bench.c.

References aszTypical, CreateDestroyWndProc(), DestroyWindow, END_TIMER_NO_RETURN, GetParent(), ghinst, ghwndMDIClient, IDUSERBENCH, INIT_TIMER, NStrings, NULL, RegisterClass, RETURN_STOP_TIME, SendMessage(), START_TIMER, and UnregisterClass().

01154 { 01155 ULONG i; 01156 HWND hwndParent; 01157 INIT_TIMER; 01158 WNDCLASS wc; 01159 HWND *ahwnd = LocalAlloc(LPTR,Iter*sizeof(HANDLE)); 01160 if(!ahwnd) 01161 MessageBox(GetParent(ghwndMDIClient), 01162 "Could not Allocate Memory for Handle Array", 01163 "ERROR!", MB_OK); 01164 01165 wc.style = 0; 01166 wc.lpfnWndProc = CreateDestroyWndProc; 01167 wc.cbClsExtra = 0; 01168 wc.cbWndExtra = 0; 01169 wc.hInstance = ghinst; 01170 wc.hIcon = LoadIcon(ghinst, IDUSERBENCH); 01171 wc.hCursor = LoadCursor(NULL, IDC_ARROW); 01172 wc.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE + 1); 01173 wc.lpszMenuName = NULL; 01174 wc.lpszClassName = "CreateDestroyWindow"; 01175 01176 if (!RegisterClass(&wc)) { 01177 MessageBox(GetParent(ghwndMDIClient), "12RegisterClass call failed.", 01178 "ERROR!", MB_OK); 01179 return (ULONGLONG)(0); 01180 } 01181 01182 hwndParent = CreateWindow("CreateDestroyWindow", NULL, WS_CHILD, 01183 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 01184 ghwndMDIClient, NULL, ghinst, NULL); 01185 01186 for (i = 0; i < Iter; i++) { 01187 ahwnd[i] = CreateWindow("ListBox", NULL, 01188 WS_CHILD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS, 01189 50, 50, 200, 250, hwndParent, NULL, ghinst, NULL); 01190 if (ahwnd[i] == NULL) { 01191 MessageBox(GetParent(ghwndMDIClient), "CreateWindow call failed.", 01192 "ERROR!", MB_OK); 01193 return (ULONGLONG)(0); 01194 } 01195 } 01196 01197 START_TIMER; 01198 01199 while (ix--) 01200 for (i = 0; i < 200; i++) 01201 SendMessage(ahwnd[ix], LB_ADDSTRING, 0, (LPARAM)aszTypical[i % NStrings]); 01202 01203 END_TIMER_NO_RETURN; 01204 01205 for (i = 0; i < Iter; i++) 01206 DestroyWindow(ahwnd[i]); 01207 01208 DestroyWindow(hwndParent); 01209 UnregisterClass("CreateDestroyWindow", ghinst); 01210 LocalFree(ahwnd); 01211 01212 RETURN_STOP_TIME; 01213 01214 }

ULONGLONG msProfListboxInsert3 HDC  hdc,
ULONG  Iter
 

Definition at line 1217 of file bench.c.

References aszTypical, CreateDestroyWndProc(), DestroyWindow, END_TIMER_NO_RETURN, GetParent(), ghinst, ghwndMDIClient, IDUSERBENCH, INIT_TIMER, NStrings, NULL, RegisterClass, RETURN_STOP_TIME, SendMessage(), START_TIMER, and UnregisterClass().

01218 { 01219 ULONG i; 01220 HWND hwndParent; 01221 INIT_TIMER; 01222 WNDCLASS wc; 01223 HWND *ahwnd = LocalAlloc(LPTR,Iter*sizeof(HANDLE)); 01224 if(!ahwnd) 01225 MessageBox(GetParent(ghwndMDIClient), 01226 "Could not Allocate Memory for Handle Array", 01227 "ERROR!", MB_OK); 01228 01229 wc.style = 0; 01230 wc.lpfnWndProc = CreateDestroyWndProc; 01231 wc.cbClsExtra = 0; 01232 wc.cbWndExtra = 0; 01233 wc.hInstance = ghinst; 01234 wc.hIcon = LoadIcon(ghinst, IDUSERBENCH); 01235 wc.hCursor = LoadCursor(NULL, IDC_ARROW); 01236 wc.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE + 1); 01237 wc.lpszMenuName = NULL; 01238 wc.lpszClassName = "CreateDestroyWindow"; 01239 01240 if (!RegisterClass(&wc)) { 01241 MessageBox(GetParent(ghwndMDIClient), "13RegisterClass call failed.", 01242 "ERROR!", MB_OK); 01243 return (ULONGLONG)(0); 01244 } 01245 01246 hwndParent = CreateWindow("CreateDestroyWindow", NULL, WS_CHILD, 01247 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 01248 ghwndMDIClient, NULL, ghinst, NULL); 01249 01250 for (i = 0; i < Iter; i++) { 01251 ahwnd[i] = CreateWindow("ListBox", NULL, 01252 WS_CHILD | LBS_SORT | LBS_OWNERDRAWFIXED, 01253 50, 50, 200, 250, hwndParent, NULL, ghinst, NULL); 01254 if (ahwnd[i] == NULL) { 01255 MessageBox(GetParent(ghwndMDIClient), "CreateWindow call failed.", 01256 "ERROR!", MB_OK); 01257 return (ULONGLONG)(0); 01258 } 01259 } 01260 01261 START_TIMER; 01262 01263 while (ix--) 01264 for (i = 0; i < 200; i++) 01265 SendMessage(ahwnd[ix], LB_ADDSTRING, 0, (LPARAM)aszTypical[i % NStrings]); 01266 01267 END_TIMER_NO_RETURN; 01268 01269 for (i = 0; i < Iter; i++) 01270 DestroyWindow(ahwnd[i]); 01271 01272 DestroyWindow(hwndParent); 01273 UnregisterClass("CreateDestroyWindow", ghinst); 01274 LocalFree(ahwnd); 01275 01276 RETURN_STOP_TIME; 01277 01278 }

ULONGLONG msProfLocalAllocFree HDC  hdc,
ULONG  Iter
 

Definition at line 645 of file bench.c.

References END_TIMER, INIT_TIMER, and START_TIMER.

00646 { 00647 00648 HANDLE h1, h2, h3, h4, h5; 00649 INIT_TIMER; 00650 00651 START_TIMER; 00652 00653 // Try to stress the heap a little bit more than just doing a 00654 // series of Alloc/Frees. 00655 00656 while (ix--) // originally ix<Iter/5 as well 00657 { 00658 h1 = LocalAlloc(0, 500); 00659 h2 = LocalAlloc(0, 600); 00660 h3 = LocalAlloc(0, 700); 00661 LocalFree(h2); 00662 h4 = LocalAlloc(0, 1000); 00663 h5 = LocalAlloc(0, 100); 00664 LocalFree(h1); 00665 LocalFree(h3); 00666 LocalFree(h4); 00667 LocalFree(h5); 00668 } 00669 00670 END_TIMER; 00671 }

ULONGLONG msProfMenu HDC  hdc,
ULONG  Iter
 

Definition at line 1435 of file bench.c.

References DispatchMessage(), DWORD, END_TIMER_NO_RETURN, FALSE, GetParent(), ghwndMDIClient, INIT_TIMER, L, msg, NULL, PeekMessage(), PostMessage(), RETURN_STOP_TIME, SendMessage(), ShowWindow, START_TIMER, UpdateWindow(), and WM_SYSTIMER.

01436 { 01437 01438 MSG msg; 01439 INIT_TIMER; 01440 01441 HWND hwnd = GetParent(ghwndMDIClient); 01442 01443 ShowWindow(hwnd, FALSE); 01444 01445 /* 01446 * Multipad's edit menu is a great choice. Multipad does a goodly lot 01447 * of WM_INITMENU time initialization. The WM_SYSTIMER message is 01448 * to circumvent menu type ahead so the menu actually shows. 01449 */ 01450 01451 START_TIMER; 01452 01453 while (ix--) 01454 { 01455 PostMessage(hwnd, WM_KEYDOWN, VK_ESCAPE, 0L); 01456 PostMessage(hwnd, WM_KEYDOWN, VK_ESCAPE, 0L); 01457 PostMessage(hwnd, WM_SYSTIMER, 0, 0L); 01458 SendMessage(hwnd, WM_SYSCOMMAND, SC_KEYMENU, (DWORD)(WORD)'e'); 01459 while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) 01460 DispatchMessage(&msg); 01461 } 01462 01463 END_TIMER_NO_RETURN; 01464 01465 ShowWindow(hwnd, SW_RESTORE); 01466 UpdateWindow(hwnd); 01467 01468 RETURN_STOP_TIME; 01469 01470 }

ULONGLONG msProfMove HDC  hdc,
ULONG  Iter
 

Definition at line 1393 of file bench.c.

References END_TIMER_NO_RETURN, FALSE, GetClientRect(), GetWindow(), ghwndMDIClient, InflateRect(), INIT_TIMER, NULL, RETURN_STOP_TIME, SetWindowPos, ShowWindow, START_TIMER, and UpdateWindow().

01394 { 01395 01396 HWND hwnd; 01397 RECT rc; 01398 INIT_TIMER; 01399 01400 GetClientRect(ghwndMDIClient, (LPRECT)&rc); 01401 InflateRect((LPRECT)&rc, -(rc.right - rc.left) / 4, 01402 -(rc.bottom - rc.top) / 4); 01403 01404 hwnd = GetWindow(ghwndMDIClient, GW_CHILD); 01405 ShowWindow(hwnd, SW_RESTORE); 01406 ShowWindow(hwnd, FALSE); 01407 UpdateWindow(hwnd); 01408 01409 /* time start */ 01410 01411 START_TIMER; 01412 01413 while (ix--) 01414 { 01415 SetWindowPos(hwnd, NULL, rc.left, rc.top, 01416 rc.right - rc.left, rc.bottom - rc.top, 01417 SWP_NOZORDER | SWP_NOACTIVATE); 01418 SetWindowPos(hwnd, NULL, 0, 0, 0, 0, 01419 SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOSIZE); 01420 } 01421 01422 /* time end */ 01423 01424 END_TIMER_NO_RETURN; 01425 01426 ShowWindow(hwnd, SW_RESTORE); 01427 01428 RETURN_STOP_TIME; 01429 01430 }

ULONGLONG msProfRegisterClass HDC  hdc,
ULONG  Iter
 

Definition at line 224 of file bench.c.

References CreateDestroyWndProc(), END_TIMER, ghinst, IDUSERBENCH, INIT_TIMER, NULL, PROPCLASSNAME, RegisterClass, START_TIMER, and UnregisterClass().

00227 { 00228 INIT_TIMER; 00229 WNDCLASS wc; 00230 00231 wc.style = 0; 00232 wc.lpfnWndProc = CreateDestroyWndProc; 00233 wc.cbClsExtra = 0; 00234 wc.cbWndExtra = 0; 00235 wc.hInstance = ghinst; 00236 wc.hIcon = LoadIcon(ghinst, (LPSTR)IDUSERBENCH); 00237 wc.hCursor = LoadCursor(NULL, IDC_ARROW); 00238 wc.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE + 1); 00239 wc.lpszMenuName = NULL; 00240 wc.lpszClassName = PROPCLASSNAME; 00241 00242 START_TIMER; 00243 00244 while (ix--) 00245 { 00246 RegisterClass(&wc); 00247 UnregisterClass(PROPCLASSNAME, ghinst); 00248 } 00249 00250 END_TIMER; 00251 00252 }

ULONGLONG msProfScreenToClient HDC  hdc,
ULONG  Iter
 

Definition at line 1491 of file bench.c.

References END_TIMER, ghwndMDIClient, INIT_TIMER, ScreenToClient(), and START_TIMER.

01492 { 01493 01494 POINT pt; 01495 INIT_TIMER; 01496 01497 pt.x = 100; 01498 pt.y = 200; 01499 01500 START_TIMER; 01501 01502 while (ix--) 01503 { 01504 ScreenToClient(ghwndMDIClient, &pt); 01505 } 01506 01507 END_TIMER; 01508 }

ULONGLONG msProfSendMessage HDC  hdc,
ULONG  Iter
 

Definition at line 1659 of file bench.c.

References CreateDestroyWndProc(), DestroyWindow, END_TIMER_NO_RETURN, GetParent(), ghinst, ghwndMDIClient, IDUSERBENCH, INIT_TIMER, NULL, RegisterClass, RETURN_STOP_TIME, SendMessage(), START_TIMER, and UnregisterClass().

01660 { 01661 01662 HWND hwnd; 01663 INIT_TIMER; 01664 WNDCLASS wc; 01665 01666 wc.style = 0; 01667 wc.lpfnWndProc = CreateDestroyWndProc; 01668 wc.cbClsExtra = 0; 01669 wc.cbWndExtra = 0; 01670 wc.hInstance = ghinst; 01671 wc.hIcon = LoadIcon(ghinst, (LPSTR)IDUSERBENCH); 01672 wc.hCursor = LoadCursor(NULL, IDC_ARROW); 01673 wc.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE + 1); 01674 wc.lpszMenuName = NULL; 01675 wc.lpszClassName = "CreateDestroyWindow"; 01676 01677 if (!RegisterClass(&wc)) { 01678 MessageBox(GetParent(ghwndMDIClient), "16RegisterClass call failed.", 01679 "ERROR!", MB_OK); 01680 return (ULONGLONG)(0); 01681 } 01682 01683 hwnd = CreateWindow("CreateDestroyWindow", NULL, WS_CHILD, 01684 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 01685 ghwndMDIClient, NULL, ghinst, NULL); 01686 01687 START_TIMER; 01688 01689 while (ix--) 01690 { 01691 SendMessage(hwnd, WM_MOUSEMOVE, 1, 2); 01692 } 01693 01694 END_TIMER_NO_RETURN; 01695 01696 DestroyWindow(hwnd); 01697 UnregisterClass("CreateDestroyWindow", ghinst); 01698 01699 RETURN_STOP_TIME; 01700 01701 }

ULONGLONG msProfSendMessageDiffThread HDC  hdc,
ULONG  Iter
 

Definition at line 1752 of file bench.c.

References ASSERT, DWORD, END_TIMER_NO_RETURN, FALSE, hwndShare, INIT_TIMER, NULL, PostThreadMessage(), RETURN_STOP_TIME, SendMessage(), SendMessageDiffThreadFunc(), START_TIMER, and TRUE.

01753 { 01754 01755 DWORD dwData; 01756 DWORD id; 01757 HANDLE hEvent; 01758 HANDLE hThread; 01759 INIT_TIMER; 01760 01761 hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); 01762 01763 hwndShare = (HWND)0; 01764 01765 hThread = CreateThread( NULL, 0, SendMessageDiffThreadFunc, &hEvent, 0, &id); 01766 01767 WaitForSingleObject( hEvent, 20*1000); 01768 01769 Sleep(10*1000); 01770 01771 ASSERT(hwndShare); 01772 01773 START_TIMER; 01774 01775 while (ix--) 01776 { 01777 SendMessage(hwndShare, WM_MOUSEMOVE, 1, 2); 01778 } 01779 01780 END_TIMER_NO_RETURN; 01781 01782 PostThreadMessage(id, WM_QUIT, 0, 0); 01783 WaitForSingleObject(hThread, 2*1000); // Wait for Cleanup before Starting Next Cycle 01784 CloseHandle(hThread); 01785 01786 RETURN_STOP_TIME; 01787 01788 }

ULONGLONG msProfSetWindowLong HDC  hdc,
ULONG  Iter
 

Definition at line 725 of file bench.c.

References CreateDestroyWndProc(), DestroyWindow, END_TIMER_NO_RETURN, GetParent(), ghinst, ghwndMDIClient, IDUSERBENCH, INIT_TIMER, NULL, RegisterClass, RETURN_STOP_TIME, SETWINDOWLONGVAL, START_TIMER, and UnregisterClass().

00726 { 00727 00728 HWND hwnd; 00729 INIT_TIMER; 00730 LONG l; 00731 WNDCLASS wc; 00732 00733 wc.style = 0; 00734 wc.lpfnWndProc = CreateDestroyWndProc; 00735 wc.cbClsExtra = 0; 00736 wc.cbWndExtra = 4; 00737 wc.hInstance = ghinst; 00738 wc.hIcon = LoadIcon(ghinst, (LPSTR)IDUSERBENCH); 00739 wc.hCursor = LoadCursor(NULL, IDC_ARROW); 00740 wc.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE + 1); 00741 wc.lpszMenuName = NULL; 00742 wc.lpszClassName = "CreateDestroyWindow"; 00743 00744 if (!RegisterClass(&wc)) { 00745 MessageBox(GetParent(ghwndMDIClient), "4RegisterClass call failed.", 00746 "ERROR!", MB_OK); 00747 return (ULONGLONG)(0); 00748 } 00749 00750 hwnd = CreateWindow("CreateDestroyWindow", "Create/DestroyWindow test", 00751 WS_OVERLAPPEDWINDOW, 00752 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 00753 NULL, NULL, ghinst, NULL); 00754 00755 if (hwnd == NULL) { 00756 MessageBox(GetParent(ghwndMDIClient), "CreateWindow call failed.", 00757 "ERROR!", MB_OK); 00758 return (ULONGLONG)(0); 00759 } 00760 00761 START_TIMER; 00762 00763 while (ix--) 00764 l = SetWindowLong(hwnd, 0, SETWINDOWLONGVAL); 00765 00766 END_TIMER_NO_RETURN; 00767 00768 DestroyWindow(hwnd); 00769 UnregisterClass("CreateDestroyWindow", ghinst); 00770 00771 RETURN_STOP_TIME; 00772 00773 }

ULONGLONG msProfSize HDC  hdc,
ULONG  Iter
 

Definition at line 1353 of file bench.c.

References END_TIMER_NO_RETURN, FALSE, GetClientRect(), GetWindow(), ghwndMDIClient, InflateRect(), INIT_TIMER, NULL, RETURN_STOP_TIME, SetWindowPos, ShowWindow, START_TIMER, and UpdateWindow().

01354 { 01355 01356 HWND hwnd; 01357 RECT rc; 01358 INIT_TIMER; 01359 01360 GetClientRect(ghwndMDIClient, (LPRECT)&rc); 01361 InflateRect((LPRECT)&rc, -10, -10); 01362 01363 hwnd = GetWindow(ghwndMDIClient, GW_CHILD); 01364 ShowWindow(hwnd, SW_RESTORE); 01365 ShowWindow(hwnd, FALSE); 01366 UpdateWindow(hwnd); 01367 01368 /* time start */ 01369 01370 START_TIMER; 01371 01372 while (ix--) 01373 { 01374 SetWindowPos(hwnd, NULL, rc.left, rc.top, 01375 rc.right - rc.left, rc.bottom - rc.top, 01376 SWP_NOZORDER | SWP_NOACTIVATE); 01377 SetWindowPos(hwnd, NULL, rc.left, rc.top, 01378 (rc.right - rc.left) / 2, (rc.bottom - rc.top) / 2, 01379 SWP_NOZORDER | SWP_NOACTIVATE); 01380 } 01381 01382 /* time end */ 01383 01384 END_TIMER_NO_RETURN; 01385 01386 ShowWindow(hwnd, SW_RESTORE); 01387 01388 RETURN_STOP_TIME; 01389 01390 }

ULONGLONG msProfTranslateMessage HDC  hDC,
ULONG  Iter
 

Definition at line 1843 of file bench.c.

References CreateDestroyWndProc(), DestroyWindow, END_TIMER, FALSE, GetParent(), ghinst, ghwndMDIClient, IDUSERBENCH, INIT_TIMER, msg, NULL, RegisterClass, START_TIMER, TranslateMessage(), and UnregisterClass().

01844 { 01845 WNDCLASS wc; 01846 HWND hwnd; 01847 RECT rect; 01848 static LPCSTR className = "TranslateMessageTest"; 01849 static MSG msgTemplate = { 01850 (HWND)NULL, WM_KEYDOWN, 01851 (WPARAM)0, 01852 (LPARAM)0, 01853 0, // time 01854 {0, 0}, // mouse pointer 01855 }; 01856 INIT_TIMER; 01857 01858 wc.style = 0; 01859 wc.lpfnWndProc = CreateDestroyWndProc; 01860 wc.cbClsExtra = 0; 01861 wc.cbWndExtra = 0; 01862 wc.hInstance = ghinst; 01863 wc.hIcon = LoadIcon(ghinst, (LPSTR)IDUSERBENCH); 01864 wc.hCursor = LoadCursor(NULL, IDC_ARROW); 01865 wc.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE + 1); 01866 wc.lpszMenuName = NULL; 01867 wc.lpszClassName = className; 01868 01869 if (!RegisterClass(&wc)) { 01870 MessageBox(GetParent(ghwndMDIClient), "RegisterClass call failed.", 01871 "ERROR!", MB_OK); 01872 return FALSE; 01873 } 01874 01875 hwnd = CreateWindow(className, NULL, 01876 WS_OVERLAPPEDWINDOW, 01877 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 01878 NULL, NULL, ghinst, NULL); 01879 if (hwnd == NULL) { 01880 MessageBox(GetParent(ghwndMDIClient), "CreateWindow call failed.", 01881 "ERROR!", MB_OK); 01882 return 0; 01883 } 01884 msgTemplate.hwnd = hwnd; 01885 01886 01887 START_TIMER; 01888 while (ix--) { 01889 MSG msg = msgTemplate; 01890 TranslateMessage(&msg); 01891 } 01892 01893 DestroyWindow(hwnd); 01894 UnregisterClass(className, ghinst); 01895 01896 END_TIMER; 01897 }

ULONGLONG msProfUpdateWindow HDC  hDC,
ULONG  Iter
 

Definition at line 1791 of file bench.c.

References CreateDestroyWndProc(), DestroyWindow, END_OVERHEAD, END_TIMER_NO_RETURN, FALSE, GetClientRect(), GetParent(), ghinst, ghwndMDIClient, IDUSERBENCH, INIT_TIMER, NULL, RegisterClass, RETURN_STOP_TIME, START_OVERHEAD, START_TIMER, UnregisterClass(), and UpdateWindow().

01792 { 01793 WNDCLASS wc; 01794 HWND hwnd; 01795 RECT rect; 01796 static LPCSTR className = "UpdateWindowTest"; 01797 INIT_TIMER; 01798 01799 wc.style = 0; 01800 wc.lpfnWndProc = CreateDestroyWndProc; 01801 wc.cbClsExtra = 0; 01802 wc.cbWndExtra = 0; 01803 wc.hInstance = ghinst; 01804 wc.hIcon = LoadIcon(ghinst, (LPSTR)IDUSERBENCH); 01805 wc.hCursor = LoadCursor(NULL, IDC_ARROW); 01806 wc.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE + 1); 01807 wc.lpszMenuName = NULL; 01808 wc.lpszClassName = className; 01809 01810 if (!RegisterClass(&wc)) { 01811 MessageBox(GetParent(ghwndMDIClient), "RegisterClass call failed.", 01812 "ERROR!", MB_OK); 01813 return FALSE; 01814 } 01815 01816 hwnd = CreateWindow(className, NULL, 01817 WS_OVERLAPPEDWINDOW, 01818 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 01819 NULL, NULL, ghinst, NULL); 01820 if (hwnd == NULL) { 01821 MessageBox(GetParent(ghwndMDIClient), "CreateWindow call failed.", 01822 "ERROR!", MB_OK); 01823 return 0; 01824 } 01825 GetClientRect(hwnd, &rect); 01826 01827 START_TIMER; 01828 while (ix--) { 01829 START_OVERHEAD; 01830 InvalidateRect(hwnd, &rect, FALSE); 01831 END_OVERHEAD; 01832 UpdateWindow(hwnd); 01833 } 01834 01835 END_TIMER_NO_RETURN; 01836 01837 DestroyWindow(hwnd); 01838 UnregisterClass(className, ghinst); 01839 01840 RETURN_STOP_TIME; 01841 }

DWORD SendMessageDiffThreadFunc PVOID  pdwData  ) 
 

Definition at line 1705 of file bench.c.

References ASSERT, BOOL, CreateDestroyWndProc(), DestroyWindow, DispatchMessage(), DWORD, FALSE, GetDesktopWindow(), GetMessage(), GetParent(), ghinst, ghwndMDIClient, hwndShare, IDUSERBENCH, msg, NULL, RegisterClass, TRUE, and UnregisterClass().

Referenced by msProfSendMessageDiffThread().

01706 { 01707 WNDCLASS wc; 01708 MSG msg; 01709 BOOL b; 01710 01711 wc.style = 0; 01712 wc.lpfnWndProc = CreateDestroyWndProc; 01713 wc.cbClsExtra = 0; 01714 wc.cbWndExtra = 0; 01715 wc.hInstance = ghinst; 01716 wc.hIcon = LoadIcon(ghinst, (LPSTR)IDUSERBENCH); 01717 wc.hCursor = LoadCursor(NULL, IDC_ARROW); 01718 wc.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE + 1); 01719 wc.lpszMenuName = NULL; 01720 wc.lpszClassName = "SendMessageDiffThread"; 01721 01722 if (!RegisterClass(&wc)) { 01723 MessageBox(GetParent(ghwndMDIClient), "19RegisterClass call failed.", 01724 "ERROR!", MB_OK); 01725 return FALSE; 01726 } 01727 01728 hwndShare = CreateWindow("SendMessageDiffThread", NULL, 0, 01729 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 01730 GetDesktopWindow(), NULL, ghinst, NULL); 01731 01732 01733 ASSERT(hwndShare); 01734 01735 SetEvent(*((PHANDLE)pdwData)); 01736 01737 while (GetMessage(&msg, NULL, 0, 0)) { 01738 DispatchMessage(&msg); 01739 } 01740 01741 b = DestroyWindow(hwndShare); 01742 01743 ASSERT(b); 01744 01745 b = UnregisterClass("SendMessageDiffThread", ghinst); 01746 01747 ASSERT(b); 01748 01749 return TRUE; 01750 }


Variable Documentation

CHAR* aszTypical[]
 

Initial value:

{ "change", "alteration", "amendment", "mutation", "permutation", "variation", "substitution", "modification", "transposition", "transformation" }

Definition at line 93 of file bench.c.

Referenced by msProfListboxInsert1(), msProfListboxInsert2(), and msProfListboxInsert3().

BOOL gfPentium
 

Definition at line 124 of file bench.c.

Referenced by BeginTimeMeasurement(), EndTimeMeasurement(), ResultsDlgProc(), and WriteBatchResults().

BOOL gfSetFocus = TRUE
 

Definition at line 100 of file bench.c.

Referenced by ClearDlg(), ClearDlgNoState(), msProfAvgDlgCreateDestroy(), msProfAvgDlgCreateDestroyEmpty(), msProfAvgDlgCreateDestroyNoFont(), and msProfAvgDlgCreateDestroyNoMenu().

HANDLE ghinst
 

Definition at line 108 of file bench.c.

Referenced by InitializeInstance(), MDIChildWndProc(), msProfAvgDlgCreate(), msProfAvgDlgCreateDestroy(), msProfAvgDlgCreateDestroyEmpty(), msProfAvgDlgCreateDestroyNoFont(), msProfAvgDlgCreateDestroyNoMenu(), msProfAvgDlgDraw(), msProfCallback(), msProfClassGroup(), msProfCreateDestroyButton(), msProfCreateDestroyChildWindow(), msProfCreateDestroyCombobox(), msProfCreateDestroyEdit(), msProfCreateDestroyListbox(), msProfCreateDestroyScrollbar(), msProfCreateDestroyStatic(), msProfCreateDestroyWindow(), msProfDispatchMessage(), msProfGetWindowLong(), msProfListboxInsert1(), msProfListboxInsert2(), msProfListboxInsert3(), msProfRegisterClass(), msProfSendMessage(), msProfSetWindowLong(), msProfTranslateMessage(), msProfUpdateWindow(), SendMessageDiffThreadFunc(), and WinMain().

HWND ghwndFrame
 

Definition at line 107 of file bench.c.

Referenced by InitializeInstance(), msProfAvgDlgCreate(), msProfAvgDlgCreateDestroy(), msProfAvgDlgCreateDestroyEmpty(), msProfAvgDlgCreateDestroyNoFont(), msProfAvgDlgCreateDestroyNoMenu(), msProfAvgDlgDraw(), msProfClassGroup(), msProfClipboardGroup(), SaveResults(), and WinMain().

HWND ghwndMDIClient
 

Definition at line 107 of file bench.c.

Referenced by InitializeInstance(), MDIChildWndProc(), msProfCallback(), msProfCreateDestroyButton(), msProfCreateDestroyChildWindow(), msProfCreateDestroyCombobox(), msProfCreateDestroyEdit(), msProfCreateDestroyListbox(), msProfCreateDestroyScrollbar(), msProfCreateDestroyStatic(), msProfCreateDestroyWindow(), msProfDispatchMessage(), msProfGetClientRect(), msProfGetWindowLong(), msProfListboxInsert1(), msProfListboxInsert2(), msProfListboxInsert3(), msProfMenu(), msProfMove(), msProfScreenToClient(), msProfSendMessage(), msProfSetWindowLong(), msProfSize(), msProfTranslateMessage(), msProfUpdateWindow(), SendMessageDiffThreadFunc(), WinMain(), and WndProc().

ULONG gNumQTests = 10
 

Definition at line 1993 of file bench.c.

ULONG gNumTests = sizeof gTestEntry / sizeof gTestEntry[0]
 

Definition at line 1992 of file bench.c.

TEST_ENTRY gTestEntry[]
 

Definition at line 1922 of file bench.c.

Referenced by ResultsDlgProc(), WndProc(), and WriteBatchResults().

HWND hwndShare
 

Definition at line 1703 of file bench.c.

Referenced by msProfSendMessageDiffThread(), and SendMessageDiffThreadFunc().

INT NStrings = sizeof(aszTypical)/sizeof(aszTypical[0])
 

Definition at line 98 of file bench.c.

Referenced by msProfListboxInsert1(), msProfListboxInsert2(), and msProfListboxInsert3().


Generated on Sat May 15 19:42:57 2004 for test by doxygen 1.3.7