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.

58 lines
1.4 KiB

  1. //+-----------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (c) Microsoft Corporation 1991 - 1997
  6. //
  7. // File: KSecDD.C
  8. //
  9. // Contents: Base level stuff for the device driver
  10. //
  11. //
  12. // History: 19 May 92, RichardW Blatently stolen from DarrylH
  13. // 15 Dec 97, AdamBa Modified from private\lsa\crypt\ssp
  14. //
  15. //------------------------------------------------------------------------
  16. #include <rdrssp.h>
  17. #if DBG
  18. ULONG KsecInfoLevel;
  19. void
  20. KsecDebugOut(unsigned long Mask,
  21. const char * Format,
  22. ...)
  23. {
  24. PETHREAD pThread;
  25. PEPROCESS pProcess;
  26. va_list ArgList;
  27. char szOutString[256] = {0};
  28. if (KsecInfoLevel & Mask)
  29. {
  30. pThread = PsGetCurrentThread();
  31. pProcess = PsGetCurrentProcess();
  32. va_start(ArgList, Format);
  33. DbgPrint("%#x.%#x> KSec: ", pProcess, pThread);
  34. if (_vsnprintf(szOutString, sizeof(szOutString) - 1, Format, ArgList) < 0)
  35. {
  36. //
  37. // Less than zero indicates that the string could not be
  38. // fitted into the buffer. Output a special message indicating
  39. // that:
  40. //
  41. DbgPrint("Error printing message\n");
  42. }
  43. else
  44. {
  45. DbgPrint(szOutString);
  46. }
  47. }
  48. }
  49. #endif