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.

140 lines
5.4 KiB

  1. /*++
  2. Copyright (c) 2000, Microsoft Corporation
  3. Module Name:
  4. eldefs.h
  5. Abstract:
  6. The module contains various
  7. . constants
  8. . definitions
  9. . macros
  10. for the following functions:
  11. - memory-allocation
  12. - logging
  13. - tracing
  14. Revision History:
  15. sachins, Apr 23 2000, Created
  16. --*/
  17. #ifndef _EAPOLUI_DEFS_H_
  18. #define _EAPOLUI_DEFS_H_
  19. // Constants
  20. #define TRACEID g_dwTraceId
  21. #define LOGHANDLE g_hLogEvents
  22. // MEMORY ALLOCATION
  23. // MACROS
  24. #define MALLOC(s) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (s))
  25. #define FREE(p) HeapFree(GetProcessHeap(), 0, (p))
  26. //
  27. // TRACING
  28. //
  29. // Definitions
  30. #define EAPOL_TRACE_ANY ((DWORD)0xFFFF0000 | TRACE_USE_MASK)
  31. #define EAPOL_TRACE_EAPOL ((DWORD)0x00010000 | TRACE_USE_MASK)
  32. #define EAPOL_TRACE_EAP ((DWORD)0x00020000 | TRACE_USE_MASK)
  33. #define EAPOL_TRACE_INIT ((DWORD)0x00040000 | TRACE_USE_MASK)
  34. #define EAPOL_TRACE_DEVICE ((DWORD)0x00080000 | TRACE_USE_MASK)
  35. #define EAPOL_TRACE_LOCK ((DWORD)0x00100000 | TRACE_USE_MASK)
  36. #define EAPOL_TRACE_PORT ((DWORD)0x00200000 | TRACE_USE_MASK)
  37. #define EAPOL_TRACE_TIMER ((DWORD)0x00400000 | TRACE_USE_MASK)
  38. #define EAPOL_TRACE_USER ((DWORD)0x00800000 | TRACE_USE_MASK)
  39. #define EAPOL_TRACE_NOTIFY ((DWORD)0x01000000 | TRACE_USE_MASK)
  40. // Macros
  41. //
  42. #if 0
  43. #define TRACE0(l,a) \
  44. if (TRACEID != INVALID_TRACEID) \
  45. TracePrintfExA(TRACEID, EAPOL_TRACE_ ## l, a)
  46. #define TRACE1(l,a,b) \
  47. if (TRACEID != INVALID_TRACEID) \
  48. TracePrintfExA(TRACEID, EAPOL_TRACE_ ## l, a, b)
  49. #define TRACE2(l,a,b,c) \
  50. if (TRACEID != INVALID_TRACEID) \
  51. TracePrintfExA(TRACEID, EAPOL_TRACE_ ## l, a, b, c)
  52. #define TRACE3(l,a,b,c,d) \
  53. if (TRACEID != INVALID_TRACEID) \
  54. TracePrintfExA(TRACEID, EAPOL_TRACE_ ## l, a, b, c, d)
  55. #define TRACE4(l,a,b,c,d,e) \
  56. if (TRACEID != INVALID_TRACEID) \
  57. TracePrintfExA(TRACEID, EAPOL_TRACE_ ## l, a, b, c, d, e)
  58. #define TRACE5(l,a,b,c,d,e,f) \
  59. if (TRACEID != INVALID_TRACEID) \
  60. TracePrintfExA(TRACEID, EAPOL_TRACE_ ## l, a, b, c, d, e, f)
  61. #define TRACE6(l,a,b,c,d,e,f,g) \
  62. if (TRACEID != INVALID_TRACEID) \
  63. TracePrintfExA(TRACEID, EAPOL_TRACE_ ## l, a, b, c, d, e, f, g)
  64. #define EAPOL_DUMPW(pBuf,dwBuf) \
  65. TraceDumpEx(TRACEID, 0x00010000 | TRACE_USE_MASK,(LPBYTE)pbBuf,dwBuf,4,1,NULL)
  66. #define EAPOL_DUMPB(pbBuf,dwBuf) \
  67. TraceDumpEx(TRACEID, 0x00010000 | TRACE_USE_MASK,(LPBYTE)pbBuf,dwBuf,1,0,NULL)
  68. #define EAPOL_DUMPBA(pbBuf,dwBuf) \
  69. TraceDumpExA(TRACEID, 0x00010000 | TRACE_USE_MASK,(LPBYTE)pbBuf,dwBuf,1,0,NULL)
  70. #else
  71. #define TRACE0(l,a)
  72. #define TRACE1(l,a,b)
  73. #define TRACE2(l,a,b,c)
  74. #define TRACE3(l,a,b,c,d)
  75. #define TRACE4(l,a,b,c,d,e)
  76. #define TRACE5(l,a,b,c,d,e,f)
  77. #define TRACE6(l,a,b,c,d,e,f,g)
  78. #define EAPOL_DUMPW(pBuf,dwBuf)
  79. #define EAPOL_DUMPB(pbBuf,dwBuf)
  80. #define EAPOL_DUMPBA(pbBuf,dwBuf)
  81. #endif
  82. //
  83. // EVENT LOGGING
  84. //
  85. #define EapolLogError( LogId, NumStrings, lpwsSubStringArray, dwRetCode ) \
  86. RouterLogError( g_hLogEvents, LogId, NumStrings, lpwsSubStringArray, \
  87. dwRetCode )
  88. #define EapolLogWarning( LogId, NumStrings, lpwsSubStringArray ) \
  89. RouterLogWarning( g_hLogEvents, LogId, NumStrings, lpwsSubStringArray, 0 )
  90. #define EapolLogInformation( LogId, NumStrings, lpwsSubStringArray ) \
  91. RouterLogInformation(g_hLogEvents,LogId, NumStrings, lpwsSubStringArray,0)
  92. #define EapolLogErrorString(LogId,NumStrings,lpwsSubStringArray,dwRetCode, \
  93. dwPos ) \
  94. RouterLogErrorString( g_hLogEvents, LogId, NumStrings, \
  95. lpwsSubStringArray, dwRetCode, dwPos )
  96. #define EapolLogWarningString( LogId,NumStrings,lpwsSubStringArray,dwRetCode, \
  97. dwPos ) \
  98. RouterLogWarningString( g_hLogEvents, LogId, NumStrings, \
  99. lpwsSubStringArray, dwRetCode, dwPos )
  100. #define EapolLogInformationString( LogId, NumStrings, lpwsSubStringArray, \
  101. dwRetCode, dwPos ) \
  102. RouterLogInformationString( g_hLogEvents, LogId, \
  103. NumStrings, lpwsSubStringArray, dwRetCode,dwPos)
  104. #endif // _EAPOLUI_DEFS_H_