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.

122 lines
3.7 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. //
  22. // Data structure and type definitions
  23. //
  24. typedef struct _NAME_ENTRY {
  25. struct _NAME_ENTRY *pNext;
  26. DWORD dwOffset;
  27. DWORD dwType;
  28. LPTSTR lpText;
  29. } NAME_ENTRY, *PNAME_ENTRY;
  30. typedef struct _LANGUAGE_LIST_ELEMENT {
  31. struct _LANGUAGE_LIST_ELEMENT *pNextLang; // next lang. list
  32. LPTSTR LangId; // lang ID string for this elem
  33. PNAME_ENTRY pFirstName; // head of name list
  34. PNAME_ENTRY pThisName; // pointer to current entry
  35. DWORD dwNumElements; // number of elements in array
  36. DWORD dwNameBuffSize;
  37. DWORD dwHelpBuffSize;
  38. PBYTE NameBuffer; // buffer to store strings
  39. PBYTE HelpBuffer; // buffer to store help strings
  40. } LANGUAGE_LIST_ELEMENT, *PLANGUAGE_LIST_ELEMENT;
  41. typedef struct _SYMBOL_TABLE_ENTRY {
  42. struct _SYMBOL_TABLE_ENTRY *pNext;
  43. LPTSTR SymbolName;
  44. DWORD Value;
  45. } SYMBOL_TABLE_ENTRY, *PSYMBOL_TABLE_ENTRY;
  46. //
  47. // Utility Routine prototypes for routines in common.c
  48. //
  49. #define StringToInt(in,out) \
  50. (((_stscanf ((in), TEXT(" %d"), (out))) == 1) ? TRUE : FALSE)
  51. #if _INITIALIZE_GLOBALS_
  52. //
  53. //
  54. // Text string Constant definitions
  55. //
  56. const LPTSTR NamesKey = TEXT("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Perflib");
  57. const LPTSTR DefaultLangId = TEXT("009");
  58. const LPTSTR Counters = TEXT("Counters");
  59. const LPTSTR Help = TEXT("Help");
  60. const LPTSTR VersionStr = TEXT("Version");
  61. const LPTSTR LastHelp = TEXT("Last Help");
  62. const LPTSTR LastCounter = TEXT("Last Counter");
  63. const LPTSTR FirstHelp = TEXT("First Help");
  64. const LPTSTR FirstCounter = TEXT("First Counter");
  65. const LPTSTR Busy = TEXT("Updating");
  66. const LPTSTR Slash = TEXT("\\");
  67. const LPTSTR BlankString = TEXT(" ");
  68. const LPSTR BlankAnsiString = " ";
  69. const LPTSTR DriverPathRoot = TEXT("SYSTEM\\CurrentControlSet\\Services");
  70. const LPTSTR Performance = TEXT("Performance");
  71. const LPTSTR CounterNameStr = TEXT("Counter ");
  72. const LPTSTR HelpNameStr = TEXT("Explain ");
  73. const LPTSTR AddCounterNameStr = TEXT("Addcounter ");
  74. const LPTSTR AddHelpNameStr = TEXT("Addexplain ");
  75. //
  76. // Global Buffers
  77. //
  78. TCHAR DisplayStringBuffer[DISP_BUFF_SIZE];
  79. CHAR TextFormat[DISP_BUFF_SIZE];
  80. HANDLE hMod = NULL; // process handle
  81. DWORD dwLastError = ERROR_SUCCESS;
  82. #else // just declare the globals
  83. extern const LPTSTR NamesKey;
  84. extern const LPTSTR VersionStr;
  85. extern const LPTSTR DefaultLangId;
  86. extern const LPTSTR Counters;
  87. extern const LPTSTR Help;
  88. extern const LPTSTR LastHelp;
  89. extern const LPTSTR LastCounter;
  90. extern const LPTSTR FirstHelp;
  91. extern const LPTSTR FirstCounter;
  92. extern const LPTSTR Busy;
  93. extern const LPTSTR Slash;
  94. extern const LPTSTR BlankString;
  95. extern const LPSTR BlankAnsiString;
  96. extern const LPTSTR DriverPathRoot;
  97. extern const LPTSTR Performance;
  98. //
  99. // Global Buffers
  100. //
  101. extern TCHAR DisplayStringBuffer[DISP_BUFF_SIZE];
  102. extern CHAR TextFormat[DISP_BUFF_SIZE];
  103. extern HANDLE hMod;
  104. extern DWORD dwLastError;
  105. #endif // _INITIALIZE_GLOBALS_
  106. #endif // _LODCTR_COMMON_H_