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.

96 lines
1.8 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. net\routing\ipx\sap\sapdebug.c
  5. Abstract:
  6. This module provides debugging support for SAP agent
  7. Author:
  8. Vadim Eydelman 05-15-1995
  9. Revision History:
  10. --*/
  11. #include "sapp.h"
  12. DWORD RouterTraceID=INVALID_TRACEID;
  13. HANDLE RouterEventLogHdl=NULL;
  14. DWORD EventLogMask;
  15. /*++
  16. *******************************************************************
  17. D b g I n i t i a l i z e
  18. Routine Description:
  19. Initializes debugging support stuff
  20. Arguments:
  21. hinstDll - dll module instance
  22. Return Value:
  23. None
  24. *******************************************************************
  25. --*/
  26. VOID
  27. DbgInitialize (
  28. HINSTANCE hinstDLL
  29. ) {
  30. RouterTraceID = TraceRegisterExA ("IPXSAP", 0);
  31. RouterEventLogHdl = RouterLogRegisterA ("IPXSAP");
  32. }
  33. /*++
  34. *******************************************************************
  35. D b g S t o p
  36. Routine Description:
  37. Cleanup debugging support stuff
  38. Arguments:
  39. None
  40. Return Value:
  41. None
  42. *******************************************************************
  43. --*/
  44. VOID
  45. DbgStop (
  46. void
  47. ) {
  48. if (RouterTraceID!=INVALID_TRACEID)
  49. TraceDeregisterA (RouterTraceID);
  50. if (RouterEventLogHdl!=NULL)
  51. RouterLogDeregisterA (RouterEventLogHdl);
  52. }
  53. /*++
  54. *******************************************************************
  55. T r a c e
  56. Routine Description:
  57. Printf debugging info to console/file/debugger
  58. Arguments:
  59. None
  60. Return Value:
  61. None
  62. *******************************************************************
  63. --*/
  64. VOID
  65. Trace (
  66. DWORD componentID,
  67. CHAR *format,
  68. ...
  69. ) {
  70. if (RouterTraceID!=INVALID_TRACEID) {
  71. va_list list;
  72. va_start (list, format);
  73. TraceVprintfExA (RouterTraceID,
  74. componentID^TRACE_USE_MASK,
  75. format,
  76. list);
  77. va_end (list);
  78. }
  79. }