Changeset 1871 for trunk/dll/dirsize.c
- Timestamp:
- Sep 21, 2015, 12:57:02 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/dirsize.c
r1673 r1871 7 7 8 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2001, 201 0Steven H. Levine9 Copyright (c) 2001, 2015 Steven H. Levine 10 10 11 11 16 Oct 02 SHL Handle large partitions … … 56 56 by temp file creation failures. 57 57 12 Jun 11 GKY Added SleepIfNeeded in the container fill loop 58 20 Sep 15 GKY Move directory expansion to a thread. Split ExpandAll into ExpandAll and CollapseAll 59 to try to speed proccessing else where. 58 60 59 61 ***********************************************************************/ … … 109 111 typedef struct 110 112 { 113 HWND hwndCnr; 114 PCNRITEM pci; 115 } EXPANDSIZE; 116 117 typedef struct 118 { 111 119 CHAR szDirName[CCHMAXPATH]; 112 120 CHAR chStopFlag; … … 497 505 PostMsg(WinQueryWindow(hwndCnr, QW_PARENT), 498 506 UM_CONTAINER_FILLED, MPVOID, MPVOID); 507 # ifdef FORTIFY 508 Fortify_LeaveScope(); 509 # endif 510 } 511 512 static VOID ExpandCnrThread(VOID *args) 513 { 514 HAB hab; 515 HMQ hmq; 516 INT x = 0; 517 EXPANDSIZE *expandsize = (EXPANDSIZE *)args; 518 519 if (!expandsize) { 520 Runtime_Error(pszSrcFile, __LINE__, NULL); 521 return; 522 } 523 # ifdef FORTIFY 524 Fortify_EnterScope(); 525 Fortify_BecomeOwner(expandsize); // We free dirsize 526 # endif 527 528 DosError(FERR_DISABLEHARDERR); 529 530 priority_idle(); 531 hab = WinInitialize(0); 532 if (hab) { 533 hmq = WinCreateMsgQueue(hab, 0); 534 if (hmq) { 535 WinCancelShutdown(hmq, TRUE); 536 ExpandAll(expandsize->hwndCnr, x, expandsize->pci); 537 WinDestroyMsgQueue(hmq); 538 } 539 WinTerminate(hab); 540 } 541 542 xfree(expandsize, pszSrcFile, __LINE__); 499 543 # ifdef FORTIFY 500 544 Fortify_LeaveScope(); … … 1010 1054 WinEnableWindow(WinWindowFromID(hwnd, DSZ_PRINT), FALSE); 1011 1055 WinEnableWindow(WinWindowFromID(hwnd, DID_CANCEL), FALSE); 1012 // fixme to use thread - too slow on large trees 1013 ExpandAll(WinWindowFromID(hwnd, DSZ_CNR), 1014 (SHORT1FROMMP(mp1) == DSZ_EXPAND), pci); 1056 if (SHORT1FROMMP(mp1) == DSZ_EXPAND) { 1057 EXPANDSIZE *expandsize; 1058 1059 expandsize = xmalloc(sizeof(EXPANDSIZE), pszSrcFile, __LINE__); 1060 if (expandsize) { 1061 1062 expandsize->pci = pci; 1063 expandsize->hwndCnr = WinWindowFromID(hwnd, DSZ_CNR); 1064 if (xbeginthread(ExpandCnrThread, 1065 122880 * 5, 1066 expandsize, 1067 pszSrcFile, 1068 __LINE__) == -1) 1069 xfree(expandsize, pszSrcFile, __LINE__); 1070 } 1071 } 1072 else 1073 CollapseAll(WinWindowFromID(hwnd, DSZ_CNR), pci); 1015 1074 WinEnableWindow(WinWindowFromID(hwnd, DID_OK), TRUE); 1016 1075 WinEnableWindow(WinWindowFromID(hwnd, IDM_HELP), TRUE);
Note:
See TracChangeset
for help on using the changeset viewer.