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.

275 lines
7.7 KiB

  1. /*++ BUILD Version: 0003 // Increment this if a change has global effects
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. winnlsp.h
  5. Abstract:
  6. Private procedure declarations, constant definitions, and macros for the
  7. NLS component.
  8. --*/
  9. #ifndef _WINNLSP_
  10. #define _WINNLSP_
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. //
  15. // Flags for DLL Code Page Translation Function.
  16. //
  17. #define NLS_CP_CPINFO 0x10000000
  18. #define NLS_CP_CPINFOEX 0x20000000
  19. #define NLS_CP_MBTOWC 0x40000000
  20. #define NLS_CP_WCTOMB 0x80000000
  21. #define NORM_STOP_ON_NULL 0x10000000 // stop at the null termination
  22. #define LCMAP_IGNOREDBCS 0x80000000 // don't casemap DBCS characters
  23. #define LOCALE_IGEOID 0x0000005B // geographical location id
  24. //
  25. // LCType to represent the registry locale value
  26. //
  27. #define LOCALE_SLOCALE (-1)
  28. #define DATE_ADDHIJRIDATETEMP 0x80000000 // use AddHijriDateTemp reg value
  29. WINBASEAPI
  30. BOOL
  31. WINAPI
  32. InvalidateNLSCache(void);
  33. //
  34. // This private API is only called by the Complex Script
  35. // Language Pack (CSLPK).
  36. //
  37. ULONG
  38. WINAPI NlsGetCacheUpdateCount(void);
  39. //
  40. // This API is called only from intl.cpl when the user
  41. // locale changes.
  42. //
  43. void
  44. WINAPI
  45. NlsResetProcessLocale(void);
  46. //
  47. // This API is called by system console Apps
  48. //
  49. LANGID
  50. WINAPI
  51. SetThreadUILanguage(WORD wReserved);
  52. //
  53. // This API can be used to verify if a UI language is installed.
  54. //
  55. BOOL
  56. WINAPI
  57. IsValidUILanguage(LANGID UILangID);
  58. //
  59. // These definitions are used by both winnls and base\server
  60. //
  61. //
  62. // Names of Registry Value Entries.
  63. //
  64. #define NLS_VALUE_ACP L"ACP"
  65. #define NLS_VALUE_OEMCP L"OEMCP"
  66. #define NLS_VALUE_MACCP L"MACCP"
  67. #define NLS_VALUE_DEFAULT L"Default"
  68. // User Info
  69. #define NLS_VALUE_LOCALE L"Locale"
  70. #define NLS_VALUE_SLANGUAGE L"sLanguage"
  71. #define NLS_VALUE_ICOUNTRY L"iCountry"
  72. #define NLS_VALUE_SCOUNTRY L"sCountry"
  73. #define NLS_VALUE_SLIST L"sList"
  74. #define NLS_VALUE_IMEASURE L"iMeasure"
  75. #define NLS_VALUE_IPAPERSIZE L"iPaperSize"
  76. #define NLS_VALUE_SDECIMAL L"sDecimal"
  77. #define NLS_VALUE_STHOUSAND L"sThousand"
  78. #define NLS_VALUE_SGROUPING L"sGrouping"
  79. #define NLS_VALUE_IDIGITS L"iDigits"
  80. #define NLS_VALUE_ILZERO L"iLZero"
  81. #define NLS_VALUE_INEGNUMBER L"iNegNumber"
  82. #define NLS_VALUE_SNATIVEDIGITS L"sNativeDigits"
  83. #define NLS_VALUE_IDIGITSUBST L"NumShape"
  84. #define NLS_VALUE_SCURRENCY L"sCurrency"
  85. #define NLS_VALUE_SMONDECIMALSEP L"sMonDecimalSep"
  86. #define NLS_VALUE_SMONTHOUSANDSEP L"sMonThousandSep"
  87. #define NLS_VALUE_SMONGROUPING L"sMonGrouping"
  88. #define NLS_VALUE_ICURRDIGITS L"iCurrDigits"
  89. #define NLS_VALUE_ICURRENCY L"iCurrency"
  90. #define NLS_VALUE_INEGCURR L"iNegCurr"
  91. #define NLS_VALUE_SPOSITIVESIGN L"sPositiveSign"
  92. #define NLS_VALUE_SNEGATIVESIGN L"sNegativeSign"
  93. #define NLS_VALUE_STIMEFORMAT L"sTimeFormat"
  94. #define NLS_VALUE_STIME L"sTime"
  95. #define NLS_VALUE_ITIME L"iTime"
  96. #define NLS_VALUE_ITLZERO L"iTLZero"
  97. #define NLS_VALUE_ITIMEMARKPOSN L"iTimePrefix"
  98. #define NLS_VALUE_S1159 L"s1159"
  99. #define NLS_VALUE_S2359 L"s2359"
  100. #define NLS_VALUE_SSHORTDATE L"sShortDate"
  101. #define NLS_VALUE_SDATE L"sDate"
  102. #define NLS_VALUE_IDATE L"iDate"
  103. #define NLS_VALUE_SYEARMONTH L"sYearMonth"
  104. #define NLS_VALUE_SLONGDATE L"sLongDate"
  105. #define NLS_VALUE_ICALENDARTYPE L"iCalendarType"
  106. #define NLS_VALUE_IFIRSTDAYOFWEEK L"iFirstDayOfWeek"
  107. #define NLS_VALUE_IFIRSTWEEKOFYEAR L"iFirstWeekOfYear"
  108. //
  109. // String constants for CreateSection/OpenSection name string.
  110. //
  111. #define NLS_SECTION_CPPREFIX L"\\NLS\\NlsSectionCP"
  112. #define NLS_SECTION_LANGPREFIX L"\\NLS\\NlsSectionLANG"
  113. #define NLS_SECTION_UNICODE L"\\NLS\\NlsSectionUnicode"
  114. #define NLS_SECTION_LOCALE L"\\NLS\\NlsSectionLocale"
  115. #define NLS_SECTION_CTYPE L"\\NLS\\NlsSectionCType"
  116. #define NLS_SECTION_SORTKEY L"\\NLS\\NlsSectionSortkey"
  117. #define NLS_SECTION_SORTTBLS L"\\NLS\\NlsSectionSortTbls"
  118. #define NLS_SECTION_LANG_INTL L"\\NLS\\NlsSectionLANG_INTL"
  119. #define NLS_SECTION_LANG_EXCEPT L"\\NLS\\NlsSectionLANG_EXCEPT"
  120. #define NLS_SECTION_GEO L"\\NLS\\NlsSectionGeo"
  121. //
  122. // Unicode file names.
  123. // These files will always be installed by setup in the system directory,
  124. // so there is no need to put these names in the registry.
  125. //
  126. #define NLS_FILE_UNICODE L"unicode.nls"
  127. #define NLS_FILE_LOCALE L"locale.nls"
  128. #define NLS_FILE_CTYPE L"ctype.nls"
  129. #define NLS_FILE_SORTKEY L"sortkey.nls"
  130. #define NLS_FILE_SORTTBLS L"sorttbls.nls"
  131. #define NLS_FILE_LANG_INTL L"l_intl.nls"
  132. #define NLS_FILE_LANG_EXCEPT L"l_except.nls"
  133. #define NLS_FILE_GEO L"geo.nls"
  134. //
  135. // Default file names if registry is corrupt.
  136. //
  137. #define NLS_DEFAULT_FILE_ACP L"c_1252.nls"
  138. #define NLS_DEFAULT_FILE_OEMCP L"c_437.nls"
  139. //
  140. // Default section names if registry is corrupt.
  141. //
  142. #define NLS_DEFAULT_SECTION_ACP L"\\NLS\\NlsSectionCP1252"
  143. #define NLS_DEFAULT_SECTION_OEMCP L"\\NLS\\NlsSectionCP437"
  144. #ifdef _WINDOWS_BASE
  145. //
  146. // winnls routines that are called from base\server. The prototypes must
  147. // continue to match the typedefs.
  148. //
  149. typedef ULONG
  150. (*PNLS_CONVERT_INTEGER_TO_STRING)(
  151. UINT Value,
  152. UINT Base,
  153. UINT Padding,
  154. LPWSTR pResultBuf,
  155. UINT Size);
  156. ULONG
  157. NlsConvertIntegerToString(
  158. UINT Value,
  159. UINT Base,
  160. UINT Padding,
  161. LPWSTR pResultBuf,
  162. UINT Size);
  163. typedef BOOL
  164. (*PGET_CP_FILE_NAME_FROM_REGISTRY)(
  165. UINT CodePage,
  166. LPWSTR pResultBuf,
  167. UINT Size);
  168. BOOL
  169. GetCPFileNameFromRegistry(
  170. UINT CodePage,
  171. LPWSTR pResultBuf,
  172. UINT Size);
  173. typedef ULONG
  174. (*PCREATE_NLS_SECURITY_DESCRIPTOR)(
  175. PSECURITY_DESCRIPTOR pSecurityDescriptor,
  176. UINT SecurityDescriptorSize,
  177. ACCESS_MASK AccessMask);
  178. ULONG
  179. CreateNlsSecurityDescriptor(
  180. PSECURITY_DESCRIPTOR pSecurityDescriptor,
  181. UINT SecurityDescriptorSize,
  182. ACCESS_MASK AccessMask);
  183. typedef ULONG
  184. (*PGET_NLS_SECTION_NAME)(
  185. UINT Value,
  186. UINT Base,
  187. UINT Padding,
  188. LPWSTR pwszPrefix,
  189. LPWSTR pwszSecName,
  190. UINT cchSecName);
  191. ULONG
  192. GetNlsSectionName(
  193. UINT Value,
  194. UINT Base,
  195. UINT Padding,
  196. LPWSTR pwszPrefix,
  197. LPWSTR pwszSecName,
  198. UINT cchSecName);
  199. typedef WINBASEAPI BOOL
  200. (WINAPI *PIS_VALID_CODEPAGE)(
  201. UINT CodePage);
  202. WINBASEAPI BOOL WINAPI
  203. IsValidCodePage(
  204. UINT CodePage);
  205. typedef ULONG
  206. (*POPEN_DATA_FILE)(HANDLE *phFile, LPWSTR pFile);
  207. ULONG OpenDataFile(HANDLE *phFile, LPWSTR pFile);
  208. typedef ULONG
  209. (*PGET_DEFAULT_SORTKEY_SIZE)(PLARGE_INTEGER pSize);
  210. ULONG GetDefaultSortkeySize(PLARGE_INTEGER pSize);
  211. typedef ULONG
  212. (*PGET_LINGUIST_LANG_SIZE)(PLARGE_INTEGER pSize);
  213. ULONG GetLinguistLangSize(PLARGE_INTEGER pSize);
  214. typedef BOOL
  215. (*PVALIDATE_LOCALE)(LCID Locale);
  216. BOOL ValidateLocale(LCID Locale);
  217. typedef BOOL
  218. (*PVALIDATE_LCTYPE)(PVOID pInfo, LCTYPE LCType, LPWSTR *ppwReg, LPWSTR *ppwCache);
  219. BOOL ValidateLCType(PNLS_USER_INFO pInfo, LCTYPE LCType, LPWSTR *ppwReg, LPWSTR *ppwCache);
  220. typedef BOOL
  221. (*PNLS_LOAD_STRING_EX_W)(HMODULE hModule, UINT wID, LPWSTR lpBuffer, int cchBufferMax, WORD wLangId);
  222. int NlsLoadStringExW(HMODULE hModule, UINT wID, LPWSTR lpBuffer, int cchBufferMax, WORD wLangId);
  223. #endif // _WINDOWS_BASE
  224. #ifdef __cplusplus
  225. }
  226. #endif
  227. #endif // _WINNLSP_