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.

115 lines
2.2 KiB

  1. /*++
  2. Copyright (c) 2001- Microsoft Corporation
  3. Module Name:
  4. debug.c
  5. Abstract:
  6. NtLmSsp service debug support
  7. Author:
  8. Larry Zhu (LZhu) 18-September-2001
  9. Revision History:
  10. --*/
  11. #ifdef BLDR_KERNEL_RUNTIME
  12. #include <bootdefs.h>
  13. #endif
  14. #include <security.h>
  15. #include <ntlmsspi.h>
  16. #include <crypt.h>
  17. #include <cred.h>
  18. #include <stdio.h>
  19. #include <stdarg.h>
  20. #include "debug.h"
  21. ULONG
  22. vDbgPrintExWithPrefix(
  23. IN PCH Prefix,
  24. IN ULONG ComponentId,
  25. IN ULONG Level,
  26. IN PCH Format,
  27. va_list arglist
  28. );
  29. #if DEBUGRPC
  30. ULONG SspGlobalDbflag = SSP_CRITICAL | SSP_NTLMV2 | SSP_API;
  31. void
  32. SspPrintRoutine(
  33. IN ULONG DebugFlag,
  34. IN PCHAR pszFormat, // PRINTF()-STYLE FORMAT STRING.
  35. ... // OTHER ARGUMENTS ARE POSSIBLE.
  36. )
  37. {
  38. if (SspGlobalDbflag & DebugFlag)
  39. {
  40. va_list arglist;
  41. PCSTR pszBanner;
  42. switch (DebugFlag)
  43. {
  44. case SSP_INIT:
  45. pszBanner = "[SSP_INIT] ";
  46. break;
  47. case SSP_MISC:
  48. pszBanner = "[SSP_MISC] ";
  49. break;
  50. case SSP_LPC:
  51. case SSP_LPC_MORE:
  52. pszBanner = "[SSP_LPC] ";
  53. break;
  54. case SSP_API:
  55. pszBanner = "[SSP_API] ";
  56. break;
  57. case SSP_API_MORE:
  58. pszBanner = "[SSP_APIMORE] ";
  59. break;
  60. case SSP_NTLMV2:
  61. pszBanner = "[SSP_NTLMV2] ";
  62. break;
  63. case SSP_CRED:
  64. pszBanner = "[SSP_CRED] ";
  65. break;
  66. case SSP_CRITICAL:
  67. pszBanner = "[SSP_CRITICAL] ";
  68. break;
  69. case SSP_WARNING:
  70. pszBanner = "[SSP_WARNING] ";
  71. break;
  72. default:
  73. pszBanner = "[SSP_UNKNOWN] ";
  74. break;
  75. }
  76. va_start(arglist, pszFormat);
  77. vDbgPrintExWithPrefix((PSTR) pszBanner,
  78. -1, // do not know why
  79. 0, // do not know why
  80. pszFormat,
  81. arglist
  82. );
  83. va_end(arglist);
  84. }
  85. }
  86. #endif // DEBUGRPC