Changeset 36
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/datamin.c
r30 r36 10 10 11 11 Revisions 14 Sep 02 SHL - Handle large partitions 12 16 Oct 02 SHL - Handle large partitions better 12 13 13 14 ***********************************************************************/ … … 618 619 case UM_PAINT: 619 620 { 620 CHAR s[90], tpm[38],*kfree,path[] = " :",621 CHAR s[90],szFreeQty[38],*pszFreeUM,path[] = " :", 621 622 *szBuf = NULL,*FSystem = NULL; 622 ULONG freebytes,percentfree,wasx,size; 623 ULONG cbPerUnit; 624 UINT cShift; 623 float fltFreeQty; 624 ULONG percentfree,wasx,size; 625 625 HPS hps = (HPS)mp2; 626 626 FSALLOCATE fsa; … … 637 637 if(!WinQueryWindowPos(hwndTemp,&swp)) 638 638 return 0; 639 * tpm= 0;639 *szFreeQty = 0; 640 640 DosError(FERR_DISABLEHARDERR); 641 641 if(!DosQueryFSInfo((id - MINI_DRIVEA) + 1, … … 643 643 &fsa, 644 644 sizeof(FSALLOCATE))) { 645 // Scale to avoid overflow on large drives 646 cbPerUnit = fsa.cSectorUnit * fsa.cbSector; 647 for (cShift = 0; cbPerUnit && ~cbPerUnit & 1 && cShift < 20; cShift++) 648 cbPerUnit >>= 1; 649 freebytes = fsa.cUnitAvail * cbPerUnit; // Scaled by cShift 650 if (freebytes >= (1024 * 1024) >> cShift) { 651 freebytes /= (1024 * 1024) >> cShift; 652 kfree = "mb"; 653 } 654 else if (freebytes << cShift >= 1024) { 655 freebytes <<= cShift; 656 freebytes /= 1024; 657 kfree = "kb"; 645 fltFreeQty = (float)fsa.cUnitAvail * (fsa.cSectorUnit * fsa.cbSector); 646 if (fltFreeQty >= (1024 * 1024)) { 647 fltFreeQty /= (1024 * 1024); 648 pszFreeUM = "mb"; 649 } 650 else if (fltFreeQty >= 1024) { 651 fltFreeQty /= 1024; 652 pszFreeUM = "kb"; 658 653 } 659 654 else 660 { 661 freebytes <<= cShift; 662 kfree = "b"; 663 } 655 { 656 pszFreeUM = "b"; 657 } 664 658 percentfree = (fsa.cUnit && fsa.cUnitAvail) ? 665 (fsa.cUnitAvail * 100) / fsa.cUnit : 0;666 commafmt( tpm,sizeof(tpm),freebytes);659 (fsa.cUnitAvail * 100) / fsa.cUnit : 0; 660 commafmt(szFreeQty,sizeof(szFreeQty),(ULONG)fltFreeQty); 667 661 *path = (CHAR)(id - MINI_DRIVEA) + 'A'; 668 662 if(!DosAllocMem((PVOID)&szBuf, … … 687 681 " %s %s%s (%lu%%) %s%s%s%s", 688 682 path, 689 tpm,690 kfree,683 szFreeQty, 684 pszFreeUM, 691 685 percentfree, 692 686 GetPString(IDS_FREETEXT), … … 870 864 case UM_SETUP2: 871 865 { 872 CHAR s[134],tm[38],tpm[38],*tmk,*tpmk; 873 FILEFINDBUF3 ffb; 874 ULONG nm = 1L; 875 HDIR hdir = HDIR_CREATE; 876 FSALLOCATE fsa; 866 CHAR s[134],szFileQty[38],szFreeQty[38],*pszFileUM,*pszFreeUM; 867 FILEFINDBUF3 ffb; 868 ULONG nm = 1L; 869 float fltFreeQty; 870 HDIR hdir = HDIR_CREATE; 871 FSALLOCATE fsa; 877 872 878 873 if(*SwapperDat) { … … 883 878 priority_bumped(); 884 879 DosFindClose(hdir); 885 * tm = *tpm= 0;880 *szFileQty = *szFreeQty = 0; 886 881 DosError(FERR_DISABLEHARDERR); 887 882 if(!DosQueryFSInfo(toupper(*SwapperDat) - '@',FSIL_ALLOC, 888 883 &fsa,sizeof(FSALLOCATE))) { 889 nm= fsa.cUnitAvail * (fsa.cSectorUnit * fsa.cbSector);890 if( nm> 1024 * 1024) {891 tpmk= "mb";892 commafmt(tpm,sizeof(tpm),nm / (1024 * 1024));884 fltFreeQty = fsa.cUnitAvail * (fsa.cSectorUnit * fsa.cbSector); 885 if(fltFreeQty > 1024 * 1024) { 886 pszFreeUM = "mb"; 887 fltFreeQty /= (1024 * 1024); 893 888 } 894 else if( nm> 1024) {895 tpmk= "kb";896 commafmt(tpm,sizeof(tpm),nm / 1024);889 else if(fltFreeQty > 1024) { 890 pszFreeUM = "kb"; 891 fltFreeQty /= 1024; 897 892 } 898 893 else { 899 tpmk = "b"; 900 commafmt(tpm,sizeof(tpm),nm); 894 pszFreeUM = "b"; 901 895 } 896 commafmt(szFreeQty,sizeof(szFreeQty),(ULONG)fltFreeQty); 902 897 } 903 898 if(ffb.cbFile > 1024 * 1024) { 904 tmk= "mb";905 commafmt( tm,sizeof(tm),ffb.cbFile / (1024 * 1024));899 pszFileUM = "mb"; 900 commafmt(szFileQty,sizeof(szFileQty),ffb.cbFile / (1024 * 1024)); 906 901 } 907 902 else if(ffb.cbFile > 1024) { 908 tmk= "kb";909 commafmt( tm,sizeof(tm),ffb.cbFile / 1024);903 pszFileUM = "kb"; 904 commafmt(szFileQty,sizeof(szFileQty),ffb.cbFile / 1024); 910 905 } 911 906 else { 912 tmk= "b";913 commafmt( tm,sizeof(tm),ffb.cbFile);907 pszFileUM = "b"; 908 commafmt(szFileQty,sizeof(szFileQty),ffb.cbFile); 914 909 } 915 910 sprintf(s," %s %s%s%s%s%s", 916 911 GetPString(IDS_SWAPTITLETEXT), 917 tm,918 tmk,919 (* tpm) ? "/" : NullStr,920 tpm,921 (* tpm) ? tpmk: NullStr);912 szFileQty, 913 pszFileUM, 914 (*szFreeQty) ? "/" : NullStr, 915 szFreeQty, 916 (*szFreeQty) ? pszFreeUM : NullStr); 922 917 WinSetDlgItemText(hwnd, 923 918 MINI_SWAP, … … 930 925 case UM_SETUP3: 931 926 { 932 CHAR s[134],tm[38], tpm[38],*tpmk,*tmk;927 CHAR s[134],tm[38],szQty[38],*pszUM,*tmk; 933 928 ULONG amem = 0; 934 929 935 930 if(!DosQuerySysInfo(QSV_TOTAVAILMEM,QSV_TOTAVAILMEM, 936 931 (PVOID)&amem,(ULONG)sizeof(amem))) { 937 *tm = * tpm= 0;932 *tm = *szQty = 0; 938 933 if(amem > 1024 * 1024) { 939 934 tmk = "mb"; … … 950 945 if(!Dos16MemAvail(&amem)) { 951 946 if(amem > 1024 * 1024) { 952 tpmk= "mb";953 commafmt( tpm,sizeof(tpm),amem / (1024 * 1024));947 pszUM = "mb"; 948 commafmt(szQty,sizeof(szQty),amem / (1024 * 1024)); 954 949 } 955 950 else if(amem > 1024) { 956 tpmk= "kb";957 commafmt( tpm,sizeof(tpm),amem / 1024);951 pszUM = "kb"; 952 commafmt(szQty,sizeof(szQty),amem / 1024); 958 953 } 959 954 else { 960 tpmk= "b";961 commafmt( tpm,sizeof(tpm),amem);955 pszUM = "b"; 956 commafmt(szQty,sizeof(szQty),amem); 962 957 } 963 958 } 964 959 sprintf(s," %s%s%s%s%s%s", 965 960 GetPString(IDS_MEMTITLETEXT), 966 tpm,967 (* tpm) ? tpmk: NullStr,968 (* tpm) ? "/" : NullStr,961 szQty, 962 (*szQty) ? pszUM : NullStr, 963 (*szQty) ? "/" : NullStr, 969 964 tm, 970 965 tmk); … … 994 989 case UM_SETUP5: 995 990 { 996 CHAR s[134],tm[38], tpm[38];991 CHAR s[134],tm[38],szQty[38]; 997 992 998 993 if(fUseQProcStat && !noqproc) { … … 1018 1013 ppi = (PPROCESSINFO)(ppi->ptiFirst + ppi->usThreadCount); 1019 1014 } 1020 * tpm= *tm = 0;1021 commafmt( tpm,sizeof(tpm),numprocs);1015 *szQty = *tm = 0; 1016 commafmt(szQty,sizeof(szQty),numprocs); 1022 1017 commafmt(tm,sizeof(tm),numthreads); 1023 1018 sprintf(s, 1024 1019 " %s%s %s%s", 1025 1020 GetPString(IDS_PROCSTITLETEXT), 1026 tpm,1021 szQty, 1027 1022 GetPString(IDS_THRDSTITLETEXT), 1028 1023 tm); … … 1037 1032 } 1038 1033 else { 1039 * tpm= 0;1040 commafmt( tpm,sizeof(tpm),1034 *szQty = 0; 1035 commafmt(szQty,sizeof(szQty), 1041 1036 WinQuerySwitchList(WinQueryAnchorBlock(hwnd),(PSWBLOCK)0,0)); 1042 1037 sprintf(s, 1043 1038 " %s%s", 1044 1039 GetPString(IDS_TASKSTITLETEXT), 1045 tpm);1040 szQty); 1046 1041 WinSetDlgItemText(hwnd, 1047 1042 MINI_PROC, -
trunk/dll/dircnrs.c
r2 r36 1 2 /*********************************************************************** 3 4 $Id$ 5 6 Directory containers 7 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2001, 2002 Steven H.Levine 10 11 Revisions 16 Oct 02 SHL - Handle large partitions 12 13 ***********************************************************************/ 14 1 15 #define INCL_DOS 2 16 #define INCL_WIN … … 689 703 strcpy(fbytes," {"); 690 704 commafmt(fbytes + 3,sizeof(fbytes) - 5, 691 ( fsa.cUnitAvail * (fsa.cSectorUnit * fsa.cbSector)) /692 1024L);705 (ULONG)(((float)fsa.cUnitAvail * 706 (fsa.cSectorUnit * fsa.cbSector)) / 1024L)); 693 707 strcat(fbytes,GetPString(IDS_KFREETEXT)); 694 708 strcat(fbytes,"}"); -
trunk/dll/dirsize.c
r2 r36 1 2 /*********************************************************************** 3 4 $Id$ 5 6 Directory size 7 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2001, 2002 Steven H.Levine 10 11 Revisions 16 Oct 02 SHL - Handle large partitions 12 13 ***********************************************************************/ 14 1 15 #define INCL_DOS 2 16 #define INCL_WIN … … 85 99 return -1L; 86 100 } 87 //printf("CM_ALLOCRECORD\n");101 //printf("CM_ALLOCRECORD\n"); 88 102 pciP = WinSendMsg(hwndCnr,CM_ALLOCRECORD,MPFROMLONG(EXTRA_RECORD_BYTES2), 89 103 MPFROMLONG(1L)); … … 168 182 while(!rc) { 169 183 priority_normal(); 170 //printf("Found %lu\n",nm);184 //printf("Found %lu\n",nm); 171 185 for(x = 0L;x < nm;x++) { 172 186 pffbFile = (FILEFINDBUF4 *)fb; 173 //printf("%s\n",pffbFile->achName);174 //fflush(stdout);187 //printf("%s\n",pffbFile->achName); 188 //fflush(stdout); 175 189 if((*pffbFile->achName != '.' || (pffbFile->achName[1] && 176 190 pffbFile->achName[1] != '.')) || … … 222 236 223 237 CHAR tf[80],tb[80],tt[80],br[80]; 224 register CHAR 225 register ULONG 226 doublecntra = 0.0;238 register CHAR *p; 239 register ULONG cntr,x; 240 float cntra = 0.0; 227 241 228 242 commafmt(tf,sizeof(tf),(pci->cbFile > 0L && pci->cbFile < 1024L) ? 1L : … … 239 253 sizeof(FSALLOCATE)); 240 254 if(!rc) 241 cntra = ((totalbytes * 100.0) / 242 ((double)fsa.cUnit * 243 ((double)fsa.cSectorUnit * fsa.cbSector))); 255 cntra = (totalbytes * 100.0) / 256 ((float)fsa.cUnit * (fsa.cSectorUnit * fsa.cbSector)); 244 257 pci->Longname[1] = 1; 245 258 } 246 259 else 247 cntra = ((((double)pci->cbFile + pci->easize) * 100.0) / 248 (double)totalbytes); 260 cntra = (((float)pci->cbFile + pci->easize) * 100.0) / totalbytes; 249 261 cntr = (ULONG)cntra / 2; 250 262 p = br; … … 449 461 CHAR s[132],tf[80],tb[80],tu[80]; 450 462 451 commafmt(tf,sizeof(tf),(fsa.cUnitAvail * (fsa.cSectorUnit * 452 fsa.cbSector)) / 1024L); 453 commafmt(tb,sizeof(tb),(fsa.cUnit * (fsa.cSectorUnit * 454 fsa.cbSector)) / 1024L); 455 commafmt(tu,sizeof(tu),((fsa.cUnit - fsa.cUnitAvail) * 456 (fsa.cSectorUnit * fsa.cbSector)) / 1024L); 463 commafmt(tf,sizeof(tf), 464 (ULONG)(((float)fsa.cUnitAvail * 465 (fsa.cSectorUnit * fsa.cbSector)) / 1024L)); 466 commafmt(tb,sizeof(tb), 467 (ULONG)(((float)fsa.cUnit * 468 (fsa.cSectorUnit * fsa.cbSector)) / 1024L)); 469 commafmt(tu,sizeof(tu), 470 (ULONG)(((float)(fsa.cUnit - fsa.cUnitAvail) * 471 (fsa.cSectorUnit * fsa.cbSector)) / 1024L)); 457 472 sprintf(s, 458 473 GetPString(IDS_FREESPACETEXT), -
trunk/dll/info.c
r2 r36 1 2 /*********************************************************************** 3 4 $Id$ 5 6 Info window 7 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2001, 2002 Steven H.Levine 10 11 Revisions 16 Oct 02 SHL - Handle large partitions 12 13 ***********************************************************************/ 14 1 15 #define INCL_DOS 2 16 #define INCL_WIN … … 173 187 s); 174 188 sprintf(s, 175 "%lu mb, %lu kb, %lu %s%s",((fsa.cUnit * 176 (fsa.cSectorUnit * fsa.cbSector)) / 1024L) / 1024L, 177 (fsa.cUnit * (fsa.cSectorUnit * fsa.cbSector)) / 1024L, 189 "%lu mb, %lu kb, %lu %s%s", 190 (ULONG)(((float)fsa.cUnit * 191 (fsa.cSectorUnit * fsa.cbSector)) / (1024L * 1024L)), 192 (ULONG)(((float)fsa.cUnit * (fsa.cSectorUnit * fsa.cbSector)) / 1024L), 178 193 fsa.cUnit, 179 194 GetPString(IDS_UNITTEXT), … … 184 199 sprintf(s, 185 200 "%lu mb, %lu kb, %lu %s%s", 186 ((fsa.cUnitAvail * (fsa.cSectorUnit * fsa.cbSector)) / 1024L) / 1024L, 187 (fsa.cUnitAvail * (fsa.cSectorUnit * fsa.cbSector)) / 1024L, 201 (ULONG)(((float)fsa.cUnitAvail * 202 (fsa.cSectorUnit * fsa.cbSector)) / (1024L * 1024L)), 203 (ULONG)(((float)fsa.cUnitAvail * (fsa.cSectorUnit * fsa.cbSector)) / 1024L), 188 204 fsa.cUnitAvail, 189 205 GetPString(IDS_UNITTEXT), … … 975 991 return WinDefDlgProc(hwnd,msg,mp1,mp2); 976 992 } 977 993 978 994 979 995 MRESULT EXPENTRY SetDrvProc (HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2) { -
trunk/dll/mainwnd.c
r33 r36 10 10 11 11 Revisions 11 Jun 02 SHL - Drop obsolete xor code 12 16 Oct 02 SHL - Handle large partitions 12 13 13 14 ***********************************************************************/ … … 57 58 58 59 59 MRESULT EXPENTRY MainObjectWndProc (HWND hwnd,ULONG msg,MPARAM mp1, 60 MPARAM mp2) { 60 MRESULT EXPENTRY MainObjectWndProc (HWND hwnd,ULONG msg,MPARAM mp1, MPARAM mp2) { 61 61 62 62 switch(msg) { … … 96 96 97 97 FSALLOCATE fsa; 98 CHAR s[90],tpm[38],*kfree; 99 ULONG freebytes,percentfree; 98 CHAR s[90],szQty[38],*pszUM; 99 ULONG ulPctFree; 100 float fltFreeQty; 100 101 101 102 if(!DosQueryFSInfo((d - 'A') + 1, … … 103 104 &fsa, 104 105 sizeof(FSALLOCATE))) { 105 f reebytes =fsa.cUnitAvail *106 107 if(f reebytes>= (1024 * 1024)) {108 f reebytes/= (1024 * 1024);109 kfree= "mb";106 fltFreeQty = (float)fsa.cUnitAvail * 107 (fsa.cSectorUnit * fsa.cbSector); 108 if(fltFreeQty >= (1024 * 1024)) { 109 fltFreeQty /= (1024 * 1024); 110 pszUM = "mb"; 110 111 } 111 else if(f reebytes>= 1024) {112 f reebytes/= 1024;113 kfree= "kb";112 else if(fltFreeQty >= 1024) { 113 fltFreeQty /= 1024; 114 pszUM = "kb"; 114 115 } 115 116 else 116 kfree = "b"; 117 percentfree = (fsa.cUnit && fsa.cUnitAvail) ? 118 (fsa.cUnitAvail * 100) / fsa.cUnit : 119 0; 120 commafmt(tpm, 121 sizeof(tpm), 122 freebytes); 117 pszUM = "b"; 118 ulPctFree = (fsa.cUnit && fsa.cUnitAvail) ? 119 (fsa.cUnitAvail * 100) / fsa.cUnit : 0; 120 commafmt(szQty, 121 sizeof(szQty), 122 (ULONG)fltFreeQty); 123 123 sprintf(s, 124 124 "%s%s (%lu%%) free", 125 tpm,126 kfree,127 percentfree);125 szQty, 126 pszUM, 127 ulPctFree); 128 128 } 129 129 if((!hwndBubble || … … 210 210 VOID MakeMainObjWin (VOID *args) { 211 211 212 HAB 213 HMQ 212 HAB hab2; 213 HMQ hmq2; 214 214 QMSG qmsg2; 215 215 … … 289 289 HWND TopWindowName (HWND hwndParent,HWND exclude,CHAR *ret) { 290 290 291 HENUM 292 HWND 291 HENUM henum; 292 HWND hwndC = (HWND)0,hwndDir,hwndClient; 293 293 USHORT id; 294 294 PCNRITEM pci = NULL; … … 378 378 HWND FindDirCnrByName (CHAR *directory,BOOL restore) { 379 379 380 HENUM 381 HWND 382 CHAR 380 HENUM henum; 381 HWND hwndF = (HWND)0,hwndC,hwndDir; 382 CHAR retstr[CCHMAXPATH]; 383 383 384 384 if(hwndMain) { … … 456 456 VOID ResizeTools (HWND hwnd) { 457 457 458 register ULONG 459 INT 460 461 register TOOL 462 SWP 463 register ULONG 458 register ULONG butx = 18L; 459 INT attrib = SWP_MOVE | SWP_SIZE | SWP_SHOW | SWP_ZORDER | SWP_NOREDRAW, 460 noattrib; 461 register TOOL *tool,*starttool; 462 SWP *swp; 463 register ULONG numtools,x; 464 464 465 465 if(!fToolbar) … … 565 565 MRESULT EXPENTRY DropDownListProc (HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2) { 566 566 567 PFNWP 568 static HWND 569 USHORT 570 static BOOL 567 PFNWP oldproc = (PFNWP)INSTDATA(hwnd); 568 static HWND hwndMenu = (HWND)0; 569 USHORT id; 570 static BOOL emphasized = FALSE; 571 571 572 572 switch(msg) { … … 815 815 if(hwndBubble) { 816 816 817 HPS 818 POINTL 819 LONG 820 char 821 SWP 817 HPS hps; 818 POINTL aptl[TXTBOX_COUNT],ptl,tptl; 819 LONG lxScreen,sx,sy,extra = 0,lyScreen; 820 char *p,*pp,*wp; 821 SWP swp; 822 822 823 823 WinQueryWindowPos(hwnd,&swp); … … 921 921 case WM_PAINT: 922 922 { 923 HPS 924 SWP 923 HPS hps; 924 SWP swp; 925 925 POINTL ptl,aptl[TXTBOX_COUNT]; 926 CHAR 927 ULONG 926 CHAR *s,*p,*pp,*wp; 927 ULONG extra,tlen,y; 928 928 929 929 hps = WinBeginPaint(hwnd,(HPS)0,NULL); … … 1148 1148 MRESULT EXPENTRY ChildButtonProc (HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2) { 1149 1149 1150 USHORT 1151 register TOOL 1152 static HWND 1150 USHORT id; 1151 register TOOL *tool; 1152 static HWND hwndMenu = (HWND)0; 1153 1153 1154 1154 switch(msg) { … … 1188 1188 break; 1189 1189 1190 case IDM_HIDEANYTOOL: 1191 case IDM_HIDETOOL: 1190 case IDM_HIDEANYTOOL: /* hide any tool */ 1191 case IDM_HIDETOOL: /* hide tool */ 1192 1192 if(SHORT1FROMMP(mp1) == IDM_HIDETOOL) 1193 1193 id = WinQueryWindowUShort(hwnd,QWS_ID); … … 1206 1206 break; 1207 1207 1208 case IDM_SHOWTOOLS: 1208 case IDM_SHOWTOOLS: /* show all tools */ 1209 1209 tool = toolhead; 1210 1210 while(tool) { … … 1215 1215 break; 1216 1216 1217 case IDM_DELETEANYTOOL: 1218 case IDM_DELETETOOL: 1217 case IDM_DELETEANYTOOL: /* delete any button */ 1218 case IDM_DELETETOOL: /* delete button */ 1219 1219 if(SHORT1FROMMP(mp1) == IDM_DELETETOOL) 1220 1220 id = WinQueryWindowUShort(hwnd,QWS_ID); … … 1228 1228 return 0; 1229 1229 1230 case IDM_EDITANYTOOL: 1231 case IDM_EDITTOOL: 1230 case IDM_EDITANYTOOL: /* edit any button */ 1231 case IDM_EDITTOOL: /* edit button */ 1232 1232 if(SHORT1FROMMP(mp1) == IDM_EDITTOOL) 1233 1233 id = WinQueryWindowUShort(hwnd,QWS_ID); … … 1249 1249 break; 1250 1250 1251 case IDM_ADDTOOL: 1251 case IDM_ADDTOOL: /* add tool */ 1252 1252 id = (USHORT)WinDlgBox(HWND_DESKTOP,hwnd,AddToolProc,FM3ModHandle, 1253 1253 ADDBTN_FRAME,MPVOID); … … 1306 1306 case DM_DRAGOVER: 1307 1307 { 1308 PDRAGINFO pDInfo; /* Pointer to DRAGINFO*/1309 1310 pDInfo = (PDRAGINFO)mp1; 1311 DrgAccessDraginfo(pDInfo); /* Access DRAGINFO*/1308 PDRAGINFO pDInfo; /* Pointer to DRAGINFO */ 1309 1310 pDInfo = (PDRAGINFO)mp1; /* Get DRAGINFO pointer */ 1311 DrgAccessDraginfo(pDInfo); /* Access DRAGINFO */ 1312 1312 id = WinQueryWindowUShort(hwnd,QWS_ID); 1313 1313 tool = find_tool(id); 1314 1314 if(!tool) { 1315 1315 DrgFreeDraginfo(pDInfo); 1316 return(MRFROM2SHORT(DOR_NEVERDROP,0)); /* Drop not valid 1316 return(MRFROM2SHORT(DOR_NEVERDROP,0)); /* Drop not valid */ 1317 1317 } 1318 1318 if(!(tool->flags & T_DROPABLE)) { 1319 1319 DrgFreeDraginfo(pDInfo); 1320 return(MRFROM2SHORT(DOR_NEVERDROP,0)); /* Drop not valid 1320 return(MRFROM2SHORT(DOR_NEVERDROP,0)); /* Drop not valid */ 1321 1321 } 1322 1322 { 1323 PDRAGITEM pDItem; /* Pointer to DRAGITEM*/1324 1325 pDItem = DrgQueryDragitemPtr(pDInfo, /* Access DRAGITEM*/1326 0); /* Index to DRAGITEM*/1327 if(DrgVerifyRMF(pDItem, 1328 DRM_OS2FILE,/* mechanisms and data */1329 NULL)) { /* formats*/1323 PDRAGITEM pDItem; /* Pointer to DRAGITEM */ 1324 1325 pDItem = DrgQueryDragitemPtr(pDInfo, /* Access DRAGITEM */ 1326 0); /* Index to DRAGITEM */ 1327 if(DrgVerifyRMF(pDItem, /* Check valid rendering */ 1328 DRM_OS2FILE, /* mechanisms and data */ 1329 NULL)) { /* formats */ 1330 1330 if(!(tool->flags & T_EMPHASIZED)) { 1331 1331 tool->flags |= T_EMPHASIZED; … … 1333 1333 DrgFreeDraginfo(pDInfo); 1334 1334 } 1335 return(MRFROM2SHORT(DOR_DROP, 1336 DO_MOVE));/* Move operation valid */1335 return(MRFROM2SHORT(DOR_DROP, /* Return okay to drop */ 1336 DO_MOVE)); /* Move operation valid */ 1337 1337 } 1338 1338 DrgFreeDraginfo(pDInfo); … … 1409 1409 VOID BuildTools (HWND hwndT,BOOL resize) { 1410 1410 1411 register TOOL 1412 register ULONGctrlxpos = 18L;1413 CHAR 1414 HENUM 1415 HWND 1411 register TOOL *tool; 1412 register ULONG ctrlxpos = 18L; 1413 CHAR s[33]; 1414 HENUM henum; 1415 HWND hwndTool; 1416 1416 1417 1417 henum = WinBeginEnumWindows(hwndT); … … 1448 1448 if(!hwndTool) { 1449 1449 1450 HBITMAP 1450 HBITMAP hbm; 1451 1451 1452 1452 hbm = LoadBitmapFromFileNum(tool->id); … … 1561 1561 MRESULT EXPENTRY CommandLineProc (HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2) { 1562 1562 1563 PFNWP 1564 static BOOL 1563 PFNWP oldproc = (PFNWP)WinQueryWindowPtr(hwnd,0); 1564 static BOOL lbup = FALSE; 1565 1565 1566 1566 switch(msg) { … … 1636 1636 { 1637 1637 static char directory[CCHMAXPATH],cl[1000]; 1638 char**list = NULL;1639 ULONGlen;1640 HWNDhwndCnr;1638 char **list = NULL; 1639 ULONG len; 1640 HWND hwndCnr; 1641 1641 1642 1642 *directory = *cl = 0; 1643 strcpy(cl,GetCmdSpec(FALSE));1643 strcpy(cl,GetCmdSpec(FALSE)); 1644 1644 strcat(cl," /C "); 1645 1645 len = strlen(cl); … … 2038 2038 CNRDRAGINFO cnd; 2039 2039 LISTINFO *li; 2040 ULONG 2040 ULONG action = UM_ACTION; 2041 2041 2042 2042 -
trunk/dll/seeall.c
r2 r36 1 2 /*********************************************************************** 3 4 $Id$ 5 6 See all matching files 7 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2001, 2002 Steven H.Levine 10 11 Revisions 16 Oct 02 SHL - Handle large partitions 12 13 ***********************************************************************/ 14 1 15 #define INCL_DOS 2 16 #define INCL_DOSERRORS … … 733 747 734 748 FSALLOCATE fsa; 735 ULONG totalsize;749 ULONG clFreeBytes; 736 750 CHAR *ptr; 737 751 INT cntr; … … 742 756 if(!DosQueryFSInfo(toupper(*newname) - '@', 743 757 FSIL_ALLOC,&fsa,sizeof(FSALLOCATE))) { 744 totalsize = fsa.cUnitAvail * fsa.cSectorUnit * 745 fsa.cbSector; 746 if(totalsize) { 758 // Assume <2GB since file did not fit 759 clFreeBytes = fsa.cUnitAvail * fsa.cSectorUnit * 760 fsa.cbSector; 761 if(clFreeBytes) { 762 // Find item that will fit in available space 747 763 for(cntr = x + 1;list[cntr];cntr++) { 748 764 DosError(FERR_DISABLEHARDERR); … … 751 767 &fs4,sizeof(fs4)) && 752 768 !(fs4.attrFile & FILE_DIRECTORY) && 753 fs4.cbFile + fs4.cbList <= totalsize) { 769 fs4.cbFile + fs4.cbList <= clFreeBytes) { 770 // Swap with failing item 754 771 ptr = list[x]; 755 772 list[x] = list[cntr]; -
trunk/dll/treecnr.c
r2 r36 1 2 /*********************************************************************** 3 4 $Id$ 5 6 Tree containers 7 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2001, 2002 Steven H.Levine 10 11 Revisions 16 Oct 02 SHL - Handle large partitions 12 13 ***********************************************************************/ 14 1 15 #define INCL_DOS 2 16 #define INCL_WIN … … 696 710 strcpy(fbytes," "); 697 711 commafmt(fbytes + 2,sizeof(fbytes) - 4, 698 ( fsa.cUnitAvail * (fsa.cSectorUnit * fsa.cbSector)) /699 1024L);712 (ULONG)(((float)fsa.cUnitAvail * 713 (fsa.cSectorUnit * fsa.cbSector)) / 1024L)); 700 714 strcat(fbytes, 701 715 GetPString(IDS_KFREETEXT)); -
trunk/dll/worker.c
r2 r36 1 2 /*********************************************************************** 3 4 $Id$ 5 6 Worker thread 7 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2001, 2002 Steven H.Levine 10 11 Revisions 16 Oct 02 SHL - Comments 12 13 ***********************************************************************/ 14 1 15 #define INCL_DOS 2 16 #define INCL_WIN … … 689 703 existed = (IsFile(newname) != -1); 690 704 isnewer = IsNewer(wk->li->list[x],newname); 691 /* 692 { 693 static char temp[CCHMAXPATH * 3]; 694 695 sprintf(temp,"Target: %s\rSource: %s\rOverold: %lu\rOvernew: %lu\rIsNewer: %lu\rExisted: %lu",newname,wk->li->list[x],overold,overnew,isnewer,existed); 696 saymsg(MB_ENTER,HWND_DESKTOP,DEBUG_STRING,temp); 697 } 698 */ 705 /* 706 { 707 char temp[CCHMAXPATH * 3]; 708 sprintf(temp,"Target: %s\rSource: %s\rOverold: %lu\rOvernew: %lu\rIsNewer: %lu\rExisted: %lu",newname,wk->li->list[x],overold,overnew,isnewer,existed); 709 saymsg(MB_ENTER,HWND_DESKTOP,DEBUG_STRING,temp); 710 } 711 */ 699 712 if(existed && 700 713 wk->li->type != IDM_RENAME && … … 810 823 811 824 FSALLOCATE fsa; 812 ULONG totalsize;825 ULONG clFreeBytes; 813 826 CHAR *ptr; 814 827 INT cntr; … … 820 833 &fsa, 821 834 sizeof(FSALLOCATE))) { 822 totalsize = fsa.cUnitAvail * fsa.cSectorUnit * 835 // Assume <2GB since file did not fit 836 clFreeBytes = fsa.cUnitAvail * fsa.cSectorUnit * 823 837 fsa.cbSector; 824 if(totalsize) { 838 if(clFreeBytes) { 839 // Find item that will fit in available space 825 840 for(cntr = x + 1;wk->li->list[cntr];cntr++) { 826 841 DosError(FERR_DISABLEHARDERR); … … 830 845 sizeof(fs4)) && 831 846 !(fs4.attrFile & FILE_DIRECTORY) && 832 fs4.cbFile + fs4.cbList <= totalsize) { 847 fs4.cbFile + fs4.cbList <= clFreeBytes) { 848 // Swap with failing item 833 849 ptr = wk->li->list[x]; 834 850 wk->li->list[x] = wk->li->list[cntr];
Note:
See TracChangeset
for help on using the changeset viewer.