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.

114 lines
2.5 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows NT **/
  3. /** Copyright(c) Microsoft Corp., 1993 **/
  4. /**********************************************************************/
  5. /*
  6. debug.c
  7. This module contains debug support routines for the WINS Service.
  8. FILE HISTORY:
  9. pradeepb 20-July-1993 Created.
  10. */
  11. #include "debug.h"
  12. //#include "winsif.h"
  13. //#include "winsintf.h"
  14. #if DBG
  15. //
  16. // Private constants.
  17. //
  18. #define MAX_PRINTF_OUTPUT 1024 // characters
  19. #define WINSD_OUTPUT_LABEL "WINS"
  20. //
  21. // Private types.
  22. //
  23. //
  24. // Private globals.
  25. //
  26. //
  27. // Public functions.
  28. //
  29. /*******************************************************************
  30. NAME: WinsdAssert
  31. SYNOPSIS: Called if an assertion fails. Displays the failed
  32. assertion, file name, and line number. Gives the
  33. user the opportunity to ignore the assertion or
  34. break into the debugger.
  35. ENTRY: pAssertion - The text of the failed expression.
  36. pFileName - The containing source file.
  37. nLineNumber - The guilty line number.
  38. HISTORY:
  39. KeithMo 07-Mar-1993 Created.
  40. ********************************************************************/
  41. VOID WinsdAssert( VOID * pAssertion,
  42. VOID * pFileName,
  43. ULONG nLineNumber )
  44. {
  45. RtlAssert( pAssertion, pFileName, nLineNumber, NULL );
  46. } // WinsdAssert
  47. /*******************************************************************
  48. NAME: WinsdPrintf
  49. SYNOPSIS: Customized debug output routine.
  50. ENTRY: Usual printf-style parameters.
  51. HISTORY:
  52. KeithMo 07-Mar-1993 Created.
  53. ********************************************************************/
  54. VOID WinsdPrintf( CHAR * pszFormat,
  55. ... )
  56. {
  57. CHAR szOutput[MAX_PRINTF_OUTPUT];
  58. va_list ArgList;
  59. sprintf( szOutput,
  60. "%s (%lu): ",
  61. WINSD_OUTPUT_LABEL,
  62. GetCurrentThreadId() );
  63. va_start( ArgList, pszFormat );
  64. vsprintf( szOutput + strlen(szOutput), pszFormat, ArgList );
  65. va_end( ArgList );
  66. IF_DEBUG( OUTPUT_TO_DEBUGGER )
  67. {
  68. OutputDebugString( (LPCTSTR)szOutput );
  69. }
  70. } // WinsdPrintf
  71. //
  72. // Private functions.
  73. //
  74. #endif // DBG