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.

546 lines
9.6 KiB

  1. /*++
  2. Copyright (c) 1994-2000, Microsoft Corporation All rights reserved.
  3. Module Name:
  4. util.h
  5. Abstract:
  6. This module contains the header information for the utility functions
  7. of the Regional Options applet.
  8. Revision History:
  9. --*/
  10. #ifndef _UTIL_H_
  11. #define _UTIL_H_
  12. //
  13. // Include Files.
  14. //
  15. #include "intl.h"
  16. //
  17. // Constant Declarations.
  18. //
  19. #define MB_OK_OOPS (MB_OK | MB_ICONEXCLAMATION) // msg box flags
  20. #define MB_YN_OOPS (MB_YESNO | MB_ICONEXCLAMATION) // msg box flags
  21. #define MAX_UI_LANG_GROUPS 64
  22. //
  23. // Global Variables.
  24. //
  25. extern const TCHAR c_szEventSourceName[];
  26. extern const TCHAR c_szEventRegistryPath[];
  27. //
  28. // Typedef Declarations.
  29. //
  30. typedef struct
  31. {
  32. LPARAM Changes; // flags to denote changes
  33. DWORD dwCurUserLocale; // index of current user locale setting in combo box
  34. DWORD dwCurUserRegion; // index of current user region setting in combo box
  35. DWORD dwCurUILang; // index of current UI Language setting in combo box
  36. DWORD dwLastUserLocale; // index of the last user locale setting in combo box
  37. } REGDLGDATA, *LPREGDLGDATA;
  38. typedef struct languagegroup_s
  39. {
  40. WORD wStatus; // status flags
  41. UINT LanguageGroup; // language group value
  42. DWORD LanguageCollection; // collection which belong the language group
  43. HANDLE hLanguageGroup; // handle to free for this structure
  44. TCHAR pszName[MAX_PATH]; // name of language group
  45. UINT NumLocales; // number of locales in pLocaleList
  46. LCID pLocaleList[MAX_PATH]; // ptr to locale list for this group
  47. UINT NumAltSorts; // number of alternate sorts in pAltSortList
  48. LCID pAltSortList[MAX_PATH]; // ptr to alternate sorts for this group
  49. struct languagegroup_s *pNext; // ptr to next language group node
  50. } LANGUAGEGROUP, *LPLANGUAGEGROUP;
  51. typedef struct codepage_s
  52. {
  53. WORD wStatus; // status flags
  54. UINT CodePage; // code page value
  55. HANDLE hCodePage; // handle to free for this structure
  56. TCHAR pszName[MAX_PATH]; // name of code page
  57. struct codepage_s *pNext; // ptr to next code page node
  58. } CODEPAGE, *LPCODEPAGE;
  59. //
  60. // Language group of UI languages.
  61. //
  62. typedef struct
  63. {
  64. int iCount;
  65. LGRPID lgrp[MAX_UI_LANG_GROUPS];
  66. } UILANGUAGEGROUP, *PUILANGUAGEGROUP;
  67. //
  68. // Functions Prototypes.
  69. //
  70. LONG
  71. Intl_StrToLong(
  72. LPTSTR szNum);
  73. DWORD
  74. TransNum(
  75. LPTSTR lpsz);
  76. BOOL
  77. Item_Has_Digits(
  78. HWND hDlg,
  79. int nItemId,
  80. BOOL Allow_Empty);
  81. BOOL
  82. Item_Has_Digits_Or_Invalid_Chars(
  83. HWND hDlg,
  84. int nItemId,
  85. BOOL Allow_Empty,
  86. LPTSTR pInvalid);
  87. BOOL
  88. Item_Check_Invalid_Chars(
  89. HWND hDlg,
  90. LPTSTR lpszBuf,
  91. LPTSTR lpCkChars,
  92. int nCkIdStr,
  93. BOOL Allow_Empty,
  94. LPTSTR lpChgCase,
  95. int nItemId);
  96. void
  97. No_Numerals_Error(
  98. HWND hDlg,
  99. int nItemId,
  100. int iStrId);
  101. void
  102. Invalid_Chars_Error(
  103. HWND hDlg,
  104. int nItemId,
  105. int iStrId);
  106. void
  107. Localize_Combobox_Styles(
  108. HWND hDlg,
  109. int nItemId,
  110. LCTYPE LCType);
  111. BOOL
  112. NLSize_Style(
  113. HWND hDlg,
  114. int nItemId,
  115. LPTSTR lpszOutBuf,
  116. LCTYPE LCType);
  117. BOOL
  118. Set_Locale_Values(
  119. HWND hDlg,
  120. LCTYPE LCType,
  121. int nItemId,
  122. LPTSTR lpIniStr,
  123. BOOL bValue,
  124. int Ordinal_Offset,
  125. LPTSTR Append_Str,
  126. LPTSTR NLS_Str);
  127. BOOL
  128. Set_List_Values(
  129. HWND hDlg,
  130. int nItemId,
  131. LPTSTR lpValueString);
  132. void
  133. DropDown_Use_Locale_Values(
  134. HWND hDlg,
  135. LCTYPE LCType,
  136. int nItemId);
  137. BOOL CALLBACK
  138. EnumProc(
  139. LPTSTR lpValueString);
  140. BOOL CALLBACK
  141. EnumProcEx(
  142. LPTSTR lpValueString,
  143. LPTSTR lpDecimalString,
  144. LPTSTR lpNegativeString,
  145. LPTSTR lpSymbolString);
  146. typedef BOOL (CALLBACK* LEADINGZEROS_ENUMPROC)(LPTSTR, LPTSTR, LPTSTR, LPTSTR);
  147. typedef BOOL (CALLBACK* NEGNUMFMT_ENUMPROC)(LPTSTR, LPTSTR, LPTSTR, LPTSTR);
  148. typedef BOOL (CALLBACK* MEASURESYSTEM_ENUMPROC)(LPTSTR);
  149. typedef BOOL (CALLBACK* POSCURRENCY_ENUMPROC)(LPTSTR, LPTSTR, LPTSTR, LPTSTR);
  150. typedef BOOL (CALLBACK* NEGCURRENCY_ENUMPROC)(LPTSTR, LPTSTR, LPTSTR, LPTSTR);
  151. BOOL
  152. EnumLeadingZeros(
  153. LEADINGZEROS_ENUMPROC lpLeadingZerosEnumProc,
  154. LCID LCId,
  155. DWORD dwFlags);
  156. BOOL
  157. EnumNegNumFmt(
  158. NEGNUMFMT_ENUMPROC lpNegNumFmtEnumProc,
  159. LCID LCId,
  160. DWORD dwFlags);
  161. BOOL
  162. EnumMeasureSystem(
  163. MEASURESYSTEM_ENUMPROC lpMeasureSystemEnumProc,
  164. LCID LCId,
  165. DWORD dwFlags);
  166. BOOL
  167. EnumPosCurrency(
  168. POSCURRENCY_ENUMPROC lpPosCurrencyEnumProc,
  169. LCID LCId,
  170. DWORD dwFlags);
  171. BOOL
  172. EnumNegCurrency(
  173. NEGCURRENCY_ENUMPROC lpNegCurrencyEnumProc,
  174. LCID LCId,
  175. DWORD dwFlags);
  176. void
  177. CheckEmptyString(
  178. LPTSTR lpStr);
  179. void
  180. SetDlgItemRTL(
  181. HWND hDlg,
  182. UINT uItem);
  183. int
  184. ShowMsg(
  185. HWND hDlg,
  186. UINT iMsg,
  187. UINT iTitle,
  188. UINT iType,
  189. LPTSTR pString);
  190. void
  191. SetControlReadingOrder(
  192. BOOL bUseRightToLeft,
  193. HWND hwnd);
  194. void
  195. Intl_EnumLocales(
  196. HWND hDlg,
  197. HWND hLocale,
  198. BOOL EnumSystemLocales);
  199. BOOL CALLBACK
  200. Intl_EnumInstalledCPProc(
  201. LPTSTR pString);
  202. BOOL
  203. Intl_InstallKeyboardLayout(
  204. HWND hDlg,
  205. LCID Locale,
  206. DWORD Layout,
  207. BOOL bDefaultLayout,
  208. BOOL bDefaultUser,
  209. BOOL bSystemLocale);
  210. BOOL
  211. Intl_InstallKeyboardLayoutList(
  212. PINFCONTEXT pContext,
  213. DWORD dwStartField,
  214. BOOL bDefaultUserCase);
  215. BOOL
  216. Intl_InstallAllKeyboardLayout(
  217. LANGID Language);
  218. BOOL
  219. Intl_UninstallAllKeyboardLayout(
  220. UINT uiLangGp,
  221. BOOL DefaultUserCase);
  222. HKL
  223. Intl_GetHKL(
  224. DWORD dwLocale,
  225. DWORD dwLayout);
  226. BOOL
  227. Intl_GetDefaultLayoutFromInf(
  228. LPDWORD pdwLocale,
  229. LPDWORD pdwLayout);
  230. BOOL
  231. Intl_GetSecondValidLayoutFromInf(
  232. LPDWORD pdwLocale,
  233. LPDWORD pdwLayout);
  234. BOOL
  235. Intl_InitInf(
  236. HWND hDlg,
  237. HINF *phIntlInf,
  238. LPTSTR pszInf,
  239. HSPFILEQ *pFileQueue,
  240. PVOID *pQueueContext);
  241. BOOL
  242. Intl_OpenIntlInfFile(
  243. HINF *phInf);
  244. void
  245. Intl_CloseInf(
  246. HINF hIntlInf,
  247. HSPFILEQ FileQueue,
  248. PVOID QueueContext);
  249. BOOL
  250. Intl_ReadDefaultLayoutFromInf(
  251. LPDWORD pdwLocale,
  252. LPDWORD pdwLayout,
  253. HINF hIntlInf);
  254. BOOL
  255. Intl_ReadSecondValidLayoutFromInf(
  256. LPDWORD pdwLocale,
  257. LPDWORD pdwLayout,
  258. HINF hIntlInf);
  259. BOOL
  260. Intl_CloseInfFile(
  261. HINF *phInf);
  262. BOOL
  263. Intl_IsValidLayout(
  264. DWORD dwLayout);
  265. void
  266. Intl_RunRegApps(
  267. LPCTSTR pszRegKey);
  268. VOID
  269. Intl_RebootTheSystem(BOOL bRestart);
  270. BOOL
  271. Intl_InstallUserLocale(
  272. LCID Locale,
  273. BOOL bDefaultUserCase,
  274. BOOL bChangeLocaleInfo);
  275. void
  276. Intl_SetLocaleInfo(
  277. LCID Locale,
  278. LCTYPE LCType,
  279. LPTSTR lpIniStr,
  280. BOOL bDefaultUserCase);
  281. void
  282. Intl_AddPage(
  283. LPPROPSHEETHEADER ppsh,
  284. UINT id,
  285. DLGPROC pfn,
  286. LPARAM lParam,
  287. UINT iMaxPages);
  288. void
  289. Intl_AddExternalPage(
  290. LPPROPSHEETHEADER ppsh,
  291. UINT id,
  292. HINSTANCE hInst,
  293. LPSTR ProcName,
  294. UINT iMaxPages);
  295. int
  296. Intl_SetDefaultUserLocaleInfo(
  297. LPCTSTR lpKeyName,
  298. LPCTSTR lpString);
  299. void
  300. Intl_DeleteRegKeyValues(
  301. HKEY hKey);
  302. DWORD
  303. Intl_DeleteRegTree(
  304. HKEY hStartKey,
  305. LPTSTR pKeyName);
  306. void
  307. Intl_DeleteRegSubKeys(
  308. HKEY hKey);
  309. DWORD
  310. Intl_CopyRegKeyValues(
  311. HKEY hSrc,
  312. HKEY hDest);
  313. DWORD
  314. Intl_CreateRegTree(
  315. HKEY hSrc,
  316. HKEY hDest);
  317. HKEY
  318. Intl_LoadNtUserHive(
  319. LPCTSTR lpRoot,
  320. LPCTSTR lpKeyName,
  321. LPCTSTR lpAccountName,
  322. BOOLEAN *lpWasEnabled);
  323. void
  324. Intl_UnloadNtUserHive(
  325. LPCTSTR lpRoot,
  326. BOOLEAN *lpWasEnabled);
  327. DWORD
  328. Intl_SetPrivilegeAccessToken(
  329. WCHAR * pszPrivilegeName,
  330. BOOLEAN bEnabled,
  331. BOOLEAN *lpWasEnabled);
  332. BOOL
  333. Intl_ChangeUILangForAllUsers(
  334. LANGID UILanguageId);
  335. BOOL
  336. Intl_LoadLanguageGroups(
  337. HWND hDlg);
  338. BOOL
  339. Intl_GetSupportedLanguageGroups();
  340. BOOL
  341. Intl_EnumInstalledLanguageGroups();
  342. BOOL
  343. Intl_LanguageGroupDirExist(
  344. PTSTR pszLangDir);
  345. BOOL
  346. Intl_LanguageGroupFilesExist();
  347. BOOL
  348. Intl_GetLocaleList(
  349. LPLANGUAGEGROUP pLG);
  350. DWORD
  351. Intl_GetLanguageGroup(
  352. LCID lcid);
  353. BOOL
  354. Intl_GetUILanguageGroups(
  355. PUILANGUAGEGROUP pUILanguageGroup);
  356. BOOL
  357. CALLBACK
  358. Intl_EnumUILanguagesProc(
  359. LPWSTR pwszUILanguage,
  360. LONG_PTR lParam);
  361. void
  362. Intl_SaveValuesToDefault(
  363. LPCTSTR srcKey,
  364. LPCTSTR destKey);
  365. void
  366. Intl_SaveValuesToNtUserFile(
  367. HKEY hSourceRegKey,
  368. LPCTSTR srcKey,
  369. LPCTSTR destKey);
  370. DWORD
  371. Intl_DefaultKeyboardLayout();
  372. BOOL
  373. Intl_IsLIP();
  374. BOOL
  375. Intl_IsMUISetupVersionSameAsOS();
  376. int
  377. Intl_IsSetupMode();
  378. BOOL
  379. Intl_IsWinntUpgrade();
  380. BOOL
  381. Intl_IsUIFontSubstitute();
  382. VOID
  383. Intl_ApplyFontSubstitute(LCID SystemLocale);
  384. HANDLE
  385. Intl_OpenLogFile();
  386. BOOL
  387. Intl_LogEvent(
  388. DWORD dwEventId, LPCTSTR szEventSource, WORD wNumStrings, LPCWSTR *lpStrings);
  389. BOOL
  390. Intl_LogMessage(
  391. LPCTSTR lpMessage);
  392. void
  393. Intl_LogUnattendFile(
  394. LPCTSTR pFileName);
  395. void
  396. Intl_LogSimpleMessage(
  397. UINT LogId,
  398. LPCTSTR pAppend);
  399. void
  400. Intl_LogFormatMessage(
  401. UINT LogId);
  402. void
  403. Intl_SaveDefaultUserSettings();
  404. BOOL
  405. Intl_SaveDefaultUserInputSettings();
  406. void
  407. Intl_RemoveMUIFile();
  408. void
  409. Intl_CallTextServices();
  410. LANGID
  411. Intl_GetPendingUILanguage();
  412. LANGID
  413. Intl_GetDotDefaultUILanguage();
  414. UINT WINAPI
  415. Intl_MyQueueCallback (
  416. IN PVOID pQueueContext,
  417. IN UINT Notification,
  418. IN UINT_PTR Param1,
  419. IN UINT_PTR Param2);
  420. #endif //_UTIL_H_