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.

563 lines
16 KiB

  1. #include <windows.h> // required for all Windows applications
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <io.h>
  5. #include <winnls.h>
  6. #include <winerror.h>
  7. #include "upimeres.h"
  8. WORD GenWideName(
  9. LPCTSTR pszSBName,
  10. WCHAR *lpVerString
  11. )
  12. {
  13. WORD length;
  14. length=strlen(pszSBName);
  15. length= MultiByteToWideChar(936, 0, pszSBName, strlen(pszSBName), lpVerString, length*sizeof(WCHAR));
  16. return length+1; //end with zero
  17. }
  18. long MakeVerInfo(
  19. LPCTSTR pszImeFileName,
  20. LPCTSTR pszOrgName,
  21. LPCTSTR pszImeName,
  22. BYTE *lpResData
  23. )
  24. {
  25. BYTE *pVerData, *pOldVerData;
  26. WCHAR lpwImeFileName[128], lpwOrgName[128], lpwImeName[128];
  27. HGLOBAL hResData;
  28. WORD length;
  29. signed int difflen,newlen,i,l;
  30. VERDATA ImeVerData[VER_BLOCK_NUM] = {
  31. {0x0304, 0x0034, 0x0004, 0x0024, FALSE},
  32. {0x0262, 0x0000, 0x0060, 0x0020, FALSE},
  33. {0x023e, 0x0000, 0x0084, 0x0014, FALSE},
  34. {0x004c, 0x0016, 0x009c, 0x001c, TRUE},
  35. {0x0040, 0x000c, 0x00e8, 0x0024, TRUE},
  36. {0x0032, 0x0009, 0x0128, 0x001c, FALSE},
  37. {0x0038, 0x000c, 0x015c, 0x001c, TRUE},
  38. {0x0080, 0x002e, 0x0194, 0x0020, FALSE},
  39. {0x003e, 0x000b, 0x0214, 0x0024, TRUE},
  40. {0x0038, 0x000c, 0x0254, 0x001c, TRUE},
  41. {0x0036, 0x0009, 0x028c, 0x0020, FALSE},
  42. {0x0044, 0x0000, 0x02c4, 0x001c, FALSE},
  43. {0x0024, 0x0004, 0x02e4, 0x001c, FALSE},
  44. };
  45. memset(lpwOrgName, 0, 128);
  46. memset(lpwImeName, 0, 128);
  47. memset(lpwImeFileName, 0, 128);
  48. //REPLACE CompanyName string
  49. length = GenWideName(pszOrgName, lpwOrgName);
  50. ImeVerData[VER_COMP_NAME].cbValue = length;
  51. ImeVerData[VER_COMP_NAME].cbBlock =
  52. ImeVerData[VER_COMP_NAME].wKeyNameSize +
  53. length*sizeof(WCHAR) + 2*sizeof(WORD);
  54. //replace FileDescription string
  55. length = GenWideName(pszImeName, lpwImeName);
  56. ImeVerData[VER_FILE_DES].cbValue = length;
  57. ImeVerData[VER_FILE_DES].cbBlock =
  58. ImeVerData[VER_FILE_DES].wKeyNameSize +
  59. length*sizeof(WCHAR) + 2*sizeof(WORD);
  60. //replace InternalName string
  61. length = GenWideName(pszImeName, lpwImeName);
  62. ImeVerData[VER_INTL_NAME].cbValue = length;
  63. ImeVerData[VER_INTL_NAME].cbBlock =
  64. ImeVerData[VER_INTL_NAME].wKeyNameSize +
  65. length*sizeof(WCHAR) + 2*sizeof(WORD);
  66. //replace OriginalFileName string
  67. length = GenWideName(pszImeFileName, lpwImeFileName);
  68. ImeVerData[VER_ORG_FILE_NAME].cbValue = length;
  69. ImeVerData[VER_ORG_FILE_NAME].cbBlock =
  70. ImeVerData[VER_ORG_FILE_NAME].wKeyNameSize +
  71. length*sizeof(WCHAR) + 2*sizeof(WORD);
  72. //replace ProductName string
  73. length = GenWideName(pszImeName, lpwImeName);
  74. ImeVerData[VER_PRD_NAME].cbValue = length;
  75. ImeVerData[VER_PRD_NAME].cbBlock =
  76. ImeVerData[VER_PRD_NAME].wKeyNameSize +
  77. length*sizeof(WCHAR) + 2*sizeof(WORD);
  78. //begin writeback all data
  79. //we assume the size of ver will never over 0x400
  80. pVerData = malloc(0x400);
  81. memset(pVerData, 0, 0x400);
  82. hResData = LoadResource(NULL, FindResource(NULL,"VERDATA", RT_RCDATA));
  83. pOldVerData = LockResource(hResData);
  84. l = VER_HEAD_LEN;
  85. memcpy(&pVerData[0],&pOldVerData[0], VER_HEAD_LEN);
  86. for( i = VER_COMP_NAME; i < VER_VAR_FILE_INFO; i++){
  87. memcpy(&pVerData[l], &ImeVerData[i].cbBlock, sizeof(WORD));
  88. l+=sizeof(WORD);
  89. memcpy(&pVerData[l], &ImeVerData[i].cbValue, sizeof(WORD));
  90. l+=sizeof(WORD);
  91. memcpy(&pVerData[l], &pOldVerData[(ImeVerData[i].wKeyOffset)],ImeVerData[i].wKeyNameSize);
  92. l+=ImeVerData[i].wKeyNameSize;
  93. if(ImeVerData[i].fUpdate){
  94. switch(i){
  95. case VER_FILE_DES:
  96. case VER_INTL_NAME:
  97. case VER_PRD_NAME:
  98. memcpy(&pVerData[l], lpwImeName, wcslen(lpwImeName)*sizeof(WCHAR));
  99. l+=ImeVerData[i].cbValue*sizeof(WCHAR);
  100. break;
  101. case VER_COMP_NAME:
  102. memcpy(&pVerData[l], lpwOrgName, wcslen(lpwOrgName)*sizeof(WCHAR));
  103. l+=ImeVerData[i].cbValue*sizeof(WCHAR);
  104. break;
  105. case VER_ORG_FILE_NAME:
  106. memcpy(&pVerData[l], lpwImeFileName, wcslen(lpwImeFileName)*sizeof(WCHAR));
  107. l+=ImeVerData[i].cbValue*sizeof(WCHAR);
  108. break;
  109. }
  110. }else{
  111. memcpy(&pVerData[l],
  112. &pOldVerData[ImeVerData[i].wKeyOffset+ImeVerData[i].wKeyNameSize],
  113. ImeVerData[i].cbValue*sizeof(WCHAR));
  114. l+=ImeVerData[i].cbValue*sizeof(WCHAR);
  115. }
  116. difflen = REMAINDER(l, CBLONG);
  117. l += difflen;
  118. }
  119. newlen = l - VER_STR_INFO_OFF - difflen;
  120. memcpy(&pVerData[VER_STR_INFO_OFF], &newlen, sizeof(WORD));
  121. newlen = l - VER_LANG_OFF - difflen;
  122. memcpy(&pVerData[VER_LANG_OFF], &newlen, sizeof(WORD));
  123. memcpy(&pVerData[l],&pOldVerData[VER_VAR_FILE_INFO_OFF], VER_TAIL_LEN);
  124. l+= VER_TAIL_LEN;
  125. memcpy(&pVerData[0], &l, sizeof(WORD));
  126. memcpy(lpResData, pVerData, l);
  127. UnlockResource(hResData);
  128. return ImeVerData[VER_ROOT].cbBlock;
  129. }
  130. BOOL UpdateImeBmp(
  131. LPCTSTR pszImeDesName, //destination IME file name
  132. LPCTSTR pszImeBmpName, //Bitmap file name
  133. HANDLE hUpdateRes)
  134. {
  135. HFILE imagefh;
  136. OFSTRUCT OpenBuf;
  137. BOOL result;
  138. WORD error;
  139. BYTE lpResData[0x2000];
  140. ULONG ResDataSize;
  141. error = NO_ERROR;
  142. if(pszImeBmpName == NULL || strlen(pszImeBmpName) == 0){ //prepare for update bitmap
  143. error = ERR_RES_NO_BMP;
  144. goto END_ERROR;
  145. }else{
  146. imagefh = (HFILE)OpenFile( pszImeBmpName, &OpenBuf, OF_READ | OF_SHARE_EXCLUSIVE);
  147. if(imagefh == -1){
  148. error = ERR_RES_INVALID_BMP;
  149. goto END_ERROR; //go on next resource update
  150. }
  151. ResDataSize = GetFileSize((HANDLE)imagefh,NULL);
  152. //according to the file size check if it is a 20*20 bmp
  153. if(ResDataSize != BMP_20_SIZE){
  154. error = ERR_RES_INVALID_BMP;
  155. goto END_ERROR;
  156. }
  157. ResDataSize -= sizeof(BITMAPFILEHEADER);
  158. if(_llseek(imagefh, sizeof(BITMAPFILEHEADER), 0)!=sizeof(BITMAPFILEHEADER)){
  159. error = ERR_RES_INVALID_BMP;
  160. goto END_ERROR; //go on next resource update
  161. }
  162. if(_lread(imagefh, lpResData, ResDataSize)!=ResDataSize){
  163. error = ERR_RES_INVALID_BMP;
  164. goto END_ERROR; //go on next resource update
  165. }
  166. result = UpdateResourceEx(hUpdateRes, /* update resource handle */
  167. RT_BITMAP, /* change bitmap resource */
  168. BMPNAME, /* bitmap name */
  169. MAKELANGID(LANG_CHINESE,
  170. SUBLANG_CHINESE_SIMPLIFIED), /* neutral language ID */
  171. lpResData, /* ptr to resource info */
  172. ResDataSize); /* size of resource info. */
  173. if(!result){
  174. error = ERR_CANNOT_UPRES;
  175. goto END_ERROR;
  176. }
  177. }
  178. END_ERROR:
  179. if(imagefh>0)
  180. _lclose(imagefh);
  181. switch(error){
  182. case NO_ERROR:
  183. return TRUE;
  184. case ERR_RES_INVALID_BMP:
  185. //SHOW MSG
  186. MessageBox(NULL,TEXT(ERR_INVALID_BMP_MSG), TEXT(MSG_TITLE), MB_OK | MB_ICONINFORMATION);
  187. return TRUE;
  188. case ERR_RES_NO_BMP:
  189. //SHOW MSG
  190. MessageBox(NULL,TEXT(ERR_NO_BMP_MSG), TEXT(MSG_TITLE), MB_OK | MB_ICONINFORMATION);
  191. return TRUE;
  192. // case ERROR_NOT_ENOUGH_MEMORY:
  193. case ERR_CANNOT_UPRES:
  194. default:
  195. //SHOW MSG
  196. MessageBox(NULL,TEXT(ERR_CANNOT_UPRES_MSG), TEXT(MSG_TITLE), MB_OK|MB_ICONSTOP);
  197. return FALSE;
  198. }
  199. }
  200. BOOL UpdateImeIcon(
  201. LPCTSTR pszImeDesName, //destination IME file name
  202. LPCTSTR pszImeIconName, //Bitmap file name
  203. HANDLE hUpdateRes)
  204. {
  205. HFILE imagefh;
  206. OFSTRUCT OpenBuf;
  207. BOOL result;
  208. WORD error;
  209. BYTE lpResData[0x2000];
  210. ULONG ResDataSize,i;
  211. //begin update ICON file
  212. error = NO_ERROR;
  213. if(pszImeIconName==NULL || strlen(pszImeIconName) ==0){
  214. error = ERR_RES_NO_ICON;
  215. goto END_ERROR;
  216. }else{
  217. ICONHEADER IconHeader;
  218. ICONDIRENTRY IconDirEntry;
  219. imagefh = (HFILE)OpenFile( pszImeIconName, &OpenBuf, OF_READ | OF_SHARE_EXCLUSIVE);
  220. if(imagefh == -1){
  221. error = ERR_RES_INVALID_ICON;
  222. goto END_ERROR;
  223. }
  224. ResDataSize = sizeof(ICONDIRENTRY)+3*sizeof(WORD);
  225. if(_llseek(imagefh, 0, 0) != 0 ){
  226. error = ERR_RES_INVALID_ICON;
  227. goto END_ERROR; //go on next resource update
  228. }
  229. memset(&IconHeader, 0, ResDataSize);
  230. if(_lread(imagefh, &IconHeader, 3*sizeof(WORD))!=3*sizeof(WORD)){
  231. error = ERR_RES_INVALID_ICON;
  232. goto END_ERROR;
  233. }
  234. if(_lread(imagefh, &IconHeader.idEntries[0], sizeof(ICONDIRENTRY))!=sizeof(ICONDIRENTRY)){
  235. error = ERR_RES_INVALID_ICON;
  236. goto END_ERROR;
  237. }
  238. if(IconHeader.idEntries[0].bWidth == 16 && IconHeader.idEntries[0].bHeight == 16){
  239. IconHeader.idCount = 0;
  240. IconDirEntry = IconHeader.idEntries[0];
  241. }
  242. for(i=1;i<IconHeader.idCount;i++){
  243. if(_lread(imagefh,&IconDirEntry, sizeof(ICONDIRENTRY))!=sizeof(ICONDIRENTRY)){
  244. error = ERR_RES_INVALID_ICON;
  245. goto END_ERROR;
  246. }
  247. if(IconDirEntry.bWidth == 16 && IconDirEntry.bHeight == 16){
  248. IconHeader.idCount = 0;
  249. break;
  250. }
  251. }
  252. if(IconHeader.idCount > 0){
  253. error = ERR_RES_INVALID_ICON;
  254. goto END_ERROR;
  255. }
  256. if(_llseek(imagefh, IconDirEntry.dwImageOffset, 0)!=IconDirEntry.dwImageOffset){
  257. error = ERR_RES_INVALID_ICON;
  258. goto END_ERROR;
  259. }
  260. if(_lread(imagefh, lpResData, IconDirEntry.dwBytesInRes)!=IconDirEntry.dwBytesInRes){
  261. error = ERR_RES_INVALID_ICON;
  262. goto END_ERROR;
  263. }
  264. result = UpdateResourceEx(hUpdateRes, /* update resource handle */
  265. RT_ICON, /* change dialog box resource */
  266. MAKEINTRESOURCE(2), /* icon name , we have to use 2 instead of "IMEICO" */
  267. MAKELANGID(LANG_CHINESE,
  268. SUBLANG_CHINESE_SIMPLIFIED), /* neutral language ID */
  269. lpResData, /* ptr to resource info */
  270. IconDirEntry.dwBytesInRes); /* size of resource info. */
  271. if(!result){
  272. error = ERR_CANNOT_UPRES;
  273. goto END_ERROR;
  274. }
  275. }
  276. END_ERROR:
  277. if(imagefh>0)
  278. _lclose(imagefh);
  279. switch(error){
  280. case NO_ERROR:
  281. return TRUE;
  282. case ERR_RES_INVALID_ICON:
  283. //SHOW MSG
  284. MessageBox(NULL,TEXT(ERR_INVALID_ICON_MSG), TEXT(MSG_TITLE), MB_OK | MB_ICONINFORMATION);
  285. return TRUE;
  286. case ERR_RES_NO_ICON:
  287. //SHOW MSG
  288. MessageBox(NULL,TEXT(ERR_NO_ICON_MSG), TEXT(MSG_TITLE), MB_OK | MB_ICONINFORMATION);
  289. return TRUE;
  290. case ERR_CANNOT_UPRES:
  291. default:
  292. //SHOW MSG
  293. MessageBox(NULL,TEXT(ERR_CANNOT_UPRES_MSG), TEXT(MSG_TITLE), MB_OK|MB_ICONSTOP);
  294. return FALSE;
  295. }
  296. }
  297. BOOL UpdateImeVerInfo(
  298. LPCTSTR pszImeDesName,
  299. LPCTSTR pszImeVerInfo,
  300. LPCTSTR pszImeDevCorpName,
  301. HANDLE hUpdateRes)
  302. {
  303. BOOL result;
  304. WORD error;
  305. BYTE lpResData[0x2000];
  306. ULONG ResDataSize;
  307. int cch;
  308. LPTSTR p;
  309. error = NO_ERROR;
  310. //begin update version info
  311. if(pszImeVerInfo ==NULL || strlen(pszImeVerInfo)==0){
  312. error = ERR_RES_NO_VER;
  313. goto END_ERROR;
  314. }
  315. cch = strlen(pszImeDesName);
  316. p = (LPBYTE)pszImeDesName + cch;
  317. while (*p != '\\' && p >= pszImeDesName)
  318. p--;
  319. p++;
  320. //we assume the size of ver will never over 0x400
  321. ResDataSize = MakeVerInfo(p,pszImeDevCorpName,pszImeVerInfo, lpResData);
  322. if(error == NO_ERROR){
  323. result = UpdateResourceEx(hUpdateRes, /* update resource handle */
  324. RT_VERSION, /* change version resource */
  325. MAKEINTRESOURCE(VS_VERSION_INFO), /* dialog box name */
  326. MAKELANGID(LANG_CHINESE,
  327. SUBLANG_CHINESE_SIMPLIFIED), /* neutral language ID */
  328. lpResData, /* ptr to resource info */
  329. ResDataSize); /* size of resource info. */
  330. if(!result){
  331. error = ERR_CANNOT_UPRES;
  332. goto END_ERROR;
  333. }
  334. }
  335. END_ERROR:
  336. switch(error){
  337. case NO_ERROR:
  338. return TRUE;
  339. case ERR_RES_INVALID_VER:
  340. //SHOW MSG
  341. return TRUE;
  342. case ERR_RES_NO_VER:
  343. //SHOW MSG
  344. return TRUE;
  345. case ERR_CANNOT_UPRES:
  346. default:
  347. //SHOW MSG
  348. MessageBox(NULL,TEXT(ERR_CANNOT_UPRES_MSG), TEXT(MSG_TITLE), MB_OK|MB_ICONSTOP);
  349. return FALSE;
  350. }
  351. }
  352. BOOL UpdateImeStr(
  353. LPCTSTR pszImeDesName,
  354. LPCTSTR pszImeVerInfo,
  355. LPCTSTR pszImeDevCorpName,
  356. HANDLE hUpdateRes)
  357. {
  358. BOOL result;
  359. WORD error;
  360. WCHAR lpwImeVerInfo[128], lpwImeDevCorpName[128], lpwImeMBName[128];
  361. WORD length;
  362. BYTE lpBuff[0x200],*p;
  363. char name[20];
  364. LONG cbResSize;
  365. int cch;
  366. error = NO_ERROR;
  367. //begin update version info
  368. if(pszImeVerInfo ==NULL || strlen(pszImeVerInfo)==0){
  369. error = ERR_RES_NO_VER;
  370. goto END_ERROR;
  371. }
  372. if(pszImeDevCorpName ==NULL || strlen(pszImeDevCorpName)==0){
  373. error = ERR_RES_NO_VER;
  374. goto END_ERROR;
  375. }
  376. if(error == NO_ERROR){
  377. memset(lpBuff, 0, 0x200);
  378. cbResSize = 0;
  379. //write in IDS_VER_INFO
  380. length = strlen(pszImeVerInfo);
  381. length = MultiByteToWideChar(936, 0, pszImeVerInfo, strlen(pszImeVerInfo), lpwImeVerInfo, length*sizeof(WCHAR));
  382. memcpy((BYTE *)lpBuff, &length, sizeof(WORD));
  383. cbResSize += sizeof(WORD);
  384. memcpy((BYTE *)((LONG)lpBuff+cbResSize), (BYTE *)lpwImeVerInfo, length*sizeof(WCHAR));
  385. cbResSize += length*sizeof(WCHAR);
  386. //write in IDS_ORG_NAME
  387. length = strlen(pszImeDevCorpName);
  388. length = MultiByteToWideChar(936, 0, pszImeDevCorpName, strlen(pszImeDevCorpName), lpwImeDevCorpName, length*sizeof(WCHAR));
  389. memcpy((BYTE *)((LONG)lpBuff+cbResSize), &length, sizeof(WORD));
  390. cbResSize += sizeof(WORD);
  391. memcpy((BYTE *)((LONG)lpBuff+cbResSize), (BYTE *)lpwImeDevCorpName, length*sizeof(WCHAR));
  392. cbResSize += length*sizeof(WCHAR);
  393. //write in IDS_IMEMBFILENAME
  394. cch = strlen(pszImeDesName);
  395. p = (LPBYTE)pszImeDesName+cch;
  396. while (*p != '\\' && p >= pszImeDesName)
  397. p--;
  398. p++;
  399. strcpy(name, p);
  400. p = name;
  401. while(*p != '.' && *p != '\0')
  402. p++;
  403. strcpy(p, ".MB");
  404. length = strlen(name);
  405. length = MultiByteToWideChar(936, 0, name, strlen(name), lpwImeMBName, length*sizeof(WCHAR));
  406. memcpy((BYTE *)((LONG)lpBuff+cbResSize), &length, sizeof(WORD));
  407. cbResSize += sizeof(WORD);
  408. memcpy((BYTE *)((LONG)lpBuff+cbResSize), (BYTE *)lpwImeMBName, length*sizeof(WCHAR));
  409. cbResSize += length*sizeof(WCHAR);
  410. result = UpdateResourceEx(hUpdateRes, /* update resource handle */
  411. RT_STRING, /* change version resource */
  412. MAKEINTRESOURCE(STR_ID), /* dialog box name */
  413. MAKELANGID(LANG_CHINESE,
  414. SUBLANG_CHINESE_SIMPLIFIED), /* neutral language ID */
  415. (LPVOID)lpBuff, /* ptr to resource info */
  416. cbResSize); /* size of resource info. */
  417. if(!result){
  418. error = ERR_CANNOT_UPRES;
  419. goto END_ERROR;
  420. }
  421. }
  422. END_ERROR:
  423. switch(error){
  424. case NO_ERROR:
  425. return TRUE;
  426. case ERR_RES_INVALID_VER:
  427. //SHOW MSG
  428. return TRUE;
  429. case ERR_RES_NO_VER:
  430. //SHOW MSG
  431. return TRUE;
  432. case ERR_CANNOT_UPRES:
  433. default:
  434. //SHOW MSG
  435. MessageBox(NULL,TEXT(ERR_CANNOT_UPRES_MSG), TEXT(MSG_TITLE), MB_OK|MB_ICONSTOP);
  436. return FALSE;
  437. }
  438. }
  439. //UPDATE ImeInitData
  440. BOOL UpdateImeInitData(
  441. LPCTSTR pszImeDesName,
  442. WORD wImeData,
  443. HANDLE hUpdateRes)
  444. {
  445. BOOL result;
  446. WORD error;
  447. error = NO_ERROR;
  448. if(error == NO_ERROR){
  449. result = UpdateResourceEx(hUpdateRes, /* update resource handle */
  450. RT_RCDATA, /* change version resource */
  451. DATANAME, /* dialog box name */
  452. MAKELANGID(LANG_CHINESE,
  453. SUBLANG_CHINESE_SIMPLIFIED), /* neutral language ID */
  454. (LPVOID)&wImeData, /* ptr to resource info */
  455. sizeof(WORD)); /* size of resource info. */
  456. if(!result){
  457. error = ERR_CANNOT_UPRES;
  458. goto END_ERROR;
  459. }
  460. }
  461. END_ERROR:
  462. switch(error){
  463. case NO_ERROR:
  464. return TRUE;
  465. case ERR_RES_INVALID_VER:
  466. //SHOW MSG
  467. return TRUE;
  468. case ERR_RES_NO_VER:
  469. //SHOW MSG
  470. return TRUE;
  471. case ERR_CANNOT_UPRES:
  472. default:
  473. //SHOW MSG
  474. MessageBox(NULL,TEXT(ERR_CANNOT_UPRES_MSG), TEXT(MSG_TITLE), MB_OK|MB_ICONSTOP);
  475. return FALSE;
  476. }
  477. }
  478. BOOL ImeUpdateRes(
  479. LPCTSTR pszImeDesName, //destination IME file name
  480. LPCTSTR pszImeBmpName, //Bitmap file name
  481. LPCTSTR pszImeIconName, //Icon file name
  482. LPCTSTR pszImeVerInfo, //version infomation string
  483. LPCTSTR pszImeDevCorpName, //Ime inventer corp/person name
  484. WORD wImeData //Ime initial data
  485. ){
  486. HANDLE hUpdateRes; /* update resource handle */
  487. if(pszImeDesName == NULL || strlen(pszImeDesName)==0){
  488. return FALSE;
  489. }
  490. hUpdateRes = BeginUpdateResourceEx(pszImeDesName, FALSE);
  491. if(hUpdateRes ==NULL){
  492. return FALSE;
  493. }
  494. if(!UpdateImeBmp(pszImeDesName,pszImeBmpName,hUpdateRes))
  495. return FALSE;
  496. if(!UpdateImeIcon(pszImeDesName,pszImeIconName,hUpdateRes))
  497. return FALSE;
  498. if(!UpdateImeVerInfo(pszImeDesName,pszImeVerInfo,pszImeDevCorpName,hUpdateRes))
  499. return FALSE;
  500. if(!UpdateImeStr(pszImeDesName,pszImeVerInfo,pszImeDevCorpName,hUpdateRes))
  501. return FALSE;
  502. if(!UpdateImeInitData(pszImeDesName,wImeData,hUpdateRes))
  503. return FALSE;
  504. if (!EndUpdateResourceEx(hUpdateRes, FALSE)) {
  505. return FALSE;
  506. }
  507. return TRUE;
  508. }