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.

84 lines
1.1 KiB

  1. /*++
  2. Copyright (c) 1998-1999 Microsoft Corporation
  3. Module Name:
  4. debug.c
  5. Abstract:
  6. This file contains debug support functions. These do not produce any
  7. code in the retail build.
  8. Environment:
  9. User mode
  10. Revision History:
  11. 03/20/98 -srinivac-
  12. Created it
  13. --*/
  14. #include <nt.h>
  15. #include <ntrtl.h>
  16. #include <nturtl.h>
  17. #include <windows.h>
  18. #include <imagehlp.h>
  19. #include <objidl.h>
  20. #include <stdio.h>
  21. #include "symhelp.h"
  22. #include "debug.h"
  23. #if DBG
  24. //
  25. // Variable for maintaining current debug level
  26. //
  27. DWORD gdwDebugLevel = DBG_LEVEL_WARNING;
  28. //
  29. // Global debugging flag
  30. //
  31. DWORD gdwGlobalDbgFlags = 0;
  32. PCSTR
  33. StripDirPrefixA(
  34. PCSTR pszPathName
  35. )
  36. /*++
  37. Routine Description:
  38. Strip the directory prefix off a filename (ANSI version)
  39. Arguments:
  40. pstrFilename - Pointer to filename string
  41. Return Value:
  42. Pointer to the last component of a filename (without directory prefix)
  43. --*/
  44. {
  45. DWORD dwLen = lstrlenA(pszPathName);
  46. pszPathName += dwLen - 1; // go to the end
  47. while (*pszPathName != '\\' && dwLen--)
  48. {
  49. pszPathName--;
  50. }
  51. return pszPathName + 1;
  52. }
  53. #endif // if DBG