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.

77 lines
2.0 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1996 - 1999
  6. //
  7. // File: catadd.cpp
  8. //
  9. // Contents: performance suite
  10. //
  11. // History: 04-Dec-1997 pberkman created
  12. //
  13. //--------------------------------------------------------------------------
  14. #include "global.hxx"
  15. WCHAR *pwszCatFile = L"FILESET\\TCATNT.CAT";
  16. WCHAR *pwszCatFile2 = L"FILESET\\DRIVER.CAT";
  17. DWORD WINAPI TestCatAdd(ThreadData *psData)
  18. {
  19. HCATADMIN hCatAdmin;
  20. HCATINFO hCatInfo;
  21. COleDateTime tStart;
  22. COleDateTime tEnd;
  23. DWORD i;
  24. printf("\n CAT_ADD");
  25. psData->dwTotalProcessed = 0;;
  26. if (!(CryptCATAdminAcquireContext(&hCatAdmin, &gDriver, 0)))
  27. {
  28. return(0);
  29. }
  30. tStart = COleDateTime::GetCurrentTime();
  31. if (hCatInfo = CryptCATAdminAddCatalog(hCatAdmin, pwszCatFile, NULL, 0))
  32. {
  33. CryptCATAdminReleaseCatalogContext(hCatAdmin, hCatInfo, 0);
  34. }
  35. for (i = 0; i < cPasses; i++)
  36. {
  37. if (hCatInfo = CryptCATAdminAddCatalog(hCatAdmin, pwszCatFile2, NULL, 0))
  38. {
  39. CryptCATAdminReleaseCatalogContext(hCatAdmin, hCatInfo, 0);
  40. }
  41. if (hCatInfo = CryptCATAdminAddCatalog(hCatAdmin, pwszCatFile, NULL, 0))
  42. {
  43. CryptCATAdminReleaseCatalogContext(hCatAdmin, hCatInfo, 0);
  44. }
  45. if (hCatInfo = CryptCATAdminAddCatalog(hCatAdmin, pwszCatFile2, NULL, 0))
  46. {
  47. CryptCATAdminReleaseCatalogContext(hCatAdmin, hCatInfo, 0);
  48. }
  49. if (hCatInfo = CryptCATAdminAddCatalog(hCatAdmin, pwszCatFile, NULL, 0))
  50. {
  51. CryptCATAdminReleaseCatalogContext(hCatAdmin, hCatInfo, 0);
  52. }
  53. psData->dwTotalProcessed += 4;
  54. }
  55. tEnd = COleDateTime::GetCurrentTime();
  56. CryptCATAdminReleaseContext(hCatAdmin, 0);
  57. psData->tsTotal = tEnd - tStart;
  58. return(0);
  59. }