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.

144 lines
3.8 KiB

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include <windows.h>
  5. #include <tchar.h>
  6. #define MAX_SYM_ERR 500
  7. #define IGNORE_IF_SPLIT 0x1
  8. #define ERROR_IF_SPLIT 0x2
  9. #define ERROR_IF_NOT_SPLIT 0x4
  10. typedef struct _EXCLUDE_LIST {
  11. LPTSTR *szExcList; // Pointers to the file names
  12. DWORD dNumFiles;
  13. } EXCLUDE_LIST, *PEXCLUDE_LIST;
  14. PEXCLUDE_LIST
  15. GetExcludeList(
  16. LPTSTR szFileName
  17. );
  18. BOOL
  19. InExcludeList(
  20. LPTSTR szFileName,
  21. PEXCLUDE_LIST pExcludeList
  22. );
  23. BOOL
  24. CheckSymbols (
  25. LPTSTR ErrMsg,
  26. LPTSTR szSearchpath,
  27. LPTSTR szFileName,
  28. FILE *hSymCDLog,
  29. ULONG SymchkFlag,
  30. BOOL Verbose,
  31. LPTSTR szRSDSDllToLoad
  32. );
  33. // Stuff for logging the errors
  34. #define NO_DEBUG_DIRECTORIES 10
  35. #define NO_DEBUG_DIRECTORIES_IN_DBG_HEADER 11
  36. #define NO_MISC_ENTRY 12
  37. #define NO_FILE_IN_MISC 13
  38. #define NO_CODE_VIEW 15
  39. #define CREATE_FILE_FAILED 16
  40. #define CREATE_FILE_MAPPING_FAILED 17
  41. #define MAPVIEWOFFILE_FAILED 18
  42. #define GET_FILE_INFO_FAILED 19
  43. #define HEADER_NOT_ON_LONG_BOUNDARY 20
  44. #define IMAGE_BIGGER_THAN_FILE 21
  45. #define NO_DOS_HEADER 22
  46. #define NOT_NT_IMAGE 23
  47. #define IMAGE_PASSED 24
  48. #define RESOURCE_ONLY_DLL 25
  49. #define FILE_NOT_FOUND 26
  50. #define EXTRA_RAW_DATA_IN_6 27
  51. #define INVALID_POINTERTORAWDATA_NON_ZERO 28
  52. #define INVALID_ADDRESSOFRAWDATA_ZERO_DEBUG 29
  53. #define INVALID_POINTERTORAWDATA_ZERO_DEBUG 30
  54. #define PRIVATE_INFO_NOT_REMOVED 31
  55. #define PDB_MAY_BE_CORRUPT 32
  56. #define SIGNED_AND_NON_SPLIT 33
  57. #define CANNOT_LOAD_RSDS 34
  58. #define MAX_PDB_ERR 200
  59. typedef struct _SymErr {
  60. BOOL Verbose;
  61. UINT ErrNo; // Error message number
  62. UINT ErrNo2; // Additional error number
  63. TCHAR szFileName[_MAX_FNAME]; // Image file
  64. TCHAR szSymbolFileName[_MAX_FNAME]; // Full path and name of DBG file
  65. TCHAR szSymbolSearchPath[_MAX_PATH]; // ; delimited symbol search path
  66. BOOL SymbolFileFound; // Was a DBG file found
  67. BOOL SizeOfImageMatch; // Does size of image match between
  68. // image and the DBG?
  69. BOOL CheckSumsMatch; // Do Checksums match between the
  70. // image and the DBG
  71. BOOL TimeDateStampsMatch; // Do TimeDateStampsMatch between
  72. // the image and the DBG
  73. BOOL PdbFileFound; // Pdb with correct name was located
  74. BOOL PdbValid; // Pdb opens and validates
  75. TCHAR szPdbErr[MAX_PDB_ERR]; // Pdb error message
  76. TCHAR szPdbFileName[_MAX_FNAME]; // Full path and name of Pdb file
  77. } SYM_ERR, *PSYM_ERR;
  78. BOOL
  79. LogError(
  80. LPTSTR ErrMsg,
  81. PSYM_ERR pSymErr,
  82. UINT ErrNo
  83. );
  84. BOOL
  85. LogDbgError(
  86. LPTSTR ErrMsg,
  87. PSYM_ERR pSymErr
  88. );
  89. BOOL
  90. LogPdbError(
  91. LPTSTR ErrMsg,
  92. PSYM_ERR pSymErr
  93. );
  94. int __cdecl
  95. SymComp2(
  96. const void *e1,
  97. const void *e2
  98. );
  99. typedef struct _LIST_ELEM {
  100. CHAR FName[_MAX_PATH];
  101. CHAR Path[_MAX_PATH];
  102. } LIST_ELEM, *P_LIST_ELEM;
  103. typedef struct _LIST {
  104. LIST_ELEM *List; // Pointers to the file names
  105. DWORD dNumFiles;
  106. } LIST, *P_LIST;
  107. P_LIST
  108. GetList(
  109. LPTSTR szFileName
  110. );
  111. BOOL
  112. InList(
  113. LPTSTR szFileName,
  114. P_LIST pExcludeList
  115. );
  116. // Global variables
  117. extern BOOL CheckPrivate;
  118. extern PEXCLUDE_LIST pErrorFilterList;
  119. extern P_LIST pCDIncludeList;
  120. extern BOOL Recurse;
  121. extern BOOL CheckCodeView;
  122. extern BOOL LogCheckSumErrors;