Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
1.6 KiB

  1. //+------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1993.
  5. //
  6. // File: bm_cgps.cxx
  7. //
  8. // Contents: test CoGetPSClsid
  9. //
  10. // Classes: CCGPSTest
  11. //
  12. // History: 07-Oct-95 Rickhi Created
  13. //
  14. //--------------------------------------------------------------------------
  15. #include <headers.cxx>
  16. #pragma hdrstop
  17. #include <bm_cgps.hxx>
  18. extern const IID *iid[];
  19. TCHAR *CCGPSTest::Name ()
  20. {
  21. return TEXT("CoGetPSClsidTest");
  22. }
  23. SCODE CCGPSTest::Setup (CTestInput *pInput)
  24. {
  25. CTestBase::Setup(pInput);
  26. // get iteration count
  27. m_ulIterations = pInput->GetIterations(Name());
  28. // initialize timing arrays
  29. INIT_RESULTS(m_ulCoGetPSClsid);
  30. SCODE sc = InitCOM();
  31. if (FAILED(sc))
  32. {
  33. Log (TEXT("Setup - CoInitialize failed."), sc);
  34. }
  35. return sc;
  36. }
  37. SCODE CCGPSTest::Cleanup ()
  38. {
  39. UninitCOM();
  40. return S_OK;
  41. }
  42. SCODE CCGPSTest::Run ()
  43. {
  44. CStopWatch sw;
  45. CLSID clsid;
  46. for (ULONG iIter=0; iIter<m_ulIterations; iIter++)
  47. {
  48. sw.Reset();
  49. SCODE sc = CoGetPSClsid(*iid[iIter], &clsid);
  50. m_ulCoGetPSClsid[iIter] = sw.Read();
  51. if (FAILED(sc))
  52. {
  53. Log (TEXT("CoGetPSClsid failed."), sc);
  54. }
  55. }
  56. return S_OK;
  57. }
  58. SCODE CCGPSTest::Report (CTestOutput &output)
  59. {
  60. output.WriteSectionHeader (Name(), TEXT("CoGetPSClsid"), *m_pInput);
  61. output.WriteString (TEXT("\n"));
  62. output.WriteResults (TEXT("CoGetPSClsid "), m_ulIterations, m_ulCoGetPSClsid);
  63. return S_OK;
  64. }
  65.