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.

83 lines
1.9 KiB

  1. #include "pch.h"
  2. void _cdecl wmain(int argc, WCHAR * argv[])
  3. {
  4. LONG i = 0;
  5. LONG Iterations = 0;
  6. BOOL b = TRUE;
  7. AUTHZ_AUDIT_INFO_HANDLE hAAI = NULL;
  8. AUTHZ_RESOURCE_MANAGER_HANDLE hRM = NULL;
  9. if (argc != 2)
  10. {
  11. wprintf(L"usage: %s iterations\n", argv[0]);
  12. exit(0);
  13. }
  14. Iterations = wcstol(argv[1], NULL, 10);
  15. wprintf(L"AI Stress. Init / Free AI for %d iters. Press a key to start.\n", Iterations);
  16. getchar();
  17. b = AuthzInitializeResourceManager(
  18. NULL,
  19. NULL,
  20. NULL,
  21. L"Jeff's RM",
  22. 0, // Flags
  23. &hRM
  24. );
  25. if (!b)
  26. {
  27. wprintf(L"AuthzInitializeResourceManager failed with %d\n", GetLastError());
  28. return;
  29. }
  30. for (i = 0; i < Iterations; i++)
  31. {
  32. b = AuthzInitializeAuditInfo(
  33. &hAAI,
  34. 0,
  35. hRM,
  36. NULL,
  37. NULL,
  38. NULL,
  39. INFINITE,
  40. L"",
  41. L"",
  42. L"",
  43. L""
  44. );
  45. if (!b)
  46. {
  47. wprintf(L"AuthzInitializeAuditInfo failed with %d\n", GetLastError());
  48. return;
  49. }
  50. b = AuthzFreeAuditInfo(
  51. hAAI
  52. );
  53. if (!b)
  54. {
  55. wprintf(L"AuthzFreeAuditInfo failed with %d\n", GetLastError());
  56. return;
  57. }
  58. }
  59. b = AuthzFreeResourceManager(
  60. hRM
  61. );
  62. if (!b)
  63. {
  64. wprintf(L"AuthzFreeResourceManager failed with %d\n", GetLastError());
  65. return;
  66. }
  67. wprintf(L"Done. Press a key.\n");
  68. getchar();
  69. }