Changeset 731
Legend:
- Unmodified
 - Added
 - Removed
 
- 
      
trunk/dll/comp.c
r730 r731 346 346 //=== ActionCnrThread() Do requested action on container contents === 347 347 348 static VOID ActionCnrThread(VOID * args)348 static VOID ActionCnrThread(VOID *args) 349 349 { 350 COMPARE *cmp = (COMPARE *) args;350 COMPARE *cmp = (COMPARE *)args; 351 351 HAB hab; 352 352 HMQ hmq; … … 355 355 CHAR newname[CCHMAXPATH], dirname[CCHMAXPATH], *p; 356 356 APIRET rc; 357 CHAR *f = 0;358 357 359 358 if (!cmp) … … 431 430 } 432 431 else { 433 pci->pszFileName = xstrdup( f, pszSrcFile, __LINE__);432 pci->pszFileName = xstrdup(NullStr, pszSrcFile, __LINE__); 434 433 //pci->pszFileName = pci->szFileName; 435 434 pci->flags = 0; … … 493 492 pciO->cbFile = pci->cbFile; 494 493 pciO->easize = pci->easize; 495 pciO->pszSubject = xstrdup( f, pszSrcFile, __LINE__);496 pci->pszFileName = xstrdup( f, pszSrcFile, __LINE__);494 pciO->pszSubject = xstrdup(NullStr, pszSrcFile, __LINE__); 495 pci->pszFileName = xstrdup(NullStr, pszSrcFile, __LINE__); 497 496 //pci->pszFileName = pci->szFileName; 498 497 pci->flags = 0; … … 574 573 pciO->cbFile = pci->cbFile; 575 574 pciO->easize = pci->easize; 576 pci->pszSubject = xstrdup( f, pszSrcFile, __LINE__);575 pci->pszSubject = xstrdup(NullStr, pszSrcFile, __LINE__); 577 576 pci->flags = CNRITEM_EXISTS; 578 577 WinSendMsg(hwndCnrS, CM_INVALIDATERECORD, MPFROMP(&pci),  - 
      
