Changeset 1335 for trunk/dll/dircnrs.c
- Timestamp:
 - Dec 13, 2008, 12:49:02 AM (17 years ago)
 - File:
 - 
      
- 1 edited
 
- 
          
  trunk/dll/dircnrs.c (modified) (21 diffs)
 
 
Legend:
- Unmodified
 - Added
 - Removed
 
- 
      
trunk/dll/dircnrs.c
r1318 r1335 1 1 2 /*********************************************************************** 2 3 … … 44 45 DIRCNRDATA struct) into a new struct: DETAILS_SETTINGS. 45 46 20 Jul 08 GKY Add save/append filename to clipboard. 46 Change menu wording to make these easier to find47 Change menu wording to make these easier to find 47 48 02 Aug 08 GKY Always pass temp variable point to treecnr UM_SHOWME to avoid 48 freeing dcd->directory early49 freeing dcd->directory early 49 50 25 Aug 08 GKY Check TMP directory space warn if lee than 5 MiB prevent archiver from opening if 50 less than 10 KiB (It hangs and can't be closed)51 less than 10 KiB (It hangs and can't be closed) 51 52 29 Nov 08 GKY Remove or replace with a mutex semaphore DosEnterCriSec where appropriate. 53 10 Dec 08 SHL Integrate exception handler support 52 54 53 55 ***********************************************************************/ … … 57 59 #include <ctype.h> 58 60 #include <limits.h> 59 #include <process.h> // _beginthread61 // #include <process.h> // _beginthread 60 62 61 63 #define INCL_DOS … … 83 85 #include "notebook.h" // CfgDlgProc 84 86 #include "command.h" // RunCommand 85 #include "worker.h" // Action, MassAction87 #include "worker.h" // Action, MassAction 86 88 #include "misc.h" // GetTidForThread, AdjustCnrColsForFSType, AdjustCnrColsForPref 87 // AdjustDetailsSwitches, CnrDirectEdit, OpenEdit, QuickPopup88 // SayFilter, SaySort, SayView, SetCnrCols, SetDetailsSwitches89 // SetSortChecks, SetViewMenu, SwitchCommand, CheckMenu90 // CurrentRecord, DrawTargetEmphasis, IsFm2Window89 // AdjustDetailsSwitches, CnrDirectEdit, OpenEdit, QuickPopup 90 // SayFilter, SaySort, SayView, SetCnrCols, SetDetailsSwitches 91 // SetSortChecks, SetViewMenu, SwitchCommand, CheckMenu 92 // CurrentRecord, DrawTargetEmphasis, IsFm2Window 91 93 #include "chklist.h" // CenterOverWindow, DropListProc 92 94 #include "common.h" // CommonCnrProc, CommonCreateTextChildren, CommonFrameWndProc 93 // CommonTextPaint, CommonTextButton, CommonTextProc95 // CommonTextPaint, CommonTextButton, CommonTextProc 94 96 #include "mainwnd.h" // CountDirCnrs, GetNextWindowPos, MakeBubble, TopWindow 95 97 #include "select.h" // DeselectAll, HideAll, InvertAll, SelectAll, SelectList 96 // SpecialSelect298 // SpecialSelect2 97 99 #include "dirsize.h" // DirSizeProc 98 100 #include "flesh.h" // Flesh, Stubby, UnFlesh … … 126 128 #include "wrappers.h" // xfree 127 129 #include "fortify.h" 130 #include "excputil.h" // 06 May 08 SHL added 128 131 129 132 // Data definitions … … 711 714 # ifdef FORTIFY 712 715 Fortify_BecomeOwner(dcd); // We free dcd 716 if (GetTidForThread() != 1) 717 Fortify_ChangeScope(dcd, -1); 713 718 # endif 714 719 /* set unique id */ … … 720 725 else 721 726 PostMsg(hwnd, WM_CLOSE, MPVOID, MPVOID); 727 # ifdef FORTIFY 728 // TID 1 will free data 729 if (GetTidForThread() != 1) 730 Fortify_LeaveScope(); 731 # endif 722 732 return 0; 723 733 … … 780 790 MPFROMP(pci), 781 791 MPFROM2SHORT(CMA_FIRSTCHILD, CMA_ITEMORDER)); 782 if (!pciC) {783 Stubby(dcd->hwndCnr, pci);792 if (!pciC) { 793 Stubby(dcd->hwndCnr, pci); 784 794 //DosSleep(1); //26 Aug 07 GKY 1 785 795 } … … 787 797 pci = WinSendMsg(dcd->hwndCnr, 788 798 CM_QUERYRECORD, 789 MPFROMP(pci), MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));799 MPFROMP(pci), MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER)); 790 800 } 791 801 dcd->firsttree = TRUE; … … 804 814 dcd->stopflag--; 805 815 if (dcd->stopflag) { 806 DosReleaseMutexSem(hmtxFM2Globals);807 //DosExitCritSec();816 DosReleaseMutexSem(hmtxFM2Globals); 817 //DosExitCritSec(); 808 818 return 0; 809 819 } … … 842 852 } 843 853 if (fSwitchTree && hwndTree) { 844 PSZ pszTempDir = xstrdup(dcd->directory, pszSrcFile, __LINE__);845 846 if (hwndMain) {854 PSZ pszTempDir = xstrdup(dcd->directory, pszSrcFile, __LINE__); 855 856 if (hwndMain) { 847 857 if (TopWindow(hwndMain, (HWND) 0) == dcd->hwndFrame && pszTempDir) 848 if (!WinSendMsg(hwndTree, UM_SHOWME, MPFROMP(pszTempDir), MPVOID))849 free(pszTempDir);850 } 851 else {852 if (pszTempDir)853 if (!WinSendMsg(hwndTree, UM_SHOWME, MPFROMP(pszTempDir), MPVOID))854 free(pszTempDir);855 }858 if (!WinSendMsg(hwndTree, UM_SHOWME, MPFROMP(pszTempDir), MPVOID)) 859 free(pszTempDir); 860 } 861 else { 862 if (pszTempDir) 863 if (!WinSendMsg(hwndTree, UM_SHOWME, MPFROMP(pszTempDir), MPVOID)) 864 free(pszTempDir); 865 } 856 866 } 857 867 dcd->firsttree = FALSE; … … 1085 1095 wk->li = (LISTINFO *) mp1; 1086 1096 strcpy(wk->directory, dcd->directory); 1087 if (_beginthread(MassAction, NULL, 122880, (PVOID) wk) == -1) { 1088 Runtime_Error(pszSrcFile, __LINE__, 1089 GetPString(IDS_COULDNTSTARTTHREADTEXT)); 1097 if (xbeginthread(MassAction, 1098 122880, 1099 wk, 1100 pszSrcFile, 1101 __LINE__) == -1) 1102 { 1090 1103 free(wk); 1091 FreeListInfo((LISTINFO *) mp1);1104 FreeListInfo((LISTINFO *)mp1); 1092 1105 } 1093 1106 } … … 1121 1134 wk->li = (LISTINFO *) mp1; 1122 1135 strcpy(wk->directory, dcd->directory); 1123 if (_beginthread(Action, NULL, 122880, (PVOID) wk) == -1) { 1136 if (xbeginthread(Action, 1137 122880, 1138 wk, 1139 pszSrcFile, 1140 __LINE__) == -1) 1141 { 1124 1142 Runtime_Error(pszSrcFile, __LINE__, 1125 1143 GetPString(IDS_COULDNTSTARTTHREADTEXT)); … … 1144 1162 # endif 1145 1163 dcd = WinQueryWindowPtr(hwnd, QWL_USER); 1146 if (dcd) { 1164 if (!dcd) 1165 Runtime_Error(pszSrcFile, __LINE__, "no data"); 1166 else { 1147 1167 if (dcd->hwndRestore) 1148 1168 WinSetWindowPos(dcd->hwndRestore, … … 1155 1175 FreeList(dcd->lastselection); 1156 1176 xfree(dcd, pszSrcFile, __LINE__); 1157 # ifdef FORTIFY1158 Fortify_LeaveScope();1159 # endif1160 1177 WinSetWindowPtr(dcd->hwndCnr, QWL_USER, NULL); 1161 1178 DosPostEventSem(CompactSem); 1162 1179 } 1180 # ifdef FORTIFY 1181 Fortify_LeaveScope(); 1182 # endif 1183 // 22 Jul 08 SHL fixme to understand 1163 1184 if (!PostMsg((HWND) 0, WM_QUIT, MPVOID, MPVOID)) 1164 1185 WinSendMsg((HWND) 0, WM_QUIT, MPVOID, MPVOID); … … 1402 1423 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID); 1403 1424 if (fSwitchTreeOnFocus && hwndTree && dcd && *dcd->directory) { 1404 PSZ pszTempDir = xstrdup(dcd->directory, pszSrcFile, __LINE__);1405 1406 if (pszTempDir) {1407 if (!WinSendMsg(hwndTree, UM_SHOWME, MPFROMP(pszTempDir), MPVOID))1408 free(pszTempDir);1409 }1425 PSZ pszTempDir = xstrdup(dcd->directory, pszSrcFile, __LINE__); 1426 1427 if (pszTempDir) { 1428 if (!WinSendMsg(hwndTree, UM_SHOWME, MPFROMP(pszTempDir), MPVOID)) 1429 free(pszTempDir); 1430 } 1410 1431 } 1411 1432 } … … 1609 1630 CMA_CXTREEINDENT | CMA_PSORTRECORD)); 1610 1631 SetCnrCols(hwnd, FALSE); 1611 if (_beginthread(MakeObjWin, NULL, 245760, (PVOID) dcd) == -1) { 1632 if (xbeginthread(MakeObjWin, 1633 245760, 1634 dcd, 1635 pszSrcFile, 1636 __LINE__) == -1) 1637 { 1612 1638 Runtime_Error(pszSrcFile, __LINE__, 1613 1639 GetPString(IDS_COULDNTSTARTTHREADTEXT)); … … 1664 1690 } 1665 1691 else if (mp1 && IsFile(mp1) == 1 && 1666 CheckDriveSpaceAvail(ArcTempRoot, ullDATFileSpaceNeeded, ullTmpSpaceNeeded) != 2) {1692 CheckDriveSpaceAvail(ArcTempRoot, ullDATFileSpaceNeeded, ullTmpSpaceNeeded) != 2) { 1667 1693 StartArcCnr(HWND_DESKTOP, 1668 1694 dcd->hwndFrame, (CHAR *)mp1, 4, (ARC_TYPE *) mp2); … … 1917 1943 1918 1944 case IDM_FINDINTREE: 1919 if (hwndTree) {1920 PSZ pszTempDir = xstrdup(dcd->directory, pszSrcFile, __LINE__);1921 1922 if (pszTempDir) {1923 if (!WinSendMsg(hwndTree, UM_SHOWME, MPFROMP(pszTempDir),1924 MPFROMLONG(1L)))1925 free(pszTempDir);1926 }1927 }1945 if (hwndTree) { 1946 PSZ pszTempDir = xstrdup(dcd->directory, pszSrcFile, __LINE__); 1947 1948 if (pszTempDir) { 1949 if (!WinSendMsg(hwndTree, UM_SHOWME, MPFROMP(pszTempDir), 1950 MPFROMLONG(1L))) 1951 free(pszTempDir); 1952 } 1953 } 1928 1954 break; 1929 1955 … … 2662 2688 } 2663 2689 switch (SHORT1FROMMP(mp1)) { 2664 case IDM_APPENDTOCLIP:2665 case IDM_APPENDTOCLIPFILENAME:2666 case IDM_SAVETOCLIP:2667 case IDM_SAVETOCLIPFILENAME:2690 case IDM_APPENDTOCLIP: 2691 case IDM_APPENDTOCLIPFILENAME: 2692 case IDM_SAVETOCLIP: 2693 case IDM_SAVETOCLIPFILENAME: 2668 2694 case IDM_ARCHIVE: 2669 2695 case IDM_ARCHIVEM: … … 3656 3682 CommonCreateTextChildren(dcd->hwndClient, 3657 3683 WC_DIRSTATUS, ids); 3658 }3684 } 3659 3685 if (!PostMsg(dcd->hwndCnr, UM_SETUP, MPVOID, MPVOID)) 3660 3686 WinSendMsg(dcd->hwndCnr, UM_SETUP, MPVOID, MPVOID);  
  Note:
 See   TracChangeset
 for help on using the changeset viewer.
  