Changeset 751 for trunk/dll/misc.c
- Timestamp:
- Aug 3, 2007, 1:05:48 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/misc.c
r747 r751 26 26 05 Jul 07 GKY Fix menu removals for WORKPLACE_PROCESS=YES 27 27 23 Jul 07 SHL Sync with CNRITEM updates (ticket#24) 28 31 Jul 07 SHL Clean up and report errors (ticket#24) 28 29 29 30 ***********************************************************************/ … … 83 84 PIB *ppib; 84 85 TIB *ptib; 85 APIRET rc;86 87 rc = DosGetInfoBlocks(&ptib, &ppib); 86 BOOL yes; 87 APIRET rc = DosGetInfoBlocks(&ptib, &ppib); 88 88 89 if (rc) { 89 90 Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__, 90 91 "DosGetInfoBlocks"); 92 yes = FALSE; 91 93 } 92 94 else { … … 94 96 TID tid; 95 97 96 if (WinQueryWindowProcess(hwnd, &pid, &tid)) { 97 if (chkTid) { 98 // Is window owned by FM2 process on same thread? 99 if (pid == ppib->pib_ulpid && tid == ptib->tib_ptib2->tib2_ultid) 100 return TRUE; 101 } 102 // Is window owned by some FM2 thread 103 else if (pid == ppib->pib_ulpid) 104 return TRUE; 105 } 106 } 107 return FALSE; 98 // Check window owned by FM2 process 99 // Check say same thread too, if requested 100 // OK for window to be dead - just return FALSE 101 yes = WinQueryWindowProcess(hwnd, &pid, &tid) && 102 pid == ppib->pib_ulpid && 103 (!chkTid || tid == ptib->tib_ptib2->tib2_ultid); 104 } 105 return yes; 108 106 } 109 107 … … 381 379 !stricmp(FileSystem, JFS) || 382 380 !stricmp(FileSystem, FAT32) || 383 384 385 386 381 !stricmp(FileSystem, RAMFS) || 382 !stricmp(FileSystem, NDFS32) || 383 !stricmp(FileSystem, NTFS) || 384 !stricmp(FileSystem, HPFS386)) { 387 385 hasCreateDT = TRUE; 388 386 hasAccessDT = TRUE; … … 430 428 BOOL *bool; 431 429 432 bool = (dcd) ? &dcd->detailssubject : &detailssubject; 433 AdjustCnrColVis(hwndCnr, ((compare) ? GetPString(IDS_STATUS) : 434 GetPString(IDS_SUBJ)), *bool, FALSE); 435 bool = (dcd) ? &dcd->detailsattr : &detailsattr; 430 bool = dcd ? &dcd->detailssubject : &detailssubject; 431 AdjustCnrColVis(hwndCnr, 432 compare ? GetPString(IDS_STATUS) : GetPString(IDS_SUBJ), 433 *bool, 434 FALSE); 435 436 bool = dcd ? &dcd->detailsattr : &detailsattr; 436 437 AdjustCnrColVis(hwndCnr, GetPString(IDS_ATTR), *bool, FALSE); 437 bool = (dcd)? &dcd->detailsicon : &detailsicon;438 bool = dcd ? &dcd->detailsicon : &detailsicon; 438 439 AdjustCnrColVis(hwndCnr, GetPString(IDS_ICON), *bool, FALSE); 439 bool = (dcd)? &dcd->detailslwdate : &detailslwdate;440 bool = dcd ? &dcd->detailslwdate : &detailslwdate; 440 441 AdjustCnrColVis(hwndCnr, GetPString(IDS_LWDATE), *bool, FALSE); 441 bool = (dcd)? &dcd->detailslwtime : &detailslwtime;442 bool = dcd ? &dcd->detailslwtime : &detailslwtime; 442 443 AdjustCnrColVis(hwndCnr, GetPString(IDS_LWTIME), *bool, FALSE); 443 bool = (dcd)? &dcd->detailsea : &detailsea;444 bool = dcd ? &dcd->detailsea : &detailsea; 444 445 AdjustCnrColVis(hwndCnr, GetPString(IDS_EA), *bool, FALSE); 445 bool = (dcd)? &dcd->detailssize : &detailssize;446 bool = dcd ? &dcd->detailssize : &detailssize; 446 447 AdjustCnrColVis(hwndCnr, GetPString(IDS_SIZE), *bool, FALSE); 448 447 449 if (!directory) { 448 bool = (dcd)? &dcd->detailsladate : &detailsladate;450 bool = dcd ? &dcd->detailsladate : &detailsladate; 449 451 AdjustCnrColVis(hwndCnr, GetPString(IDS_LADATE), *bool, FALSE); 450 bool = (dcd)? &dcd->detailslatime : &detailslatime;452 bool = dcd ? &dcd->detailslatime : &detailslatime; 451 453 AdjustCnrColVis(hwndCnr, GetPString(IDS_LATIME), *bool, FALSE); 452 bool = (dcd)? &dcd->detailscrdate : &detailscrdate;454 bool = dcd ? &dcd->detailscrdate : &detailscrdate; 453 455 AdjustCnrColVis(hwndCnr, GetPString(IDS_CRDATE), *bool, FALSE); 454 bool = (dcd)? &dcd->detailscrtime : &detailscrtime;456 bool = dcd ? &dcd->detailscrtime : &detailscrtime; 455 457 AdjustCnrColVis(hwndCnr, GetPString(IDS_CRTIME), *bool, FALSE); 456 bool = (dcd)? &dcd->detailslongname : &detailslongname;458 bool = dcd ? &dcd->detailslongname : &detailslongname; 457 459 AdjustCnrColVis(hwndCnr, GetPString(IDS_LNAME), *bool, FALSE); 458 460 WinSendMsg(hwndCnr, CM_INVALIDATEDETAILFIELDINFO, MPVOID, MPVOID); … … 462 464 } 463 465 464 BOOL SetCnrCols(HWND hwndCnr, BOOL compare)466 BOOL SetCnrCols(HWND hwndCnr, BOOL isCompCnr) 465 467 { 466 468 BOOL fSuccess = TRUE; … … 472 474 MPFROMLONG(CONTAINER_COLUMNS), NULL); 473 475 474 if (pfi) { 476 if (!pfi) { 477 Win_Error(hwndCnr, HWND_DESKTOP, pszSrcFile, __LINE__, "CM_ALLOCDETAILFIELDINFO"); 478 fSuccess = FALSE; 479 } 480 else { 475 481 476 482 PFIELDINFO pfiFirst; … … 518 524 pfi = pfi->pNextFieldInfo; 519 525 pfi->flData = CFA_STRING | CFA_LEFT | CFA_SEPARATOR; 520 if ( compare)526 if (isCompCnr) 521 527 pfi->flData |= CFA_FIREADONLY; 522 528 pfi->flTitle = CFA_CENTER | CFA_FITITLEREADONLY; 523 pfi->pTitleData = ( compare) ? GetPString(IDS_STATUS) :529 pfi->pTitleData = (isCompCnr) ? GetPString(IDS_STATUS) : 524 530 GetPString(IDS_SUBJ); 525 531 pfi->offStruct = FIELDOFFSET(CNRITEM, pszSubject); … … 610 616 611 617 if (!WinSendMsg(hwndCnr, CM_INSERTDETAILFIELDINFO, MPFROMP(pfiFirst), 612 MPFROMP(&fii))) 618 MPFROMP(&fii))) { 619 Win_Error(hwndCnr, HWND_DESKTOP, pszSrcFile, __LINE__, "CM_INSERTDETAILFIELDINFO"); 613 620 fSuccess = FALSE; 614 } 615 else 616 fSuccess = FALSE; 621 } 622 } 617 623 618 624 if (fSuccess) { … … 634 640 if (!WinSendMsg(hwndCnr, CM_SETCNRINFO, MPFROMP(&cnri), 635 641 MPFROMLONG(CMA_PFIELDINFOLAST | CMA_PFIELDINFOOBJECT | 636 CMA_XVERTSPLITBAR))) 642 CMA_XVERTSPLITBAR))) { 643 Win_Error(hwndCnr, HWND_DESKTOP, pszSrcFile, __LINE__, "CM_SETCNRINFO"); 637 644 fSuccess = FALSE; 645 } 638 646 } 639 647 … … 682 690 ULONG ealen; 683 691 USHORT len; 684 685 692 CHAR *eaval; 693 LONG retlen; 686 694 687 695 retlen = WinQueryWindowText(hwndMLE, sizeof(szSubject), szSubject); … … 733 741 734 742 CHAR longname[CCHMAXPATHCOMP]; 735 743 LONG retlen; 736 744 737 745 *longname = 0; … … 739 747 longname[retlen + 1] = 0; 740 748 chop_at_crnl(longname); 741 742 749 WinSetWindowText(hwndMLE, longname); 750 pci->pszFileName = xrealloc(pci->pszFileName, sizeof(longname), pszSrcFile, __LINE__); 743 751 return (MRESULT) WriteLongName(pci->pszFileName, longname); 744 752 } 745 746 747 748 753 else { 754 pci->pszFileName = pci->pszDisplayName; 755 WinQueryWindowText(hwndMLE, sizeof(szData), szData); 756 pci->pszFileName = xrealloc(pci->pszFileName, sizeof(szData), pszSrcFile, __LINE__); 749 757 if (strchr(szData, '?') || 750 758 strchr(szData, '*') || IsRoot(pci->pszFileName)) 751 759 return (MRESULT) FALSE; 752 760 /* If the text changed, rename the file system object. */ 753 761 chop_at_crnl(szData); 754 762 bstrip(szData); 755 763 if (!IsFullName(szData)) 756 764 Runtime_Error(pszSrcFile, __LINE__, "bad name"); … … 759 767 FIL_QUERYFULLNAME, 760 768 testname, sizeof(testname))) 761 769 return FALSE; 762 770 if (DosQueryPathInfo(pci->pszFileName, 763 771 FIL_QUERYFULLNAME, szData, sizeof(szData))) … … 936 944 { 937 945 WinCheckMenuItem(hwnd, IDM_SHOWLNAMES, 938 (dcd)? dcd->detailslongname : detailslongname);946 dcd ? dcd->detailslongname : detailslongname); 939 947 WinCheckMenuItem(hwnd, IDM_SHOWSUBJECT, 940 (dcd)? dcd->detailssubject : detailssubject);941 WinCheckMenuItem(hwnd, IDM_SHOWEAS, (dcd)? dcd->detailsea : detailsea);948 dcd ? dcd->detailssubject : detailssubject); 949 WinCheckMenuItem(hwnd, IDM_SHOWEAS, dcd ? dcd->detailsea : detailsea); 942 950 WinCheckMenuItem(hwnd, IDM_SHOWSIZE, 943 (dcd)? dcd->detailssize : detailssize);951 dcd ? dcd->detailssize : detailssize); 944 952 WinCheckMenuItem(hwnd, IDM_SHOWICON, 945 (dcd)? dcd->detailsicon : detailsicon);953 dcd ? dcd->detailsicon : detailsicon); 946 954 WinCheckMenuItem(hwnd, IDM_SHOWLWDATE, 947 (dcd)? dcd->detailslwdate : detailslwdate);955 dcd ? dcd->detailslwdate : detailslwdate); 948 956 WinCheckMenuItem(hwnd, IDM_SHOWLWTIME, 949 (dcd)? dcd->detailslwtime : detailslwtime);957 dcd ? dcd->detailslwtime : detailslwtime); 950 958 WinCheckMenuItem(hwnd, IDM_SHOWLADATE, 951 (dcd)? dcd->detailsladate : detailsladate);959 dcd ? dcd->detailsladate : detailsladate); 952 960 WinCheckMenuItem(hwnd, IDM_SHOWLATIME, 953 (dcd)? dcd->detailslatime : detailslatime);961 dcd ? dcd->detailslatime : detailslatime); 954 962 WinCheckMenuItem(hwnd, IDM_SHOWCRDATE, 955 (dcd)? dcd->detailscrdate : detailscrdate);963 dcd ? dcd->detailscrdate : detailscrdate); 956 964 WinCheckMenuItem(hwnd, IDM_SHOWCRTIME, 957 (dcd)? dcd->detailscrtime : detailscrtime);965 dcd ? dcd->detailscrtime : detailscrtime); 958 966 WinCheckMenuItem(hwnd, IDM_SHOWATTR, 959 (dcd)? dcd->detailsattr : detailsattr);967 dcd ? dcd->detailsattr : detailsattr); 960 968 } 961 969 … … 975 983 switch (cmd) { 976 984 case IDM_SHOWLNAMES: 977 bool = (dcd)? &dcd->detailslongname : &detailslongname;985 bool = dcd ? &dcd->detailslongname : &detailslongname; 978 986 strcpy(eos, "DetailsLongname"); 979 987 break; 980 988 case IDM_SHOWSUBJECT: 981 bool = (dcd)? &dcd->detailssubject : &detailssubject;989 bool = dcd ? &dcd->detailssubject : &detailssubject; 982 990 strcpy(eos, "DetailsSubject"); 983 991 break; 984 992 case IDM_SHOWEAS: 985 bool = (dcd)? &dcd->detailsea : &detailsea;993 bool = dcd ? &dcd->detailsea : &detailsea; 986 994 strcpy(eos, "DetailsEA"); 987 995 break; 988 996 case IDM_SHOWSIZE: 989 bool = (dcd)? &dcd->detailssize : &detailssize;997 bool = dcd ? &dcd->detailssize : &detailssize; 990 998 strcpy(eos, "DetailsSize"); 991 999 break; 992 1000 case IDM_SHOWICON: 993 bool = (dcd)? &dcd->detailsicon : &detailsicon;1001 bool = dcd ? &dcd->detailsicon : &detailsicon; 994 1002 strcpy(eos, "DetailsIcon"); 995 1003 break; 996 1004 case IDM_SHOWLWDATE: 997 bool = (dcd)? &dcd->detailslwdate : &detailslwdate;1005 bool = dcd ? &dcd->detailslwdate : &detailslwdate; 998 1006 strcpy(eos, "DetailsLWDate"); 999 1007 break; 1000 1008 case IDM_SHOWLWTIME: 1001 bool = (dcd)? &dcd->detailslwtime : &detailslwtime;1009 bool = dcd ? &dcd->detailslwtime : &detailslwtime; 1002 1010 strcpy(eos, "DetailsLWTime"); 1003 1011 break; 1004 1012 case IDM_SHOWLADATE: 1005 bool = (dcd)? &dcd->detailsladate : &detailsladate;1013 bool = dcd ? &dcd->detailsladate : &detailsladate; 1006 1014 strcpy(eos, "DetailsLADate"); 1007 1015 break; 1008 1016 case IDM_SHOWLATIME: 1009 bool = (dcd)? &dcd->detailslatime : &detailslatime;1017 bool = dcd ? &dcd->detailslatime : &detailslatime; 1010 1018 strcpy(eos, "DetailsLATime"); 1011 1019 break; 1012 1020 case IDM_SHOWCRDATE: 1013 bool = (dcd)? &dcd->detailscrdate : &detailscrdate;1021 bool = dcd ? &dcd->detailscrdate : &detailscrdate; 1014 1022 strcpy(eos, "DetailsCRDate"); 1015 1023 break; 1016 1024 case IDM_SHOWCRTIME: 1017 bool = (dcd)? &dcd->detailscrtime : &detailscrtime;1025 bool = dcd ? &dcd->detailscrtime : &detailscrtime; 1018 1026 strcpy(eos, "DetailsCRTime"); 1019 1027 break; 1020 1028 case IDM_SHOWATTR: 1021 bool = (dcd)? &dcd->detailsattr : &detailsattr;1029 bool = dcd ? &dcd->detailsattr : &detailsattr; 1022 1030 strcpy(eos, "DetailsAttr"); 1023 1031 break; … … 1384 1392 // If window owned by some other process or some other thread? 1385 1393 if (!IsFm2Window(h, 1)) { 1386 1394 QMSG qmsg; 1387 1395 for (;;) { 1388 1396 DosSleep(1);
Note:
See TracChangeset
for help on using the changeset viewer.