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.

144 lines
2.7 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation, 1998 - 1999
  3. Module Name:
  4. cspTrace
  5. Abstract:
  6. This header file encapsulates the common definitions shared among the
  7. modules of the cspTrace utility.
  8. Author:
  9. Doug Barlow (dbarlow) 5/16/1998
  10. Remarks:
  11. ?Remarks?
  12. Notes:
  13. ?Notes?
  14. --*/
  15. #ifndef _CSPTRACE_H_
  16. #define _CSPTRACE_H_
  17. #define ACTION(x) g_szMajorAction = TEXT(x);
  18. #define SUBACTION(x) g_szMinorAction = TEXT(x);
  19. extern LPCTSTR g_szMajorAction;
  20. extern LPCTSTR g_szMinorAction;
  21. //
  22. // Definitions duplicated from logcsp.
  23. //
  24. typedef enum
  25. {
  26. AcquireContext = 0,
  27. GetProvParam,
  28. ReleaseContext,
  29. SetProvParam,
  30. DeriveKey,
  31. DestroyKey,
  32. ExportKey,
  33. GenKey,
  34. GetKeyParam,
  35. GenRandom,
  36. GetUserKey,
  37. ImportKey,
  38. SetKeyParam,
  39. Encrypt,
  40. Decrypt,
  41. CreateHash,
  42. DestroyHash,
  43. GetHashParam,
  44. HashData,
  45. HashSessionKey,
  46. SetHashParam,
  47. SignHash,
  48. VerifySignature,
  49. Undefined
  50. } LogTypeId;
  51. typedef enum
  52. {
  53. logid_False = 0,
  54. logid_True,
  55. logid_Exception
  56. } CompletionCode;
  57. typedef struct
  58. {
  59. DWORD cbLength;
  60. DWORD cbDataOffset;
  61. LogTypeId id;
  62. CompletionCode status;
  63. DWORD dwStatus;
  64. DWORD dwProcId;
  65. DWORD dwThreadId;
  66. SYSTEMTIME startTime;
  67. SYSTEMTIME endTime;
  68. } LogHeader;
  69. typedef struct {
  70. DWORD cbOffset;
  71. DWORD cbLength;
  72. } LogBuffer;
  73. //
  74. // Application definitions
  75. //
  76. typedef struct {
  77. DWORD dwValue;
  78. LPCTSTR szValue;
  79. } ValueMap;
  80. extern void
  81. DoShowTrace(
  82. IN LPCTSTR szInFile);
  83. extern void
  84. DoTclTrace(
  85. IN LPCTSTR szInFile);
  86. extern LPCTSTR
  87. FindLogCsp(
  88. void);
  89. extern LPCTSTR
  90. FindLoggedCsp(
  91. void);
  92. #define PHex(x) TEXT("0x") << hex << setw(8) << setfill(TEXT('0')) << (x)
  93. #define PDec(x) dec << setw(0) << setfill(TEXT(' ')) << (x)
  94. #define MAP(x) { x, TEXT(#x) }
  95. #define PTime(x) dec \
  96. << setw(2) << setfill(TEXT('0')) << (x).wHour << TEXT(":") \
  97. << setw(2) << setfill(TEXT('0')) << (x).wMinute << TEXT(":") \
  98. << setw(2) << setfill(TEXT('0')) << (x).wSecond << TEXT(".") \
  99. << setw(3) << setfill(TEXT('0')) << (x).wMilliseconds
  100. extern const ValueMap rgMapService[];
  101. extern const ValueMap rgMapAcquireFlags[];
  102. extern const ValueMap rgMapGetProvParam[];
  103. extern const ValueMap rgMapGetProvFlags[];
  104. extern const ValueMap rgMapSetProvParam[];
  105. extern const ValueMap rgMapHashParam[];
  106. extern const ValueMap rgMapGenKeyFlags[];
  107. extern const ValueMap rgMapDeriveKeyFlags[];
  108. extern const ValueMap rgMapExportKeyFlags[];
  109. extern const ValueMap rgMapKeyParam[];
  110. extern const ValueMap rgMapKeyId[];
  111. extern const ValueMap rgMapBlobType[];
  112. extern const ValueMap rgMapAlgId[];
  113. #endif // _CSPTRACE_H_