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.

252 lines
5.1 KiB

  1. /****************************** Module Header ******************************\
  2. * Module Name: femgrate.h
  3. *
  4. * Copyright (c) 1985 - 1999, Microsoft Corporation
  5. *
  6. * FEMGRATE, main header file
  7. *
  8. \***************************************************************************/
  9. #ifndef FEMGRATE_H
  10. #define FEMGRATE_H
  11. #include <windows.h>
  12. #include <stdio.h>
  13. #include <stdlib.h>
  14. #include <userenv.h>
  15. #include <userenvp.h>
  16. #include <setupapi.h>
  17. #include <spapip.h>
  18. #include <regstr.h>
  19. #include <shlwapi.h>
  20. #include <shlobj.h>
  21. #include <string.h>
  22. #define NO_FUNCTION 0xFF
  23. #define DM_VERBOSE 2
  24. #ifdef UNICODE
  25. #define A2I _wtoi
  26. #else
  27. #define A2I atoi
  28. #endif
  29. #define ARRAYSIZE(s) (sizeof(s) / (sizeof(s[0])))
  30. #define LOCALE_JPN 0x411
  31. #define LOCALE_KOR 0x412
  32. #define LOCALE_CHT 0x404
  33. #define LOCALE_CHS 0x804
  34. enum FunctionType {
  35. FUNC_PatchInLogon,
  36. FUNC_PatchInSetup,
  37. FUNC_PatchFEUIFont,
  38. FUNC_PatchPreload,
  39. FUNC_PatchCHSAnsiEMB,
  40. FUNC_PatchTest,
  41. FUNC_NumofFunctions
  42. };
  43. typedef struct _FUNC_DIR {
  44. char cFunc;
  45. int nID;
  46. } FUNC_DIR;
  47. typedef struct _STRING_TO_DATA {
  48. TCHAR String[50];
  49. UINT Data;
  50. } STRING_TO_DATA, *PSTRING_TO_DATA;
  51. typedef struct tagTABLIST {
  52. UINT nResID;
  53. TCHAR szIMEName[MAX_PATH];
  54. } TABLELIST,*LPTABLELIST;
  55. #ifdef __cplusplus
  56. extern "C" {
  57. #endif
  58. extern HINSTANCE ghInst;
  59. #define USER_SHELL_FOLDER TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders")
  60. #define c_szDot TEXT(".")
  61. #define c_szDotDot TEXT("..")
  62. #define c_szStarDotStar TEXT("*.*")
  63. //
  64. // utils.c
  65. //
  66. extern STRING_TO_DATA InfRegSpecTohKey[] ;
  67. //#define MYDBG
  68. //#define DEBUGLOG
  69. #ifdef MYDBG
  70. #define DebugMsg(_parameter) Print _parameter
  71. #define DBGTITLE TEXT("FEMGRATE :")
  72. void Print(UINT mask,LPCTSTR pszFormat,...);
  73. #else
  74. #define DebugMsg(_parameter)
  75. #endif
  76. ConcatenatePaths(
  77. LPTSTR Target,
  78. LPCTSTR Path,
  79. UINT TargetBufferSize
  80. );
  81. LPTSTR CheckSlash (LPTSTR lpDir);
  82. void IntToString( DWORD i, LPTSTR sz);
  83. BOOL DoInstallationFromSection(HINF hInf,LPCTSTR lpszSectionName);
  84. BOOL IsInSetupUpgradeMode();
  85. UINT StrToUInt(LPTSTR lpszNum);
  86. UINT GetInstallLocale();
  87. BOOL RegReplaceIfExisting(
  88. HKEY hKey,
  89. LPCTSTR pszOldValName,
  90. LPCTSTR pszNewValName);
  91. BOOL ReplaceString(
  92. LPCTSTR lpszOldStr,
  93. LPCTSTR lpszReplaceStr,
  94. LPCTSTR lpszReplacedWithStr,
  95. LPTSTR lpszOutputStr);
  96. BOOL Delnode (LPTSTR lpDir);
  97. BOOL GetProgramsDirectory (BOOL bCommonGroup, LPTSTR lpDirectory);
  98. BOOL GetGenericUserFolderDirectory (LPCTSTR lpszFolder, LPTSTR lpDirectory);
  99. BOOL LookUpStringInTable(
  100. IN PSTRING_TO_DATA Table,
  101. IN LPCTSTR String,
  102. OUT PUINT Data
  103. );
  104. BOOL INIFile_ChangeSectionName(
  105. LPCTSTR szIniFileName,
  106. LPCTSTR szIniOldSectionName,
  107. LPCTSTR szIniNewSectionName);
  108. BOOL INIFile_ChangeKeyName(
  109. LPCTSTR szIniFileName,
  110. LPCTSTR szIniOldSectionName,
  111. LPCTSTR szIniOldKeyName,
  112. LPCTSTR szIniNewKeyName);
  113. UINT CreateNestedDirectory(
  114. LPCTSTR lpDirectory,
  115. LPSECURITY_ATTRIBUTES lpSecurityAttributes);
  116. BOOL GetApplicationFolderPath(
  117. LPTSTR lpszFolder,
  118. UINT nLen);
  119. BOOL GetNewPath(
  120. LPTSTR lpszNewPath,
  121. LPCTSTR lpszFileName,
  122. LPCTSTR lpszClass);
  123. BOOL MovePerUserIMEData(
  124. HKEY hCurrentKey,
  125. LPCTSTR szRegPath,
  126. LPCTSTR szRegVal,
  127. LPCTSTR szUserClass,
  128. LPCTSTR szIMEName,
  129. BOOL bCHT);
  130. BOOL CreateSecurityDirectory(
  131. LPCTSTR pszOldDir,
  132. LPCTSTR pszNewDir);
  133. BOOL IsDirExisting(
  134. LPTSTR Dir);
  135. BOOL IsFileExisting(
  136. LPTSTR File);
  137. BOOL RenameDirectory(
  138. LPTSTR OldDir,
  139. LPTSTR NewDir);
  140. BOOL RenameFile(
  141. LPTSTR OldFile,
  142. LPTSTR NewFile);
  143. BOOL RenameSectionFiles(
  144. HINF hInf,
  145. LPCTSTR SectionName,
  146. LPCTSTR SourceDirectory,
  147. LPCTSTR TargetDirectory);
  148. BOOL RenameSectionRegSZ(
  149. HINF hInf,
  150. LPCTSTR SectionName,
  151. HKEY hRootKey,
  152. LPCTSTR RegPath);
  153. ///////////////////////////////////////////////
  154. //
  155. // femgrate.c
  156. //
  157. ///////////////////////////////////////////////
  158. BOOL FixTimeZone(UINT nLocale);
  159. BOOL FixSchemeProblem(BOOL bJapan,HINF hInf);
  160. BOOL PatchPreloadKeyboard(BOOL bReplaceDefaultLCID); //if TRUE will replace 409 with default LCID
  161. void FixCurrentSchemeName(HINF hInf);
  162. BOOL RenameRegValueName(HINF hInf, BOOL PerUser);
  163. ///////////////////////////////////////////////
  164. //
  165. // jpn.c
  166. //
  167. ///////////////////////////////////////////////
  168. int WINAPI WinMainJPN(int nCmd,HINF hInf);
  169. ///////////////////////////////////////////////
  170. //
  171. // kor.c
  172. //
  173. ///////////////////////////////////////////////
  174. int WINAPI WinMainKOR(int nCmd,HINF hInf);
  175. ///////////////////////////////////////////////
  176. //
  177. // cht.c
  178. //
  179. ///////////////////////////////////////////////
  180. int WINAPI WinMainCHT(int nCmd,HINF hInf);
  181. ///////////////////////////////////////////////
  182. //
  183. // chs.c
  184. //
  185. ///////////////////////////////////////////////
  186. int WINAPI WinMainCHS(int nCmd,HINF hInf);
  187. ///////////////////////////////////////////////
  188. //
  189. // utils2.cpp
  190. //
  191. ///////////////////////////////////////////////
  192. HRESULT FixPathInLink(LPCTSTR pszShortcutFile, LPCTSTR lpszOldStr,LPCTSTR lpszNewStr);
  193. #ifdef __cplusplus
  194. } // extern "C"
  195. #endif
  196. #endif