Source code of Windows XP (NT5)
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.

180 lines
2.6 KiB

  1. //
  2. //
  3. //***************************************************************************
  4. //
  5. // judyp May 1999
  6. //
  7. //***************************************************************************
  8. #include "stdafx.h"
  9. #pragma warning (disable : 4786)
  10. #pragma warning (disable : 4275)
  11. #include <iostream>
  12. #include <strstream>
  13. #include <fstream>
  14. #include <string>
  15. #include <sstream>
  16. #include <map>
  17. #include <ctime>
  18. #include <list>
  19. using namespace std;
  20. #include <tchar.h>
  21. #include <windows.h>
  22. #ifdef NONNT5
  23. typedef unsigned long ULONG_PTR;
  24. #endif
  25. #include <wmistr.h>
  26. #include <guiddef.h>
  27. #include <initguid.h>
  28. #include <evntrace.h>
  29. #include <WTYPES.H>
  30. #include "t_string.h"
  31. #include "StructureWrappers.h"
  32. #include "StructureWapperHelpers.h"
  33. #include "ConstantMap.h"
  34. #include "TCOData.h"
  35. #include "Persistor.h"
  36. #include "Logger.h"
  37. #include "Utilities.h"
  38. #include "CollectionControl.h"
  39. int QueryAllTracesAPI
  40. (
  41. IN LPTSTR lptstrAction, // For logging only.
  42. OUT int *pAPIReturn // QueryAllTraces API call return
  43. )
  44. {
  45. *pAPIReturn = ERROR_SUCCESS;
  46. int nResult = 0;
  47. t_cout << _T("QueryAllTracesAPI TCO tests 1.6.1.\n");
  48. PEVENT_TRACE_PROPERTIES pPropsArray = NULL;
  49. ULONG ulSessionCount = 0;
  50. // 1.6.1.1
  51. ULONG ulStatus =
  52. QueryAllTraces
  53. (
  54. NULL,
  55. 32,
  56. &ulSessionCount
  57. );
  58. if (ulStatus == ERROR_INVALID_PARAMETER)
  59. {
  60. t_cout << _T("1.6.1.1 - Passed\n");
  61. }
  62. else
  63. {
  64. t_cout << _T("1.6.1.1 - Failed\n");
  65. }
  66. InitializePropsArray(pPropsArray, 4);
  67. // 1.6.1.2
  68. ulStatus =
  69. QueryAllTraces
  70. (
  71. &pPropsArray,
  72. 32,
  73. &ulSessionCount
  74. );
  75. if (ulStatus == ERROR_SUCCESS)
  76. {
  77. t_cout << _T("1.6.1.2 - Passed\n");
  78. }
  79. else
  80. {
  81. t_cout << _T("1.6.1.2 - Failed\n");
  82. }
  83. // 1.6.1.3
  84. ulStatus =
  85. QueryAllTraces
  86. (
  87. &pPropsArray,
  88. 4,
  89. &ulSessionCount
  90. );
  91. if (ulStatus == ERROR_SUCCESS)
  92. {
  93. t_cout << _T("1.6.1.3 - Passed\n");
  94. }
  95. else
  96. {
  97. t_cout << _T("1.6.1.3 - Failed\n");
  98. }
  99. // 1.6.1.4
  100. ulStatus =
  101. QueryAllTraces
  102. (
  103. &pPropsArray,
  104. 0,
  105. &ulSessionCount
  106. );
  107. if (ulStatus == ERROR_INVALID_PARAMETER)
  108. {
  109. t_cout << _T("1.6.1.4 - Passed\n");
  110. }
  111. else
  112. {
  113. t_cout << _T("1.6.1.4 - Failed\n");
  114. }
  115. // 1.6.1.5
  116. ulStatus =
  117. QueryAllTraces
  118. (
  119. &pPropsArray,
  120. 33,
  121. &ulSessionCount
  122. );
  123. if (ulStatus == ERROR_INVALID_PARAMETER)
  124. {
  125. t_cout << _T("1.6.1.5 - Passed\n");
  126. }
  127. else
  128. {
  129. t_cout << _T("1.6.1.5 - Failed\n");
  130. }
  131. // 1.6.1.6
  132. ulStatus =
  133. QueryAllTraces
  134. (
  135. &pPropsArray,
  136. 4,
  137. NULL
  138. );
  139. if (ulStatus == ERROR_INVALID_PARAMETER)
  140. {
  141. t_cout << _T("1.6.1.6 - Passed\n");
  142. }
  143. else
  144. {
  145. t_cout << _T("1.6.1.1 - Failed\n");
  146. }
  147. return ERROR_SUCCESS;
  148. }