Changeset 350 for trunk/dll/dirsize.c
- Timestamp:
- Jul 26, 2006, 9:01:20 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/dirsize.c
r239 r350 7 7 8 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2001, 200 5Steven H. Levine9 Copyright (c) 2001, 2006 Steven H. Levine 10 10 11 11 16 Oct 02 SHL Handle large partitions … … 20 20 19 Jun 05 SHL More 64-bit math fixes 21 21 08 Aug 05 SHL Avoid Expand/Collapse hangs while working 22 17 Jul 06 SHL Use Runtime_Error 22 23 23 24 ***********************************************************************/ … … 37 38 #include "fm3dlg.h" 38 39 #include "fm3str.h" 39 40 #pragma alloc_text(DIRSIZE,ProcessDir,FillCnrThread,DirSizeProc)41 #pragma alloc_text(DIRSIZE2,PrintToFile,FillInRecSizes,SortSizeCnr)42 40 43 41 typedef struct { … … 56 54 } tState; 57 55 56 57 static PSZ pszSrcFile = __FILE__; 58 59 #pragma alloc_text(DIRSIZE,ProcessDir,FillCnrThread,DirSizeProc) 60 #pragma alloc_text(DIRSIZE2,PrintToFile,FillInRecSizes,SortSizeCnr) 58 61 59 62 static SHORT APIENTRY SortSizeCnr (PMINIRECORDCORE p1,PMINIRECORDCORE p2, … … 92 95 *pullTotalBytes = 0; // In case we fail 93 96 94 pFFB = malloc(sizeof(FILEFINDBUF4) /* * FilesToGet */);97 pFFB = xmalloc(sizeof(FILEFINDBUF4),pszSrcFile,__LINE__); 95 98 if(!pFFB) 96 99 return FALSE; … … 150 153 rc, 151 154 HWND_DESKTOP, 152 __FILE__,155 pszSrcFile, 153 156 __LINE__, 154 157 GetPString(IDS_CANTFINDDIRTEXT), … … 445 448 break; 446 449 } 447 pState = malloc(sizeof(tState));450 pState = xmallocz(sizeof(tState),pszSrcFile,__LINE__); 448 451 if(!pState) { 449 452 WinDismissDlg(hwnd,0); 450 453 break; 451 454 } 452 memset(pState,0,sizeof(tState));453 455 strcpy(pState->szDirName,(CHAR *)mp2); 454 456 WinSetWindowPtr(hwnd,0,(PVOID)pState); … … 466 468 DIRSIZE *dirsize; 467 469 468 dirsize = malloc(sizeof(DIRSIZE));470 dirsize = xmalloc(sizeof(DIRSIZE),pszSrcFile,__LINE__); 469 471 if(!dirsize) { 470 472 WinDismissDlg(hwnd,0); … … 475 477 dirsize->hwndCnr = WinWindowFromID(hwnd,DSZ_CNR); 476 478 if(_beginthread(FillCnrThread,NULL,122880L * 5L,(PVOID)dirsize) == -1) { 479 Runtime_Error(pszSrcFile, __LINE__, GetPString(IDS_COULDNTSTARTTHREADTEXT)); 477 480 free(dirsize); 478 481 WinDismissDlg(hwnd,0); … … 573 576 WinSendDlgItemMsg(hwnd,DSZ_CNR,CM_SORTRECORD,MPFROMP(SortSizeCnr), 574 577 MPVOID); 575 DosBeep(500,25); 578 DosBeep(500,25); // Wake up user 576 579 return 0; 577 580 … … 853 856 // Save button 854 857 pState = INSTDATA(hwnd); 855 if (pState) { 858 if (!pState) 859 Runtime_Error(pszSrcFile, __LINE__, "no data"); 860 else { 856 861 857 862 CHAR pszFileName[CCHMAXPATH]; … … 867 872 strcat(pszFileName,".RPT"); 868 873 fp = fopen(pszFileName,"a+"); 869 if (fp) { 874 if (!fp) { 875 saymsg(MB_CANCEL, 876 hwnd, 877 GetPString(IDS_ERRORTEXT), 878 GetPString(IDS_COMPCANTOPENTEXT), 879 pszFileName); 880 } 881 else { 870 882 WinSetPointer(HWND_DESKTOP,hptrBusy); 871 883 PrintToFile(WinWindowFromID(hwnd,DSZ_CNR),0,NULL,fp); … … 873 885 WinSetPointer(HWND_DESKTOP,hptrArrow); 874 886 } 875 else876 saymsg(MB_CANCEL,877 hwnd,878 GetPString(IDS_ERRORTEXT),879 GetPString(IDS_COMPCANTOPENTEXT),880 pszFileName);881 887 } 882 888 } 883 else884 DosBeep(50,100);885 889 break; 886 890 … … 917 921 case DID_CANCEL: 918 922 pState = INSTDATA(hwnd); 919 if (pState) { 923 if (!pState) 924 Runtime_Error(pszSrcFile, __LINE__, "no data"); 925 else { 920 926 if (pState->working) { 921 927 pState->dying = TRUE; 922 928 pState->chStopFlag = 0xff; 923 DosBeep(1000,100); 929 DosBeep(1000,100); // Complain? 924 930 } 925 931 else
Note:
See TracChangeset
for help on using the changeset viewer.