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.

159 lines
3.6 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. common.h
  4. constants and globals that are common to LODCTR and UNLODCTR
  5. Author:
  6. Bob Watson (a-robw) 10 Feb 93
  7. Revision History:
  8. --*/
  9. #ifndef _LODCTR_COMMON_H_
  10. #define _LODCTR_COMMON_H_
  11. //
  12. // Local constants
  13. //
  14. #define RESERVED 0L
  15. #define LARGE_BUFFER_SIZE 0x10000 // 64K
  16. #define MEDIUM_BUFFER_SIZE 0x8000 // 32K
  17. #define SMALL_BUFFER_SIZE 0x1000 // 4K
  18. #define FILE_NAME_BUFFER_SIZE MAX_PATH
  19. #define DISP_BUFF_SIZE 256L
  20. #define SIZE_OF_OFFSET_STRING 15
  21. #define PERFLIB_BASE_INDEX 1847
  22. #define FIRST_EXT_COUNTER_INDEX 1848
  23. #define FIRST_EXT_HELP_INDEX 1849
  24. #define H_MUTEX_TIMEOUT 10000L
  25. #define LODCTR_UPNF_RESTORE 0x00000001
  26. //
  27. // Data structure and type definitions
  28. //
  29. typedef struct _NAME_ENTRY {
  30. struct _NAME_ENTRY *pNext;
  31. DWORD dwOffset;
  32. DWORD dwType;
  33. LPTSTR lpText;
  34. } NAME_ENTRY, *PNAME_ENTRY;
  35. typedef struct _LANGUAGE_LIST_ELEMENT {
  36. struct _LANGUAGE_LIST_ELEMENT *pNextLang; // next lang. list
  37. LPTSTR LangId; // lang ID string for this elem
  38. PNAME_ENTRY pFirstName; // head of name list
  39. PNAME_ENTRY pThisName; // pointer to current entry
  40. DWORD dwNumElements; // number of elements in array
  41. DWORD dwNameBuffSize;
  42. DWORD dwHelpBuffSize;
  43. PBYTE NameBuffer; // buffer to store strings
  44. PBYTE HelpBuffer; // buffer to store help strings
  45. } LANGUAGE_LIST_ELEMENT, *PLANGUAGE_LIST_ELEMENT;
  46. typedef struct _SYMBOL_TABLE_ENTRY {
  47. struct _SYMBOL_TABLE_ENTRY *pNext;
  48. LPTSTR SymbolName;
  49. DWORD Value;
  50. } SYMBOL_TABLE_ENTRY, *PSYMBOL_TABLE_ENTRY;
  51. //
  52. // Utility Routine prototypes for routines in common.c
  53. //
  54. #define StringToInt(in,out) \
  55. (((_stscanf ((in), (LPCTSTR)TEXT(" %d"), (out))) == 1) ? TRUE : FALSE)
  56. LPCTSTR
  57. GetStringResource (
  58. UINT wStringId
  59. );
  60. LPCTSTR
  61. GetFormatResource (
  62. UINT wStringId
  63. );
  64. VOID
  65. DisplayCommandHelp (
  66. UINT iFirstLine,
  67. UINT iLastLine
  68. );
  69. BOOL
  70. TrimSpaces (
  71. IN OUT LPTSTR szString
  72. );
  73. BOOL
  74. IsDelimiter (
  75. IN TCHAR cChar,
  76. IN TCHAR cDelimiter
  77. );
  78. LPCTSTR
  79. GetItemFromString (
  80. IN LPCTSTR szEntry,
  81. IN DWORD dwItem,
  82. IN TCHAR cDelimiter
  83. );
  84. BOOLEAN LoadPerfGrabMutex();
  85. void
  86. ReportLoadPerfEvent(
  87. IN WORD EventType,
  88. IN DWORD EventID,
  89. IN DWORD dwDataCount,
  90. IN DWORD dwData1,
  91. IN DWORD dwData2,
  92. IN DWORD dwData3,
  93. IN WORD wStringCount,
  94. IN LPWSTR szString1,
  95. IN LPWSTR szString2,
  96. IN LPWSTR szString3
  97. );
  98. // defined in dumpload.c
  99. DWORD
  100. BackupPerfRegistryToFileW (
  101. IN LPCWSTR szFileName,
  102. IN LPCWSTR szCommentString
  103. );
  104. DWORD
  105. RestorePerfRegistryFromFileW (
  106. IN LPCWSTR szFileName,
  107. IN LPCWSTR szLangId
  108. );
  109. extern LPCTSTR NamesKey;
  110. extern LPCTSTR DefaultLangId;
  111. extern LPCTSTR DefaultLangTag;
  112. extern LPCTSTR Counters;
  113. extern LPCTSTR Help;
  114. extern LPCTSTR LastHelp;
  115. extern LPCTSTR LastCounter;
  116. extern LPCTSTR FirstHelp;
  117. extern LPCTSTR cszFirstCounter;
  118. extern LPCTSTR Busy;
  119. extern LPCTSTR Slash;
  120. extern LPCTSTR BlankString;
  121. extern LPCTSTR DriverPathRoot;
  122. extern LPCTSTR Performance;
  123. extern LPCTSTR CounterNameStr;
  124. extern LPCTSTR HelpNameStr;
  125. extern LPCTSTR AddCounterNameStr;
  126. extern LPCTSTR AddHelpNameStr;
  127. extern LPCTSTR VersionStr;
  128. extern LPCTSTR szObjectList;
  129. extern LPCTSTR szLibraryValidationCode;
  130. extern HANDLE hEventLog;
  131. extern HANDLE hLoadPerfMutex;
  132. #endif // _LODCTR_COMMON_H_