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.

174 lines
5.0 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. strtab.h
  5. Abstract:
  6. String table functions in sputils that setupapi needs to know about
  7. but nobody else does
  8. Author:
  9. Jamie Hunter (JamieHun) Jun-27-2000
  10. Revision History:
  11. --*/
  12. #ifdef SPUTILSW
  13. //
  14. // name mangling so the names don't conflict with any in sputilsa.lib
  15. //
  16. #define _pSpUtilsStringTableLookUpString _pSpUtilsStringTableLookUpStringW
  17. #define _pSpUtilsStringTableGetExtraData _pSpUtilsStringTableGetExtraDataW
  18. #define _pSpUtilsStringTableSetExtraData _pSpUtilsStringTableSetExtraDataW
  19. #define _pSpUtilsStringTableAddString _pSpUtilsStringTableAddStringW
  20. #define _pSpUtilsStringTableEnum _pSpUtilsStringTableEnumW
  21. #define _pSpUtilsStringTableStringFromId _pSpUtilsStringTableStringFromIdW
  22. #define _pSpUtilsStringTableTrim _pSpUtilsStringTableTrimW
  23. #define _pSpUtilsStringTableInitialize _pSpUtilsStringTableInitializeW
  24. #define _pSpUtilsStringTableDestroy _pSpUtilsStringTableDestroyW
  25. #define _pSpUtilsStringTableDuplicate _pSpUtilsStringTableDuplicateW
  26. #define _pSpUtilsStringTableInitializeFromMemoryMappedFile _pSpUtilsStringTableInitializeFromMemoryMappedFileW
  27. #define _pSpUtilsStringTableGetDataBlock _pSpUtilsStringTableGetDataBlockW
  28. #define _pSpUtilsStringTableLock _pSpUtilsStringTableLockW
  29. #define _pSpUtilsStringTableUnlock _pSpUtilsStringTableUnlockW
  30. #endif // SPUTILSW
  31. //
  32. // Define an additional private flag for the pStringTable APIs.
  33. // Private flags are added from MSB down; public flags are added
  34. // from LSB up.
  35. //
  36. #define STRTAB_ALREADY_LOWERCASE 0x80000000
  37. //
  38. // Don't change this in a hurry - it requires all INF files to be recompiled
  39. // There might even be other dependencies
  40. //
  41. #define HASH_BUCKET_COUNT 509
  42. //
  43. // Private string table functions that don't do locking. These are
  44. // to be used for optimization purposes by components that already have
  45. // a locking mechanism (e.g., HINF, HDEVINFO).
  46. //
  47. LONG
  48. _pSpUtilsStringTableLookUpString(
  49. IN PVOID StringTable,
  50. IN OUT PTSTR String,
  51. OUT PDWORD StringLength,
  52. OUT PDWORD HashValue, OPTIONAL
  53. OUT PVOID *FindContext, OPTIONAL
  54. IN DWORD Flags,
  55. OUT PVOID ExtraData, OPTIONAL
  56. IN UINT ExtraDataBufferSize OPTIONAL
  57. );
  58. LONG
  59. _pSpUtilsStringTableAddString(
  60. IN PVOID StringTable,
  61. IN OUT PTSTR String,
  62. IN DWORD Flags,
  63. IN PVOID ExtraData, OPTIONAL
  64. IN UINT ExtraDataSize OPTIONAL
  65. );
  66. BOOL
  67. _pSpUtilsStringTableGetExtraData(
  68. IN PVOID StringTable,
  69. IN LONG StringId,
  70. OUT PVOID ExtraData,
  71. IN UINT ExtraDataBufferSize
  72. );
  73. BOOL
  74. _pSpUtilsStringTableSetExtraData(
  75. IN PVOID StringTable,
  76. IN LONG StringId,
  77. IN PVOID ExtraData,
  78. IN UINT ExtraDataSize
  79. );
  80. BOOL
  81. _pSpUtilsStringTableEnum(
  82. IN PVOID StringTable,
  83. OUT PVOID ExtraDataBuffer, OPTIONAL
  84. IN UINT ExtraDataBufferSize, OPTIONAL
  85. IN PSTRTAB_ENUM_ROUTINE Callback,
  86. IN LPARAM lParam OPTIONAL
  87. );
  88. PTSTR
  89. _pSpUtilsStringTableStringFromId(
  90. IN PVOID StringTable,
  91. IN LONG StringId
  92. );
  93. PVOID
  94. _pSpUtilsStringTableDuplicate(
  95. IN PVOID StringTable
  96. );
  97. VOID
  98. _pSpUtilsStringTableDestroy(
  99. IN PVOID StringTable
  100. );
  101. VOID
  102. _pSpUtilsStringTableTrim(
  103. IN PVOID StringTable
  104. );
  105. PVOID
  106. _pSpUtilsStringTableInitialize(
  107. IN UINT ExtraDataSize OPTIONAL
  108. );
  109. DWORD
  110. _pSpUtilsStringTableGetDataBlock(
  111. IN PVOID StringTable,
  112. OUT PVOID *StringTableBlock
  113. );
  114. BOOL
  115. _pSpUtilsStringTableLock(
  116. IN PVOID StringTable
  117. );
  118. VOID
  119. _pSpUtilsStringTableUnlock(
  120. IN PVOID StringTable
  121. );
  122. //
  123. // PNF String table routines
  124. //
  125. PVOID
  126. _pSpUtilsStringTableInitializeFromMemoryMappedFile(
  127. IN PVOID DataBlock,
  128. IN DWORD DataBlockSize,
  129. IN LCID Locale,
  130. IN UINT ExtraDataSize
  131. );
  132. //
  133. // names expected by setupapi (we use the munged names above to stop accidental link errors)
  134. //
  135. #define pStringTableLookUpString _pSpUtilsStringTableLookUpString
  136. #define pStringTableAddString _pSpUtilsStringTableAddString
  137. #define pStringTableGetExtraData _pSpUtilsStringTableGetExtraData
  138. #define pStringTableSetExtraData _pSpUtilsStringTableSetExtraData
  139. #define pStringTableEnum _pSpUtilsStringTableEnum
  140. #define pStringTableStringFromId _pSpUtilsStringTableStringFromId
  141. #define pStringTableDuplicate _pSpUtilsStringTableDuplicate
  142. #define pStringTableDestroy _pSpUtilsStringTableDestroy
  143. #define pStringTableTrim _pSpUtilsStringTableTrim
  144. #define pStringTableInitialize _pSpUtilsStringTableInitialize
  145. #define pStringTableGetDataBlock _pSpUtilsStringTableGetDataBlock
  146. #define InitializeStringTableFromMemoryMappedFile _pSpUtilsStringTableInitializeFromMemoryMappedFile