trunk/dll/dirsize.c
r730 r731 78 78 } 79 79 80 static BOOL ProcessDir(HWND hwndCnr, CHAR * pszFileName, 80 static BOOL ProcessDir(HWND hwndCnr, 81 CHAR *pszFileName, 81 82 PCNRITEM pciParent, 82 CHAR * pchStopFlag, BOOL top, 83 CHAR *pchStopFlag, 84 BOOL top, 83 85 PULONGLONG pullTotalBytes) 84 86 { … … 97 99 RECORDINSERT ri; 98 100 PCNRITEM pCI; 99 CHAR *f = 0;100 101 101 102 // fixme to report errors … … 147 148 else 148 149 DosError(FERR_DISABLEHARDERR); 150 // fixme to not double free when pointers match 149 151 pCI->pszLongname = pCI->pszFileName; 150 152 pCI->rc.hptrIcon = hptrDir; 151 153 *pCI->szDispAttr = 0; 152 154 pCI->attrFile = 0; 153 pCI->pszLongname = xstrdup(f, pszSrcFile, __LINE__); 154 pCI->pszSubject = xstrdup(f, pszSrcFile, __LINE__); 155 pCI->pszSubject = xstrdup(NullStr, pszSrcFile, __LINE__); 155 156 } 156 157 else { … … 183 184 strcat(pp, sp); 184 185 } 185 pCI->pszFileName = pCI->pszFileName + strlen(pCI->pszFileName);186 186 pCI->rc.pszIcon = pCI->pszLongname; 187 187 pCI->rc.flRecordAttr |= CRA_RECORDREADONLY; … … 190 190 else if (fForceLower) 191 191 strlwr(pCI->pszFileName); 192 // fixme to work - code is hiding file name from container but... 23 Jul 07 SHL 193 pCI->pszFileName = pCI->pszFileName + strlen(pCI->pszFileName); 192 194 memset(&ri, 0, sizeof(RECORDINSERT)); 193 195 ri.cb = sizeof(RECORDINSERT); … … 197 199 ri.cRecordsInsert = 1L; 198 200 ri.fInvalidateRecord = TRUE; 199 //printf("CM_INSERTRECORD\n");200 201 if (!WinSendMsg(hwndCnr, CM_INSERTRECORD, MPFROMP(pCI), MPFROMP(&ri))) { 201 //printf("Insert failed\n");202 202 free(pFFB); 203 203 return FALSE; … … 205 205 hdir = HDIR_CREATE; 206 206 nm = 1L; 207 //printf("FIND2\n");208 207 rc = DosFindFirst(maskstr, &hdir, 209 208 FILE_NORMAL | FILE_READONLY | FILE_ARCHIVED | … … 302 301 ((float)fsa.cUnit * (fsa.cSectorUnit * fsa.cbSector)); 303 302 } 303 // Need unique buffer 23 Jul 07 SHL 304 pCI->pszLongname = xmalloc(2, pszSrcFile, __LINE__); 305 pCI->pszLongname[0] = 0; // Make null string 304 306 pCI->pszLongname[1] = 1; // Flag root - hack cough 305 307 } … … 322 324 CommaFmtULL(szSubDir, sizeof(szSubDir), pCI->easize, 'K'); 323 325 CommaFmtULL(szAllDir, sizeof(szAllDir), pCI->cbFile + pCI->easize, 'K'); 324 sprintf(&pCI->pszFileName[strlen(pCI->pszFileName)], 326 pCI->pszFileName = xrealloc(pCI->pszFileName, strlen(pCI->pszFileName) + 100, 327 pszSrcFile, 328 __LINE__); // 23 Jul 07 SHL 329 sprintf(pCI->pszFileName + strlen(pCI->pszFileName), 325 330 " %s + %s = %s (%.02lf%%%s)\r%s", 326 331 szCurDir, … … 747 752 case CN_ENTER: 748 753 if (mp2) { 749 750 PCNRITEM pci = (PCNRITEM) ((PNOTIFYRECORDENTER) mp2)->pRecord;751 CHAR pszFileName[CCHMAXPATH],szTemp[CCHMAXPATH];754 PCNRITEM pci = (PCNRITEM)((PNOTIFYRECORDENTER)mp2)->pRecord; 755 CHAR szFileName[CCHMAXPATH]; // 23 Jul 07 SHL 756 CHAR szTemp[CCHMAXPATH]; 752 757 753 758 if (pci) { 754 * pszFileName = 0;759 *szFileName = 0; 755 760 while (pci && (INT) pci != -1) { 756 761 memset(szTemp, 0, sizeof(szTemp)); … … 758 763 pci->pszFileName - pci->pszFileName); 759 764 strrev(szTemp); 760 if (* pszFileName && *szTemp != '\\')761 strcat( pszFileName, "\\");762 strcat( pszFileName, szTemp);765 if (*szFileName && *szTemp != '\\') 766 strcat(szFileName, "\\"); 767 strcat(szFileName, szTemp); 763 768 pci = WinSendDlgItemMsg(hwnd, DSZ_CNR, CM_QUERYRECORD, 764 769 MPFROMP(pci), 765 770 MPFROM2SHORT(CMA_PARENT, CMA_ITEMORDER)); 766 771 } 767 strrev( pszFileName);772 strrev(szFileName); 768 773 if (!fVTreeOpensWPS) 769 774 OpenDirCnr((HWND) 0, 770 775 (hwndMain) ? hwndMain : HWND_DESKTOP, 771 hwnd, FALSE, pszFileName);776 hwnd, FALSE, szFileName); 772 777 else { 773 778 … … 780 785 (PVOID) & flWindowAttr, &size); 781 786 if (flWindowAttr & CV_DETAIL) { 782 if (IsRoot( pszFileName))787 if (IsRoot(szFileName)) 783 788 strcpy(s, "TREE"); 784 789 else 785 790 strcpy(s, "DETAILS"); 786 791 } 787 OpenObject( pszFileName, s, hwnd);792 OpenObject(szFileName, s, hwnd); 788 793 } 789 794 } … … 826 831 else { 827 832 828 CHAR pszFileName[CCHMAXPATH];833 CHAR szFileName[CCHMAXPATH]; 829 834 FILE *fp; 830 835 831 save_dir2( pszFileName);832 sprintf(& pszFileName[strlen(pszFileName)], "\\%csizes.Rpt",836 save_dir2(szFileName); 837 sprintf(&szFileName[strlen(szFileName)], "\\%csizes.Rpt", 833 838 (pState) ? toupper(*pState->szDirName) : '+'); 834 if (export_filename(hwnd, pszFileName, FALSE) && *pszFileName) {835 if (stricmp( pszFileName, "PRN") &&836 strnicmp( pszFileName, "\\DEV\\LPT", 8) &&837 !strchr( pszFileName, '.'))838 strcat( pszFileName, ".RPT");839 fp = fopen( pszFileName, "a+");839 if (export_filename(hwnd, szFileName, FALSE) && *szFileName) { 840 if (stricmp(szFileName, "PRN") && 841 strnicmp(szFileName, "\\DEV\\LPT", 8) && 842 !strchr(szFileName, '.')) 843 strcat(szFileName, ".RPT"); 844 fp = fopen(szFileName, "a+"); 840 845 if (!fp) { 841 846 saymsg(MB_CANCEL, 842 847 hwnd, 843 848 GetPString(IDS_ERRORTEXT), 844 GetPString(IDS_COMPCANTOPENTEXT), pszFileName);849 GetPString(IDS_COMPCANTOPENTEXT), szFileName); 845 850 } 846 851 else {  - 
      
trunk/dll/filldir.c
r730 r731 157 157 DosSleep(rand() % 100); 158 158 159 } // for159 } // for 160 160 161 161 return hptr == hptrPMFile || hptr == hptrWPSFile; 162 162 163 } // IsDefaultIcon 164 165 ULONGLONG FillInRecordFromFFB(HWND hwndCnr, PCNRITEM pci, 163 } // IsDefaultIcon 164 165 ULONGLONG FillInRecordFromFFB(HWND hwndCnr, 166 PCNRITEM pci, 166 167 const PSZ pszDirectory, 167 const PFILEFINDBUF4 pffb, const BOOL partial, 168 const PFILEFINDBUF4 pffb, 169 const BOOL partial, 168 170 DIRCNRDATA * dcd) 169 171 { … … 175 177 UINT x; 176 178 UINT y; 177 UINT t;178 CHAR *f = 0;179 179 180 180 pci->hwndCnr = hwndCnr; 181 t = strlen(pszDirectory); 181 182 // 23 Jul 07 SHL fixme to optimize 182 183 pci->pszFileName = xstrdup(pszDirectory, pszSrcFile, __LINE__); 183 /* note !we cheat below, and accept the full pathname in pszDirectory184 if !*pffb->achName. speeds up and simplifies processing elsewhere184 /* note that we cheat below, and accept the full pathname in pszDirectory 185 if !*pffb->achName. This speeds up and simplifies processing elsewhere 185 186 (like in update.c) 186 187 */ 187 if (*pffb->achName) { 188 p = pci->pszFileName + (t - 1); 188 if (!*pffb->achName) 189 pci->pszFileName = xstrdup(pszDirectory, pszSrcFile, __LINE__); 190 else { 191 INT c = strlen(pszDirectory); 192 INT c2 = pffb->cchName + 1; 193 if (pszDirectory[c - 1] != '\\') 194 c2++; 195 pci->pszFileName = xmalloc(c + c2, 196 pszSrcFile, 197 __LINE__); 198 memcpy(pci->pszFileName, pszDirectory, c + 1); 199 p = pci->pszFileName + c - 1; 189 200 if (*p != '\\') { 190 201 p++; … … 194 205 memcpy(p, pffb->achName, pffb->cchName + 1); 195 206 } 207 196 208 /* load the object's Subject, if required */ 209 pci->pszSubject = NULL; 197 210 if (pffb->cbList > 4L && 198 211 dcd && fLoadSubject && 199 212 (isalpha(*pci->pszFileName) && 200 !(driveflags[toupper(*pci->pszFileName) - 'A'] & DRIVE_NOLOADSUBJS))) { 213 !(driveflags[toupper(*pci->pszFileName) - 'A'] & DRIVE_NOLOADSUBJS))) 214 { 201 215 APIRET rc; 202 216 EAOP2 eaop; … … 234 248 } 235 249 } 250 // If still need subject - fixme to just point NullStr 251 if (!pci->pszSubject) 252 pci->pszSubject = xstrdup(NullStr, pszSrcFile, __LINE__); 253 236 254 /* load the object's longname */ 237 pci->pszLongname = xstrdup(f, pszSrcFile, __LINE__);255 pci->pszLongname = 0; 238 256 if (fLoadLongnames && 239 257 dcd && … … 241 259 isalpha(*pci->pszFileName) && 242 260 ~driveflags[toupper(*pci->pszFileName) - 'A'] & DRIVE_NOLONGNAMES && 243 ~driveflags[toupper(*pci->pszFileName) - 'A'] & DRIVE_NOLOADLONGS) { 261 ~driveflags[toupper(*pci->pszFileName) - 'A'] & DRIVE_NOLOADLONGS) 262 { 244 263 APIRET rc; 245 264 EAOP2 eaop; … … 277 296 } 278 297 } 298 // If still need long name set - fixme to just point to NullStr 299 if (!pci->pszLongname) 300 pci->pszLongname = xstrdup(NullStr, pszSrcFile, __LINE__); 301 279 302 /* do anything required to case of filename */ 280 303 if (fForceUpper) … … 310 333 if (!hptr) { 311 334 hptr = pffb->attrFile & FILE_DIRECTORY ? 312 hptrDir : 313 pffb->attrFile & FILE_SYSTEM ? 314 hptrSystem : 315 pffb->attrFile & FILE_HIDDEN ? 316 hptrHidden : pffb->attrFile & FILE_READONLY ? hptrReadonly : hptrFile; 335 hptrDir : pffb->attrFile & FILE_SYSTEM ? 336 hptrSystem : 337 pffb->attrFile & FILE_HIDDEN ? 338 hptrHidden : 339 pffb->attrFile & FILE_READONLY ? 340 hptrReadonly : hptrFile; 317 341 } 318 342 … … 337 361 p = pci->pszFileName; 338 362 /* now fill the darned thing in... */ 363 // fixme to have secondary pointer that points to real buffer 23 Jul 07 SHL 339 364 pci->pszFileName = p; 340 365 pci->date.day = pffb->fdateLastWrite.day; … … 397 422 return pffb->cbFile + pci->easize; 398 423 399 } // FillInRecordFromFFB424 } // FillInRecordFromFFB 400 425 401 426 ULONGLONG FillInRecordFromFSA(HWND hwndCnr, PCNRITEM pci, const PSZ pszFileName, const PFILESTATUS4 pfsa4, const BOOL partial, DIRCNRDATA * dcd) // Optional … … 403 428 HPOINTER hptr; 404 429 CHAR attrstring[] = "RHS\0DA"; 405 register CHAR *p; 406 register INT x; 407 register INT y; 408 CHAR *f = 0; 430 CHAR *p; 431 INT x; 432 INT y; 409 433 410 434 /* fill in a container record from a FILESTATUS4 structure */ … … 412 436 pci->hwndCnr = hwndCnr; 413 437 pci->pszFileName = xstrdup(pszFileName, pszSrcFile, __LINE__); 438 414 439 /* load the object's Subject, if required */ 440 pci->pszSubject = NULL; 415 441 if (pfsa4->cbList > 4L && 416 442 dcd && 417 443 fLoadSubject && 418 444 (!isalpha(*pci->pszFileName) || 419 !(driveflags[toupper(*pci->pszFileName) - 'A'] & DRIVE_NOLOADSUBJS))) { 445 !(driveflags[toupper(*pci->pszFileName) - 'A'] & DRIVE_NOLOADSUBJS))) 446 { 420 447 APIRET rc; 421 448 EAOP2 eaop; … … 446 473 value[pfea->cbValue] = 0; 447 474 if (*(USHORT *) value == EAT_ASCII) 448 pci->pszSubject = xstrdup(value + (sizeof(USHORT) * 2), pszSrcFile, __LINE__);475 pci->pszSubject = xstrdup(value + (sizeof(USHORT) * 2), pszSrcFile, __LINE__); 449 476 } 450 477 free(pfealist); … … 453 480 } 454 481 } 455 pci->pszLongname = xstrdup(f, pszSrcFile, __LINE__); 482 // If still need subject buffer - fixme to just point to NullStr 483 if (!pci->pszSubject) 484 pci->pszSubject = xstrdup(NullStr, pszSrcFile, __LINE__); 485 486 pci->pszLongname = 0; 456 487 if (fLoadLongnames && 457 488 dcd && … … 459 490 isalpha(*pci->pszFileName) && 460 491 ~driveflags[toupper(*pci->pszFileName) - 'A'] & DRIVE_NOLONGNAMES && 461 ~driveflags[toupper(*pci->pszFileName) - 'A'] & DRIVE_NOLOADLONGS) { 492 ~driveflags[toupper(*pci->pszFileName) - 'A'] & DRIVE_NOLOADLONGS) 493 { 462 494 APIRET rc; 463 495 EAOP2 eaop; … … 485 517 if (!rc) { 486 518 pfea = &eaop.fpFEA2List->list[0]; 487 value = pfea->szName + pfea->cbName + 1; 488 value[pfea->cbValue] = 0; 489 if (*(USHORT *) value == EAT_ASCII) 490 pci->pszLongname = xstrdup(value + (sizeof(USHORT) * 2), pszSrcFile, __LINE__); 519 value = pfea->szName + pfea->cbName + 1; // Point at EA value 520 value[pfea->cbValue] = 0; // Terminate 521 if (*(USHORT *) value == EAT_ASCII) { 522 p = value + sizeof(USHORT) * 2; // Point at value string 523 pci->pszLongname = xstrdup(p, pszSrcFile, __LINE__); 524 } 491 525 } 492 526 free(pfealist); … … 495 529 } 496 530 } 531 // If still need long name set - fixme to just point to NullStr 532 if (!pci->pszLongname) 533 pci->pszLongname = xstrdup(NullStr, pszSrcFile, __LINE__); 534 497 535 if (fForceUpper) 498 536 strupr(pci->pszFileName); … … 598 636 return pfsa4->cbFile + pci->easize; 599 637 600 } // FillInRecordFromFSA638 } // FillInRecordFromFSA 601 639 602 640 VOID ProcessDirectory(const HWND hwndCnr, const PCNRITEM pciParent, const CHAR * szDirBase, const BOOL filestoo, const BOOL recurse, const BOOL partial, CHAR * stopflag, DIRCNRDATA * dcd, // Optional … … 731 769 pci = (PCNRITEM) pci->rc.preccNextRecord; 732 770 ullTotalBytes += ullBytes; 733 } 771 } // for 734 772 if (ulFileCnt) { 735 773 memset(&ri, 0, sizeof(RECORDINSERT)); … … 911 949 *pullTotalBytes = ullReturnBytes; 912 950 913 } // ProcessDirectory951 } // ProcessDirectory 914 952 915 953 VOID FillDirCnr(HWND hwndCnr, … … 926 964 DosPostEventSem(CompactSem); 927 965 928 } // FillDirCnr966 } // FillDirCnr 929 967 930 968 VOID FillTreeCnr(HWND hwndCnr, HWND hwndParent) 931 969 { 932 ULONG ul DriveNum, ulDriveMap, numtoinsert = 0, drvtype;970 ULONG ulCurDriveNum, ulDriveMap, numtoinsert = 0, drvtype; 933 971 PCNRITEM pci, pciFirst = NULL, pciNext, pciParent = NULL; 934 972 INT x, removable; 935 CHAR suggest[32], szDrive[] = " :\\", FileSystem[CCHMAXPATH]; 973 CHAR suggest[32]; 974 CHAR szDrive[] = " :\\", FileSystem[CCHMAXPATH]; 936 975 FILESTATUS4 fsa4; 937 976 APIRET rc; … … 958 997 } 959 998 DosError(FERR_DISABLEHARDERR); 960 rc = DosQCurDisk(&ul DriveNum, &ulDriveMap);999 rc = DosQCurDisk(&ulCurDriveNum, &ulDriveMap); 961 1000 if (rc) { 962 1001 Dos_Error(MB_CANCEL, … … 966 1005 exit(0); 967 1006 } 1007 // Calc number of drive items to create 968 1008 for (x = 0; x < 26; x++) { 969 1009 if ((ulDriveMap & (1L << x)) && !(driveflags[x] & DRIVE_IGNORE)) … … 985 1025 for (x = 0; x < 26; x++) { 986 1026 if ((ulDriveMap & (1L << x)) && !(driveflags[x] & DRIVE_IGNORE)) { 987 *szDrive = (CHAR) x + 'A'; 988 989 { 990 CHAR s[80]; 991 ULONG flags = 0; 992 ULONG size = sizeof(ULONG); 993 994 sprintf(s, "%c.DriveFlags", toupper(*szDrive)); 995 if (PrfQueryProfileData(fmprof, appname, s, &flags, &size) && 996 size == sizeof(ULONG)) { 997 driveflags[toupper(*szDrive) - 'A'] |= flags; 998 } 1027 1028 CHAR s[80]; 1029 ULONG flags = 0; 1030 ULONG size = sizeof(ULONG); 1031 1032 *szDrive = (CHAR)x + 'A'; // Build path spec 1033 1034 sprintf(s, "%c.DriveFlags", toupper(*szDrive)); 1035 if (PrfQueryProfileData(fmprof, appname, s, &flags, &size) && 1036 size == sizeof(ULONG)) { 1037 driveflags[toupper(*szDrive) - 'A'] |= flags; 999 1038 } 1000 1039 1001 1040 if (x > 1) { 1041 // Hard drive (2..N) 1002 1042 if (!(driveflags[x] & DRIVE_NOPRESCAN)) { 1003 1043 *FileSystem = 0; … … 1006 1046 driveserial[x] = -1; 1007 1047 if (removable != -1) { 1008 struct 1009 { 1048 struct { 1010 1049 ULONG serial; 1011 1050 CHAR volumelength; 1012 1051 CHAR volumelabel[CCHMAXPATH]; 1013 } 1014 volser; 1052 } volser; 1015 1053 1016 1054 DosError(FERR_DISABLEHARDERR); … … 1018 1056 FSIL_VOLSER, &volser, sizeof(volser))) { 1019 1057 driveserial[x] = volser.serial; 1020 }1021 }1058 } 1059 } 1022 1060 else 1023 1061 driveflags[x] |= DRIVE_INVALID; 1062 1024 1063 memset(&fsa4, 0, sizeof(FILESTATUS4)); 1025 driveflags[x] |= ((removable == -1 || removable == 1)?1026 DRIVE_REMOVABLE : 0 );1064 driveflags[x] |= removable == -1 || removable == 1 ? 1065 DRIVE_REMOVABLE : 0; 1027 1066 if (drvtype & DRIVE_REMOTE) 1028 1067 driveflags[x] |= DRIVE_REMOTE; 1029 if (!stricmp(FileSystem,RAMFS)) 1030 { 1031 driveflags[x] |= DRIVE_RAMDISK; 1032 driveflags[x] &= ~DRIVE_REMOTE; 1033 } 1034 if (!stricmp(FileSystem,NDFS32)) 1035 { 1036 driveflags[x] |= DRIVE_VIRTUAL; 1037 driveflags[x] &= ~DRIVE_REMOTE; 1038 } 1039 if (!stricmp(FileSystem,NTFS)) 1040 driveflags[x] |= DRIVE_NOTWRITEABLE; 1068 if (!stricmp(FileSystem,RAMFS)) { 1069 driveflags[x] |= DRIVE_RAMDISK; 1070 driveflags[x] &= ~DRIVE_REMOTE; 1071 } 1072 if (!stricmp(FileSystem,NDFS32)) { 1073 driveflags[x] |= DRIVE_VIRTUAL; 1074 driveflags[x] &= ~DRIVE_REMOTE; 1075 } 1076 if (!stricmp(FileSystem,NTFS)) 1077 driveflags[x] |= DRIVE_NOTWRITEABLE; 1041 1078 if (strcmp(FileSystem, HPFS) && 1042 1079 strcmp(FileSystem, JFS) && 1043 strcmp(FileSystem, ISOFS) &&1080 strcmp(FileSystem, ISOFS) && 1044 1081 strcmp(FileSystem, CDFS) && 1045 1082 strcmp(FileSystem, FAT32) && 1046 strcmp(FileSystem, NDFS32) &&1047 strcmp(FileSystem, RAMFS) &&1048 strcmp(FileSystem, NTFS) &&1049 strcmp(FileSystem, HPFS386)) {1083 strcmp(FileSystem, NDFS32) && 1084 strcmp(FileSystem, RAMFS) && 1085 strcmp(FileSystem, NTFS) && 1086 strcmp(FileSystem, HPFS386)) { 1050 1087 driveflags[x] |= DRIVE_NOLONGNAMES; 1051 1088 } … … 1054 1091 removable = 1; 1055 1092 driveflags[x] |= DRIVE_REMOVABLE | DRIVE_NOTWRITEABLE | 1056 DRIVE_CDROM;1093 DRIVE_CDROM; 1057 1094 } 1058 1095 else if (!stricmp(FileSystem, CBSIFS)) { … … 1066 1103 1067 1104 pci->rc.flRecordAttr |= CRA_RECORDREADONLY; 1068 if ((ULONG) (toupper(*pci->pszFileName) - '@') == ulDriveNum) 1105 // if ((ULONG) (toupper(*pci->pszFileName) - '@') == ulCurDriveNum) // 23 Jul 07 SHL 1106 if ((ULONG)(toupper(*szDrive) - '@') == ulCurDriveNum) 1069 1107 pci->rc.flRecordAttr |= (CRA_CURSORED | CRA_SELECTED); 1070 1108 1071 1109 if (removable == 0) { 1110 // Fixed volume 1072 1111 pci->attrFile |= FILE_DIRECTORY; 1073 1112 DosError(FERR_DISABLEHARDERR); … … 1075 1114 FIL_QUERYEASIZE, 1076 1115 &fsa4, (ULONG) sizeof(FILESTATUS4)); 1116 // ERROR_BAD_NET_RSP = 58 1077 1117 if (rc == 58) { 1078 1118 DosError(FERR_DISABLEHARDERR); … … 1083 1123 } 1084 1124 if (rc && !didonce) { 1125 // Guess drive letter 1085 1126 if (!*suggest) { 1086 1127 *suggest = '/'; … … 1088 1129 } 1089 1130 sprintf(suggest + strlen(suggest), "%c" , toupper(*szDrive)); 1090 pci->pszFileName = xstrdup(szDrive, pszSrcFile, __LINE__);1131 pci->pszFileName = xstrdup(szDrive, pszSrcFile, __LINE__); 1091 1132 pci->rc.pszIcon = pci->pszFileName; 1092 1133 pci->attrFile = FILE_DIRECTORY; … … 1099 1140 } 1100 1141 else { 1101 pci->pszFileName = xstrdup(szDrive, pszSrcFile, __LINE__); 1142 // Removable volume 1143 pci->pszFileName = xstrdup(szDrive, pszSrcFile, __LINE__); 1102 1144 pci->rc.pszIcon = pci->pszFileName; 1103 1145 pci->attrFile = FILE_DIRECTORY; 1104 1146 strcpy(pci->szDispAttr, "----D-"); 1105 1147 pci->pszDispAttr = pci->szDispAttr; 1106 }1107 SelectDriveIcon(pci);1148 } 1149 SelectDriveIcon(pci); 1108 1150 } 1109 1151 else { 1110 1152 pci->rc.hptrIcon = hptrDunno; 1111 pci->pszFileName = xstrdup(szDrive, pszSrcFile, __LINE__);1153 pci->pszFileName = xstrdup(szDrive, pszSrcFile, __LINE__); 1112 1154 pci->rc.pszIcon = pci->pszFileName; 1113 1155 pci->attrFile = FILE_DIRECTORY; … … 1118 1160 } 1119 1161 else { 1162 // diskette drive (A or B) 1120 1163 pci->rc.hptrIcon = hptrFloppy; 1121 1164 pci->pszFileName = xstrdup(szDrive, pszSrcFile, __LINE__); … … 1160 1203 MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER)); 1161 1204 while (pci && (INT) pci != -1) { 1162 if ((ULONG) (toupper(*pci->pszFileName) - '@') == ul DriveNum) {1205 if ((ULONG) (toupper(*pci->pszFileName) - '@') == ulCurDriveNum) { 1163 1206 WinSendMsg(hwndCnr, 1164 1207 CM_SETRECORDEMPHASIS, … … 1222 1265 MPFROMLONG(EXTRA_RECORD_BYTES2), 1223 1266 MPFROMLONG(1)); 1224 if (pci) {1225 CHAR fname[CCHMAXPATH];1226 pci->flags |= RECFLAGS_ENV;1267 if (pci) { 1268 CHAR fname[CCHMAXPATH]; 1269 pci->flags |= RECFLAGS_ENV; 1227 1270 sprintf(fname, "%%%s%%", FileSystem); 1228 1271 pci->pszFileName = xstrdup(fname, pszSrcFile, __LINE__); … … 1271 1314 MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER)); 1272 1315 if (!(pci->flags & RECFLAGS_ENV)) { 1273 if ((ULONG) (toupper(*pci->pszFileName) - '@') == ul DriveNum ||1316 if ((ULONG) (toupper(*pci->pszFileName) - '@') == ulCurDriveNum || 1274 1317 toupper(*pci->pszFileName) > 'B') { 1275 1318 if (!(driveflags[toupper(*pci->pszFileName) - 'A'] & DRIVE_INVALID) … … 1399 1442 didonce = TRUE; 1400 1443 1401 } // FillTreeCnr1444 } // FillTreeCnr  - 
      
trunk/dll/flesh.c
r730 r731 233 233 ULONG ddepth = 3L; 234 234 static BOOL brokenlan = FALSE, isbroken = FALSE; 235 CHAR *f = 0;236 235 237 236 if (!pciParent || !*pciParent->pszFileName || !hwndCnr) … … 422 421 else { 423 422 RECORDINSERT ri; 424 pci->pszFileName = xstrdup(f, pszSrcFile, __LINE__);425 423 //pci->pszFileName = pci->szFileName; 424 pci->pszFileName = xstrdup(NullStr, pszSrcFile, __LINE__); 426 425 pci->rc.pszIcon = pci->pszFileName; 427 426 memset(&ri, 0, sizeof(RECORDINSERT));  - 
      
trunk/dll/objcnr.c
r730 r731 67 67 RECORDINSERT ri; 68 68 PCNRITEM pciP; 69 CHAR *f = 0;70 69 71 70 ffb = xmalloc(sizeof(FILEFINDBUF3), pszSrcFile, __LINE__); … … 92 91 93 92 if ((!rc && (ffb->attrFile & FILE_DIRECTORY))) { 94 pciP = 95 WinSendMsg(hwndCnr, CM_ALLOCRECORD, MPFROMLONG(EXTRA_RECORD_BYTES2), 96 MPFROMLONG(1L)); 93 pciP = WinSendMsg(hwndCnr, 94 CM_ALLOCRECORD, 95 MPFROMLONG(EXTRA_RECORD_BYTES2), 96 MPFROMLONG(1L)); 97 97 if (!pciP) { 98 98 free(ffb); … … 101 101 pciP->pszFileName = xstrdup(filename, pszSrcFile, __LINE__); 102 102 pciP->pszDispAttr = pciP->szDispAttr; 103 *pciP->szDispAttr = 0; 103 104 //pciP->pszSubject = pciP->szSubject; 105 pciP->pszSubject = xstrdup(NullStr, pszSrcFile, __LINE__); // 23 Jul 07 SHL 104 106 //pciP->pszLongname = pciP->szLongname; 105 pciP->pszDispAttr = pciP->szDispAttr; 106 *pciP->szDispAttr = 0; 107 pciP->pszLongname = xstrdup(f, pszSrcFile, __LINE__); 108 pciP->pszSubject = xstrdup(f, pszSrcFile, __LINE__); 107 pciP->pszLongname = xstrdup(NullStr, pszSrcFile, __LINE__); 109 108 if (strlen(filename) < 4) 110 109 pciP->pszFileName = pciP->pszFileName;  
  Note:
 See   TracChangeset
 for help on using the changeset viewer.
  