PageRenderTime 34ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 1ms

/patches/db_mmap_sa_64bit.patch

http://miranda-dev.googlecode.com/
Patch | 644 lines | 572 code | 72 blank | 0 comment | 0 complexity | a1d379ef250a9164258cb73d953a7ea7 MD5 | raw file
Possible License(s): GPL-2.0, MPL-2.0-no-copyleft-exception, LGPL-3.0, AGPL-1.0, BSD-3-Clause, LGPL-2.1
  1. Index: trunk/backup.c
  2. ===================================================================
  3. --- trunk/backup.c (Revision 116)
  4. +++ trunk/backup.c (Arbeitskopie)
  5. @@ -6,7 +6,7 @@
  6. extern BOOL gl_bUnicodeAwareCore;
  7. struct DBHeader dbHeader;
  8. -int BackupService(WPARAM wParam, LPARAM lParam);
  9. +INT_PTR BackupService(WPARAM wParam, LPARAM lParam);
  10. static HANDLE hEventBackup;
  11. @@ -19,15 +19,13 @@
  12. int Backup(char* backup_filename, HWND progress_dialog)
  13. {
  14. - HANDLE hBackupFile;
  15. char buff[8192];
  16. DWORD bytes_read, bytes_written, file_size, total_bytes_copied = 0;
  17. - HWND prog;
  18. MSG msg;
  19. DWORD start_time = GetTickCount();
  20. - prog = GetDlgItem(progress_dialog, 0xDEAD);
  21. + HWND prog = GetDlgItem(progress_dialog, 0xDEAD);
  22. - hBackupFile = CreateFileA(backup_filename, GENERIC_WRITE, FILE_SHARE_WRITE, 0, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
  23. + HANDLE hBackupFile = CreateFileA(backup_filename, GENERIC_WRITE, FILE_SHARE_WRITE, 0, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
  24. if(hBackupFile != INVALID_HANDLE_VALUE) {
  25. if(progress_dialog) {
  26. @@ -66,7 +64,7 @@
  27. }
  28. while(ReadFile(hDbFile, buff, sizeof(buff), &bytes_read, 0) == TRUE && bytes_read > 0
  29. - && GetWindowLong(progress_dialog, GWL_USERDATA) == 0)
  30. + && GetWindowLongPtr(progress_dialog, GWLP_USERDATA) == 0)
  31. {
  32. if(!WriteFile(hBackupFile, buff, bytes_read, &bytes_written, 0)) {
  33. LeaveCriticalSection(&csDbAccess);
  34. @@ -95,7 +93,7 @@
  35. CloseHandle(hBackupFile);
  36. - if(progress_dialog && GetWindowLong(progress_dialog, GWL_USERDATA) != 0)
  37. + if(progress_dialog && GetWindowLongPtr(progress_dialog, GWLP_USERDATA) != 0)
  38. DeleteFileA(backup_filename);
  39. else
  40. NotifyEventHooks(hEventBackup, (WPARAM)backup_filename, 0);
  41. @@ -106,7 +104,7 @@
  42. return 1;
  43. }
  44. -int BackupService(WPARAM wParam,LPARAM lParam)
  45. +INT_PTR BackupService(WPARAM wParam,LPARAM lParam)
  46. {
  47. return Backup((char*)wParam, (HWND)lParam);
  48. }
  49. \ No newline at end of file
  50. Index: trunk/dbcontacts.c
  51. ===================================================================
  52. --- trunk/dbcontacts.c (Revision 116)
  53. +++ trunk/dbcontacts.c (Arbeitskopie)
  54. @@ -30,12 +30,12 @@
  55. int GetContactSettingStatic(WPARAM wParam,LPARAM lParam);
  56. void FreeCachedVariant( DBVARIANT* V );
  57. -static int GetContactCount(WPARAM wParam,LPARAM lParam);
  58. -static int FindFirstContact(WPARAM wParam,LPARAM lParam);
  59. -static int FindNextContact(WPARAM wParam,LPARAM lParam);
  60. -static int DeleteContact(WPARAM wParam,LPARAM lParam);
  61. -static int AddContact(WPARAM wParam,LPARAM lParam);
  62. -static int IsDbContact(WPARAM wParam,LPARAM lParam);
  63. +static INT_PTR GetContactCount(WPARAM wParam,LPARAM lParam);
  64. +static INT_PTR FindFirstContact(WPARAM wParam,LPARAM lParam);
  65. +static INT_PTR FindNextContact(WPARAM wParam,LPARAM lParam);
  66. +static INT_PTR DeleteContact(WPARAM wParam,LPARAM lParam);
  67. +static INT_PTR AddContact(WPARAM wParam,LPARAM lParam);
  68. +static INT_PTR IsDbContact(WPARAM wParam,LPARAM lParam);
  69. static HANDLE hContactDeletedEvent,hContactAddedEvent;
  70. @@ -67,7 +67,7 @@
  71. return VL;
  72. }
  73. -static int GetContactCount(WPARAM wParam,LPARAM lParam)
  74. +static INT_PTR GetContactCount(WPARAM wParam,LPARAM lParam)
  75. {
  76. int ret;
  77. @@ -96,7 +96,7 @@
  78. return !strcmp(protobuf,proto);
  79. }
  80. -static int FindFirstContact(WPARAM wParam,LPARAM lParam)
  81. +static INT_PTR FindFirstContact(WPARAM wParam,LPARAM lParam)
  82. {
  83. int ret = 0;
  84. EnterCriticalSection(&csDbAccess);
  85. @@ -107,7 +107,7 @@
  86. return ret;
  87. }
  88. -static int FindNextContact(WPARAM wParam,LPARAM lParam)
  89. +static INT_PTR FindNextContact(WPARAM wParam,LPARAM lParam)
  90. {
  91. int index;
  92. struct DBContact *dbc;
  93. @@ -145,7 +145,7 @@
  94. return 0;
  95. }
  96. -static int DeleteContact(WPARAM wParam,LPARAM lParam)
  97. +static INT_PTR DeleteContact(WPARAM wParam,LPARAM lParam)
  98. {
  99. struct DBContact *dbc,*dbcPrev;
  100. DWORD ofsThis,ofsNext,ofsFirstEvent;
  101. @@ -246,7 +246,7 @@
  102. return 0;
  103. }
  104. -static int AddContact(WPARAM wParam,LPARAM lParam)
  105. +static INT_PTR AddContact(WPARAM wParam,LPARAM lParam)
  106. {
  107. struct DBContact dbc;
  108. DWORD ofsNew;
  109. @@ -274,7 +274,7 @@
  110. return (int)ofsNew;
  111. }
  112. -static int IsDbContact(WPARAM wParam,LPARAM lParam)
  113. +static INT_PTR IsDbContact(WPARAM wParam,LPARAM lParam)
  114. {
  115. struct DBContact *dbc;
  116. DWORD ofsContact=(DWORD)wParam;
  117. Index: trunk/dbsettings.c
  118. ===================================================================
  119. --- trunk/dbsettings.c (Revision 116)
  120. +++ trunk/dbsettings.c (Arbeitskopie)
  121. @@ -397,7 +397,7 @@
  122. return 1;
  123. }
  124. -static int GetContactSetting(WPARAM wParam,LPARAM lParam)
  125. +static INT_PTR GetContactSetting(WPARAM wParam,LPARAM lParam)
  126. {
  127. DBCONTACTGETSETTING* dgs = ( DBCONTACTGETSETTING* )lParam;
  128. dgs->pValue->type = 0;
  129. @@ -431,7 +431,7 @@
  130. return 0;
  131. }
  132. -static int GetContactSettingStr(WPARAM wParam,LPARAM lParam)
  133. +static INT_PTR GetContactSettingStr(WPARAM wParam,LPARAM lParam)
  134. {
  135. DBCONTACTGETSETTING* dgs = (DBCONTACTGETSETTING*)lParam;
  136. int iSaveType = dgs->pValue->type;
  137. @@ -479,7 +479,7 @@
  138. return 0;
  139. }
  140. -int GetContactSettingStatic(WPARAM wParam,LPARAM lParam)
  141. +INT_PTR GetContactSettingStatic(WPARAM wParam,LPARAM lParam)
  142. {
  143. DBCONTACTGETSETTING* dgs = (DBCONTACTGETSETTING*)lParam;
  144. if ( GetContactSettingWorker(( HANDLE )wParam, dgs, 1 ))
  145. @@ -493,7 +493,7 @@
  146. return 0;
  147. }
  148. -static int FreeVariant(WPARAM wParam,LPARAM lParam)
  149. +static INT_PTR FreeVariant(WPARAM wParam,LPARAM lParam)
  150. {
  151. DBVARIANT *dbv=(DBVARIANT*)lParam;
  152. if ( dbv == 0 ) return 1;
  153. @@ -517,7 +517,7 @@
  154. return 0;
  155. }
  156. -static int SetSettingResident(WPARAM wParam,LPARAM lParam)
  157. +static INT_PTR SetSettingResident(WPARAM wParam,LPARAM lParam)
  158. {
  159. size_t cbSettingNameLen = strlen(( char* )lParam) + 2;
  160. if (cbSettingNameLen < 512)
  161. @@ -548,7 +548,7 @@
  162. return 0;
  163. }
  164. -static int WriteContactSetting(WPARAM wParam,LPARAM lParam)
  165. +static INT_PTR WriteContactSetting(WPARAM wParam,LPARAM lParam)
  166. {
  167. DBCONTACTWRITESETTING *dbcws=(DBCONTACTWRITESETTING*)lParam;
  168. DBCONTACTWRITESETTING tmp;
  169. @@ -833,7 +833,7 @@
  170. return 0;
  171. }
  172. -static int DeleteContactSetting(WPARAM wParam,LPARAM lParam)
  173. +static INT_PTR DeleteContactSetting(WPARAM wParam,LPARAM lParam)
  174. {
  175. DBCONTACTGETSETTING *dbcgs=(DBCONTACTGETSETTING*)lParam;
  176. struct DBContact *dbc;
  177. @@ -930,7 +930,7 @@
  178. return 0;
  179. }
  180. -static int EnumContactSettings(WPARAM wParam,LPARAM lParam)
  181. +static INT_PTR EnumContactSettings(WPARAM wParam,LPARAM lParam)
  182. {
  183. DBCONTACTENUMSETTINGS *dbces=(DBCONTACTENUMSETTINGS*)lParam;
  184. struct DBContact *dbc;
  185. @@ -978,7 +978,7 @@
  186. return result;
  187. }
  188. -static int EnumResidentSettings(WPARAM wParam,LPARAM lParam)
  189. +static INT_PTR EnumResidentSettings(WPARAM wParam,LPARAM lParam)
  190. {
  191. int i;
  192. int ret;
  193. Index: trunk/dbtool/dbtool.h
  194. ===================================================================
  195. --- trunk/dbtool/dbtool.h (Revision 116)
  196. +++ trunk/dbtool/dbtool.h (Arbeitskopie)
  197. @@ -71,7 +71,7 @@
  198. BOOL CALLBACK CleaningDlgProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam);
  199. BOOL CALLBACK ProgressDlgProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam);
  200. BOOL CALLBACK FileAccessDlgProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam);
  201. -BOOL CALLBACK WizardDlgProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam);
  202. +INT_PTR CALLBACK WizardDlgProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam);
  203. BOOL CALLBACK FinishedDlgProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam);
  204. BOOL CALLBACK WelcomeDlgProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam);
  205. BOOL CALLBACK OpenErrorDlgProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam);
  206. Index: trunk/dbtool/encryption.cpp
  207. ===================================================================
  208. --- trunk/dbtool/encryption.cpp (Revision 116)
  209. +++ trunk/dbtool/encryption.cpp (Arbeitskopie)
  210. @@ -277,7 +277,7 @@
  211. UINT uid = LOWORD(wParam);
  212. if(uid == IDOK){
  213. - if(!GetWindowLong(hDlg,GWL_USERDATA))
  214. + if(!GetWindowLongPtr(hDlg,GWLP_USERDATA))
  215. {
  216. encryptKeyLength = GetDlgItemTextA(hDlg, IDC_USERPASS, encryptKey, 254);
  217. EndDialog(hDlg,IDOK);
  218. Index: trunk/dbtool/progress.cpp
  219. ===================================================================
  220. --- trunk/dbtool/progress.cpp (Revision 116)
  221. +++ trunk/dbtool/progress.cpp (Arbeitskopie)
  222. @@ -169,7 +169,7 @@
  223. SetEvent(hEventAbort);
  224. }
  225. SetEvent(hEventRun);
  226. - SetWindowLong(hdlg,DWL_MSGRESULT,TRUE);
  227. + SetWindowLongPtr(hdlg,DWLP_MSGRESULT,TRUE);
  228. return TRUE;
  229. case WM_COMMAND:
  230. switch(LOWORD(wParam)) {
  231. Index: trunk/dbtool/wizard.cpp
  232. ===================================================================
  233. --- trunk/dbtool/wizard.cpp (Revision 116)
  234. +++ trunk/dbtool/wizard.cpp (Arbeitskopie)
  235. @@ -86,7 +86,7 @@
  236. return FALSE;
  237. }
  238. -BOOL CALLBACK WizardDlgProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam)
  239. +INT_PTR CALLBACK WizardDlgProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam)
  240. {
  241. static HWND hdlgPage;
  242. Index: trunk/dialogs.c
  243. ===================================================================
  244. --- trunk/dialogs.c (Revision 116)
  245. +++ trunk/dialogs.c (Arbeitskopie)
  246. @@ -10,7 +10,7 @@
  247. extern char encryptKey[255];
  248. extern size_t encryptKeyLength;
  249. -extern HANDLE g_hInst;
  250. +extern HINSTANCE g_hInst;
  251. HANDLE hSetPwdMenu;
  252. extern BOOL gl_bUnicodeAwareCore;
  253. @@ -18,7 +18,7 @@
  254. int Backup(void);
  255. int BackupService(WPARAM wParam, LPARAM lParam);
  256. -BOOL CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
  257. +INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
  258. BOOL ShowDlgItem(HWND hwndDlg, int iIDCtrl, BOOL bShow)
  259. {
  260. HWND hwndCtrl = GetDlgItem(hwndDlg, iIDCtrl);
  261. @@ -62,14 +62,14 @@
  262. odp.flags = ODPF_BOLDGROUPS;
  263. if (gl_bUnicodeAwareCore)
  264. {
  265. - odp.ptszTitle = TranslateT("Database Features");
  266. - odp.ptszGroup = TranslateT("Services");
  267. + odp.ptszTitle = LPGENT("Database Features");
  268. + odp.ptszGroup = LPGENT("Services");
  269. odp.flags |= ODPF_UNICODE;
  270. }
  271. else
  272. {
  273. - odp.pszTitle = Translate("Database Features");
  274. - odp.pszGroup = Translate("Services");
  275. + odp.pszTitle = LPGEN("Database Features");
  276. + odp.pszGroup = LPGEN("Services");
  277. }
  278. odp.nIDBottomSimpleControl = 0;
  279. @@ -79,7 +79,7 @@
  280. return 0;
  281. }
  282. -static int ChangePassword(WPARAM wParam, LPARAM lParam)
  283. +static INT_PTR ChangePassword(WPARAM wParam, LPARAM lParam)
  284. {
  285. if(bEncoding){
  286. ChangePwd();
  287. @@ -117,7 +117,7 @@
  288. menu.cbSize=sizeof(menu);
  289. menu.flags = CMIM_ALL;
  290. - menu.hIcon=LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_ICON2));
  291. + menu.hIcon=LoadIcon((HANDLE)g_hInst, MAKEINTRESOURCE(IDI_ICON2));
  292. // main menu item
  293. if (gl_bUnicodeAwareCore)
  294. @@ -178,7 +178,7 @@
  295. return res;
  296. }
  297. -BOOL CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
  298. +INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
  299. {
  300. HWND hwndList = GetDlgItem(hwndDlg, IDC_MODULES);
  301. LVCOLUMN col;
  302. @@ -420,7 +420,7 @@
  303. UINT uid = LOWORD(wParam);
  304. if(uid == IDOK){
  305. - if(!GetWindowLong(hDlg,GWL_USERDATA))
  306. + if(!GetWindowLongPtr(hDlg,GWLP_USERDATA))
  307. {
  308. encryptKeyLength = GetDlgItemTextA(hDlg, IDC_USERPASS, encryptKey, 254);
  309. EndDialog(hDlg,IDOK);
  310. @@ -479,7 +479,7 @@
  311. UINT uid = LOWORD(wParam);
  312. if(uid == IDOK){
  313. - if(!GetWindowLong(hDlg,GWL_USERDATA))
  314. + if(!GetWindowLongPtr(hDlg,GWLP_USERDATA))
  315. {
  316. char pass1[255], pass2[255];
  317. if(GetDlgItemTextA(hDlg, IDC_USERPASS1, pass1, 254) < 3){
  318. Index: trunk/import_sa/encryption.c
  319. ===================================================================
  320. --- trunk/import_sa/encryption.c (Revision 116)
  321. +++ trunk/import_sa/encryption.c (Arbeitskopie)
  322. @@ -282,7 +282,7 @@
  323. UINT uid = LOWORD(wParam);
  324. if(uid == IDOK){
  325. - if(!GetWindowLong(hDlg,GWL_USERDATA))
  326. + if(!GetWindowLongPtr(hDlg,GWLP_USERDATA))
  327. {
  328. encryptKeyLength = GetDlgItemTextA(hDlg, IDC_USERPASS, encryptKey, 254);
  329. EndDialog(hDlg,IDOK);
  330. Index: trunk/init.c
  331. ===================================================================
  332. --- trunk/init.c (Revision 116)
  333. +++ trunk/init.c (Arbeitskopie)
  334. @@ -106,7 +106,7 @@
  335. // returns 0 if all the APIs are injected otherwise, 1
  336. static int LoadDatabase( char * profile, void * plink )
  337. {
  338. - PLUGINLINK *link = plink;
  339. + PLUGINLINK *link = (PLUGINLINK*) plink;
  340. #ifdef _DEBUG
  341. _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
  342. #endif
  343. @@ -206,7 +206,7 @@
  344. if ((GetVersion() & 0x80000000) == 0)
  345. {
  346. //Unicode Os - Unicode Aware
  347. - pluginInfo.flags = 1;
  348. + pluginInfo.flags = UNICODE_AWARE;
  349. }
  350. return &pluginInfo;
  351. }
  352. Index: trunk/sdk/m_folders.h
  353. ===================================================================
  354. --- trunk/sdk/m_folders.h (Revision 116)
  355. +++ trunk/sdk/m_folders.h (Arbeitskopie)
  356. @@ -27,12 +27,14 @@
  357. #define CURRENT_PROFILE "%current_profile%"
  358. #define MIRANDA_PATH "%miranda_path%"
  359. #define PLUGINS_PATH "%miranda_path%" "\\plugins"
  360. +#define MIRANDA_USERDATA "%miranda_userdata%"
  361. #define TO_WIDE(x) L ## x
  362. #define PROFILE_PATHW L"%profile_path%"
  363. #define CURRENT_PROFILEW L"%current_profile%"
  364. #define MIRANDA_PATHW L"%miranda_path%"
  365. +#define MIRANDA_USERDATAW L"%miranda_userdata%"
  366. #define FOLDER_AVATARS PROFILE_PATH "\\" CURRENT_PROFILE "\\avatars"
  367. #define FOLDER_VCARDS PROFILE_PATH "\\" CURRENT_PROFILE "\\vcards"
  368. @@ -78,16 +80,16 @@
  369. /*Folders/Register/Path service
  370. wParam - not used, must be 0
  371. - lParam - (LPARAM) (const FOLDERDATA *) - Data structure filled with
  372. + lParam - (LPARAM) (const FOLDERDATA *) - Data structure filled with
  373. the necessary information.
  374. - Returns a handle to the registered path or 0 on error.
  375. + Returns a handle to the registered path or 0 on error.
  376. You need to use this to call the other services.
  377. */
  378. #define MS_FOLDERS_REGISTER_PATH "Folders/Register/Path"
  379. /*Folders/Get/PathSize service
  380. wParam - (WPARAM) (int) - handle to registered path
  381. - lParam - (LPARAM) (int *) - pointer to the variable that receives the size of the path
  382. + lParam - (LPARAM) (int *) - pointer to the variable that receives the size of the path
  383. string (not including the null character). Depending on the flags set when creating the path
  384. it will either call strlen() or wcslen() to get the length of the string.
  385. Returns the size of the buffer.
  386. @@ -172,10 +174,10 @@
  387. return (HANDLE) CallService(MS_FOLDERS_REGISTER_PATH, 0, (LPARAM) &fd);
  388. }
  389. -__inline static int FoldersGetCustomPath(HANDLE hFolderEntry, char *path, const int size, char *notFound)
  390. +__inline static INT_PTR FoldersGetCustomPath(HANDLE hFolderEntry, char *path, const int size, const char *notFound)
  391. {
  392. FOLDERSGETDATA fgd = {0};
  393. - int res;
  394. + INT_PTR res;
  395. fgd.cbSize = sizeof(FOLDERSGETDATA);
  396. fgd.nMaxPathSize = size;
  397. fgd.szPath = path;
  398. @@ -186,14 +188,14 @@
  399. CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM) notFound, (LPARAM) buffer);
  400. mir_snprintf(path, size, "%s", buffer);
  401. }
  402. -
  403. +
  404. return res;
  405. }
  406. -__inline static int FoldersGetCustomPathW(HANDLE hFolderEntry, wchar_t *pathW, const int count, wchar_t *notFoundW)
  407. +__inline static INT_PTR FoldersGetCustomPathW(HANDLE hFolderEntry, wchar_t *pathW, const int count, const wchar_t *notFoundW)
  408. {
  409. FOLDERSGETDATA fgd = {0};
  410. - int res;
  411. + INT_PTR res;
  412. fgd.cbSize = sizeof(FOLDERSGETDATA);
  413. fgd.nMaxPathSize = count;
  414. fgd.szPathW = pathW;
  415. @@ -203,14 +205,14 @@
  416. wcsncpy(pathW, notFoundW, count);
  417. pathW[count - 1] = '\0';
  418. }
  419. -
  420. +
  421. return res;
  422. }
  423. -__inline static int FoldersGetCustomPathEx(HANDLE hFolderEntry, char *path, const int size, char *notFound, char *fileName)
  424. +__inline static INT_PTR FoldersGetCustomPathEx(HANDLE hFolderEntry, char *path, const int size, char *notFound, char *fileName)
  425. {
  426. FOLDERSGETDATA fgd = {0};
  427. - int res;
  428. + INT_PTR res;
  429. fgd.cbSize = sizeof(FOLDERSGETDATA);
  430. fgd.nMaxPathSize = size;
  431. fgd.szPath = path;
  432. @@ -228,19 +230,19 @@
  433. else{
  434. path[0] = '\0';
  435. }
  436. -
  437. +
  438. if (fileName)
  439. {
  440. strcat(path, fileName);
  441. }
  442. -
  443. +
  444. return res;
  445. }
  446. -__inline static int FoldersGetCustomPathExW(HANDLE hFolderEntry, wchar_t *pathW, const int count, wchar_t *notFoundW, wchar_t *fileNameW)
  447. +__inline static INT_PTR FoldersGetCustomPathExW(HANDLE hFolderEntry, wchar_t *pathW, const int count, wchar_t *notFoundW, wchar_t *fileNameW)
  448. {
  449. FOLDERSGETDATA fgd = {0};
  450. - int res;
  451. + INT_PTR res;
  452. fgd.cbSize = sizeof(FOLDERSGETDATA);
  453. fgd.nMaxPathSize = count;
  454. fgd.szPathW = pathW;
  455. @@ -250,7 +252,7 @@
  456. wcsncpy(pathW, notFoundW, count);
  457. pathW[count - 1] = '\0';
  458. }
  459. -
  460. +
  461. if (wcslen(pathW) > 0)
  462. {
  463. wcscat(pathW, L"\\");
  464. @@ -258,12 +260,12 @@
  465. else{
  466. pathW[0] = L'\0';
  467. }
  468. -
  469. +
  470. if (fileNameW)
  471. {
  472. wcscat(pathW, fileNameW);
  473. }
  474. -
  475. +
  476. return res;
  477. }
  478. @@ -279,4 +281,4 @@
  479. #endif
  480. -#endif //M_CUSTOM_FOLDERS_H
  481. +#endif //M_CUSTOM_FOLDERS_H
  482. \ No newline at end of file
  483. Index: trunk/security.c
  484. ===================================================================
  485. --- trunk/security.c (Revision 116)
  486. +++ trunk/security.c (Arbeitskopie)
  487. @@ -93,7 +93,7 @@
  488. if(!bEncoding)
  489. return;
  490. - CryptoEngine->EncryptMem(dst, size, key);
  491. + CryptoEngine->EncryptMem((BYTE*)dst,(int) size, key);
  492. }
  493. void DecodeCopyMemory(void * dst, void * src, size_t size )
  494. @@ -103,7 +103,7 @@
  495. if(!bEncoding)
  496. return;
  497. - CryptoEngine->DecryptMem(dst, size, key);
  498. + CryptoEngine->DecryptMem((BYTE*)dst, (int)size, key);
  499. }
  500. void EncodeDBWrite(DWORD ofs, void * src, size_t size)
  501. @@ -114,12 +114,12 @@
  502. buf = (BYTE*)GlobalAlloc(GPTR, sizeof(BYTE)*size);
  503. EncodeCopyMemory(buf, src, size);
  504. - DBWrite(ofs,buf,size);
  505. + DBWrite(ofs,buf,(int)size);
  506. GlobalFree(buf);
  507. }
  508. else
  509. {
  510. - DBWrite(ofs,src,size);
  511. + DBWrite(ofs,src,(int)size);
  512. }
  513. }
  514. @@ -128,16 +128,14 @@
  515. if(bEncoding)
  516. {
  517. - BYTE * buf;
  518. -
  519. - buf = (BYTE*)GlobalAlloc(GPTR, sizeof(BYTE)*size);
  520. + BYTE * buf = (BYTE*)GlobalAlloc(GPTR, sizeof(BYTE)*size);
  521. DecodeCopyMemory(buf, src, size);
  522. - DBWrite(ofs,buf,size);
  523. + DBWrite(ofs,buf,(int)size);
  524. GlobalFree(buf);
  525. }
  526. else
  527. {
  528. - DBWrite(ofs,src,size);
  529. + DBWrite(ofs,src,(int)size);
  530. }
  531. }
  532. @@ -242,9 +240,7 @@
  533. void EncodeAll()
  534. {
  535. - HANDLE hContact;
  536. -
  537. - hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
  538. + HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
  539. if(hContact){
  540. do{
  541. EncodeContactEvents(hContact);
  542. @@ -258,9 +254,7 @@
  543. void DecodeAll()
  544. {
  545. - HANDLE hContact;
  546. -
  547. - hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
  548. + HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
  549. if(hContact){
  550. do{
  551. DecodeContactEvents(hContact);
  552. @@ -365,7 +359,7 @@
  553. bEncoding = 0;
  554. - zero_fill(encryptKey, sizeof encryptKey);
  555. + zero_fill((BYTE*)encryptKey, sizeof encryptKey);
  556. if (gl_bUnicodeAwareCore)
  557. xModifyMenu(hSetPwdMenu, 0, LPGENT("Set Password"), 0);
  558. @@ -421,7 +415,7 @@
  559. CryptoEngine = NULL;
  560. DBWriteContactSettingWord(NULL, "SecureMMAP", "CryptoModule", 0);
  561. - zero_fill(encryptKey, sizeof encryptKey);
  562. + zero_fill((BYTE*)encryptKey, sizeof encryptKey);
  563. if (gl_bUnicodeAwareCore)
  564. xModifyMenu(hSetPwdMenu, 0, LPGENT("Set Password"), 0);
  565. @@ -442,7 +436,7 @@
  566. WriteCryptHeader();
  567. }
  568. - zero_fill(newpass, sizeof newpass);
  569. + zero_fill((BYTE*)newpass, sizeof newpass);
  570. LeaveCriticalSection(&csDbAccess);
  571. }
  572. \ No newline at end of file