| 1 | #define INCL_DOS | 
|---|
| 2 | #define INCL_WIN | 
|---|
| 3 |  | 
|---|
| 4 | #include <os2.h> | 
|---|
| 5 | #include <stdarg.h> | 
|---|
| 6 | #include <stdio.h> | 
|---|
| 7 | #include <stdlib.h> | 
|---|
| 8 | #include <string.h> | 
|---|
| 9 | #include <ctype.h> | 
|---|
| 10 | #include "fm3dll.h" | 
|---|
| 11 |  | 
|---|
| 12 | #pragma alloc_text(UPDATECNR,UpdateCnrRecord,UpdateCnrList) | 
|---|
| 13 |  | 
|---|
| 14 |  | 
|---|
| 15 | PCNRITEM UpdateCnrRecord (HWND hwndCnr,CHAR *filename,BOOL partial, | 
|---|
| 16 | DIRCNRDATA *dcd) { | 
|---|
| 17 |  | 
|---|
| 18 | PCNRITEM      pci; | 
|---|
| 19 | FILEFINDBUF4  ffb; | 
|---|
| 20 | HDIR          hDir = HDIR_CREATE; | 
|---|
| 21 | ULONG         nm = 1L; | 
|---|
| 22 | ULONG         oldemphasis = 0; | 
|---|
| 23 | APIRET        status; | 
|---|
| 24 | BOOL          needtosort = FALSE; | 
|---|
| 25 | #ifdef DEBUG | 
|---|
| 26 | BOOL existed=FALSE,updated=FALSE,added=FALSE,deleted=FALSE,found=FALSE; | 
|---|
| 27 | #endif | 
|---|
| 28 |  | 
|---|
| 29 | if(!filename || !*filename) | 
|---|
| 30 | return (PCNRITEM)NULL; | 
|---|
| 31 | if(IsFullName(filename)) { | 
|---|
| 32 | if(driveflags[toupper(*filename) - 'A'] & DRIVE_NOTWRITEABLE) | 
|---|
| 33 | /* ignore non-writeable drives */ | 
|---|
| 34 | return (PCNRITEM)NULL; | 
|---|
| 35 | } | 
|---|
| 36 | status = DosFindFirst(filename, | 
|---|
| 37 | &hDir, | 
|---|
| 38 | FILE_NORMAL   | FILE_DIRECTORY | | 
|---|
| 39 | FILE_ARCHIVED | FILE_READONLY | | 
|---|
| 40 | FILE_HIDDEN   | FILE_SYSTEM, | 
|---|
| 41 | &ffb, | 
|---|
| 42 | sizeof(ffb), | 
|---|
| 43 | &nm, | 
|---|
| 44 | FIL_QUERYEASIZE); | 
|---|
| 45 | if(!status) { | 
|---|
| 46 | #ifdef DEBUG | 
|---|
| 47 | existed = TRUE; | 
|---|
| 48 | #endif | 
|---|
| 49 | /* file exists */ | 
|---|
| 50 | DosFindClose(hDir); | 
|---|
| 51 | if(!dcd) | 
|---|
| 52 | dcd = INSTDATA(hwndCnr); | 
|---|
| 53 | /* | 
|---|
| 54 | if(dcd->type == TREE_FRAME && | 
|---|
| 55 | !(ffb.attrFile & FILE_DIRECTORY)) | 
|---|
| 56 | return (PCNRITEM)NULL; | 
|---|
| 57 | */ | 
|---|
| 58 | if(dcd->type == ARC_FRAME) | 
|---|
| 59 | return (PCNRITEM)NULL; | 
|---|
| 60 | if(*dcd->directory) { | 
|---|
| 61 |  | 
|---|
| 62 | CHAR *p,temp; | 
|---|
| 63 |  | 
|---|
| 64 | p = strrchr(filename,'\\'); | 
|---|
| 65 | if(p) { | 
|---|
| 66 | if(p < filename + 3) | 
|---|
| 67 | p++; | 
|---|
| 68 | temp = *p; | 
|---|
| 69 | *p = 0; | 
|---|
| 70 | if(stricmp(filename,dcd->directory)) { | 
|---|
| 71 | *p = temp; | 
|---|
| 72 | return (PCNRITEM)NULL; | 
|---|
| 73 | } | 
|---|
| 74 | *p = temp; | 
|---|
| 75 | } | 
|---|
| 76 | else | 
|---|
| 77 | return (PCNRITEM)NULL; | 
|---|
| 78 | } | 
|---|
| 79 | pci = FindCnrRecord(hwndCnr, | 
|---|
| 80 | filename, | 
|---|
| 81 | (PCNRITEM)NULL, | 
|---|
| 82 | partial, | 
|---|
| 83 | FALSE, | 
|---|
| 84 | TRUE); | 
|---|
| 85 | Update: | 
|---|
| 86 | if(pci) {     /* update record? */ | 
|---|
| 87 | #ifdef DEBUG | 
|---|
| 88 | found=TRUE; | 
|---|
| 89 | #endif | 
|---|
| 90 | if((!fForceUpper && !fForceLower && | 
|---|
| 91 | strcmp(pci->szFileName,filename)) || | 
|---|
| 92 | pci->cbFile != ffb.cbFile || pci->attrFile != ffb.attrFile || | 
|---|
| 93 | pci->easize != ((ffb.cbList > 4L) ? (ffb.cbList / 2) : 0L) || | 
|---|
| 94 | pci->date.day != ffb.fdateLastWrite.day || | 
|---|
| 95 | pci->date.month != ffb.fdateLastWrite.month || | 
|---|
| 96 | pci->date.year != ffb.fdateLastWrite.year + 1980 || | 
|---|
| 97 | pci->time.seconds != ffb.ftimeLastWrite.twosecs * 2 || | 
|---|
| 98 | pci->time.minutes != ffb.ftimeLastWrite.minutes || | 
|---|
| 99 | pci->time.hours != ffb.ftimeLastWrite.hours || | 
|---|
| 100 | pci->ladate.day != ffb.fdateLastAccess.day || | 
|---|
| 101 | pci->ladate.month != ffb.fdateLastAccess.month || | 
|---|
| 102 | pci->ladate.year != ffb.fdateLastAccess.year + 1980 || | 
|---|
| 103 | pci->latime.seconds != ffb.ftimeLastAccess.twosecs * 2 || | 
|---|
| 104 | pci->latime.minutes != ffb.ftimeLastAccess.minutes || | 
|---|
| 105 | pci->latime.hours != ffb.ftimeLastAccess.hours) { /* changed; update */ | 
|---|
| 106 | #ifdef DEBUG | 
|---|
| 107 | updated=TRUE; | 
|---|
| 108 | #endif | 
|---|
| 109 | *ffb.achName = 0; | 
|---|
| 110 | ffb.cchName = 0; | 
|---|
| 111 | FillInRecordFromFFB(hwndCnr,pci,filename,&ffb,partial,dcd); | 
|---|
| 112 | if(strlen(pci->szFileName) < 4) { | 
|---|
| 113 | *pci->szFileName = toupper(*pci->szFileName); | 
|---|
| 114 | if(isalpha(*pci->szFileName) && toupper(*pci->szFileName) > 'B') { | 
|---|
| 115 | if(driveflags[toupper(*pci->szFileName) - 'A'] & DRIVE_CDROM) | 
|---|
| 116 | pci->rc.hptrIcon = hptrCDROM; | 
|---|
| 117 | else | 
|---|
| 118 | pci->rc.hptrIcon = (driveflags[toupper(*pci->szFileName) - 'A'] & DRIVE_REMOVABLE) ? | 
|---|
| 119 | hptrRemovable : | 
|---|
| 120 | (driveflags[toupper(*pci->szFileName) - 'A'] & DRIVE_REMOTE) ? | 
|---|
| 121 | hptrRemote : | 
|---|
| 122 | (driveflags[toupper(*pci->szFileName) - 'A'] & DRIVE_ZIPSTREAM) ? | 
|---|
| 123 | hptrZipstrm : hptrDrive; | 
|---|
| 124 | } | 
|---|
| 125 | else | 
|---|
| 126 | pci->rc.hptrIcon = hptrFloppy; | 
|---|
| 127 | } | 
|---|
| 128 | oldemphasis = pci->rc.flRecordAttr & | 
|---|
| 129 | (CRA_SELECTED | CRA_CURSORED); | 
|---|
| 130 | if(oldemphasis) | 
|---|
| 131 | WinSendMsg(hwndCnr, | 
|---|
| 132 | CM_SETRECORDEMPHASIS, | 
|---|
| 133 | MPFROMP(pci), | 
|---|
| 134 | MPFROM2SHORT(FALSE, | 
|---|
| 135 | oldemphasis)); | 
|---|
| 136 | WinSendMsg(hwndCnr, | 
|---|
| 137 | CM_INVALIDATERECORD, | 
|---|
| 138 | MPFROMP(&pci), | 
|---|
| 139 | MPFROM2SHORT(1, | 
|---|
| 140 | /* CMA_ERASE | */CMA_TEXTCHANGED)); | 
|---|
| 141 | if(oldemphasis) | 
|---|
| 142 | WinSendMsg(hwndCnr, | 
|---|
| 143 | CM_SETRECORDEMPHASIS, | 
|---|
| 144 | MPFROMP(pci), | 
|---|
| 145 | MPFROM2SHORT(TRUE, | 
|---|
| 146 | oldemphasis)); | 
|---|
| 147 | } | 
|---|
| 148 | else  /* existed, unchanged, do nothing but return */ | 
|---|
| 149 | return pci; | 
|---|
| 150 | } | 
|---|
| 151 | else {        /* add record */ | 
|---|
| 152 | #ifdef DEBUG | 
|---|
| 153 | added=TRUE; | 
|---|
| 154 | #endif | 
|---|
| 155 | needtosort = TRUE; | 
|---|
| 156 | if(dcd->type == DIR_FRAME) { | 
|---|
| 157 |  | 
|---|
| 158 | RECORDINSERT ri; | 
|---|
| 159 | ULONG        totalbytes; | 
|---|
| 160 |  | 
|---|
| 161 | pci = WinSendMsg(hwndCnr, | 
|---|
| 162 | CM_ALLOCRECORD, | 
|---|
| 163 | MPFROMLONG(EXTRA_RECORD_BYTES), | 
|---|
| 164 | MPFROMLONG(1L)); | 
|---|
| 165 | if(pci) { | 
|---|
| 166 | *ffb.achName = 0; | 
|---|
| 167 | totalbytes = FillInRecordFromFFB(hwndCnr, | 
|---|
| 168 | pci, | 
|---|
| 169 | filename, | 
|---|
| 170 | &ffb, | 
|---|
| 171 | partial, | 
|---|
| 172 | dcd); | 
|---|
| 173 | if(strlen(pci->szFileName) < 4) { | 
|---|
| 174 | *pci->szFileName = toupper(*pci->szFileName); | 
|---|
| 175 | if(isalpha(*pci->szFileName) && | 
|---|
| 176 | toupper(*pci->szFileName) > 'B') { | 
|---|
| 177 | if(driveflags[toupper(*pci->szFileName) - 'A'] & DRIVE_CDROM) | 
|---|
| 178 | pci->rc.hptrIcon = hptrCDROM; | 
|---|
| 179 | else | 
|---|
| 180 | pci->rc.hptrIcon = (driveflags[toupper(*pci->szFileName) - 'A'] & DRIVE_REMOVABLE) ? | 
|---|
| 181 | hptrRemovable : | 
|---|
| 182 | (driveflags[toupper(*pci->szFileName) - 'A'] & DRIVE_REMOTE) ? | 
|---|
| 183 | hptrRemote : | 
|---|
| 184 | (driveflags[toupper(*pci->szFileName) - 'A'] & DRIVE_ZIPSTREAM) ? | 
|---|
| 185 | hptrZipstrm : hptrDrive; | 
|---|
| 186 | } | 
|---|
| 187 | else | 
|---|
| 188 | pci->rc.hptrIcon = hptrFloppy; | 
|---|
| 189 | } | 
|---|
| 190 | memset(&ri,0,sizeof(RECORDINSERT)); | 
|---|
| 191 | ri.cb                 = sizeof(RECORDINSERT); | 
|---|
| 192 | ri.pRecordOrder       = (PRECORDCORE)CMA_END; | 
|---|
| 193 | ri.pRecordParent      = (PRECORDCORE)NULL; | 
|---|
| 194 | ri.zOrder             = (USHORT)CMA_TOP; | 
|---|
| 195 | ri.cRecordsInsert     = 1L; | 
|---|
| 196 | ri.fInvalidateRecord  = TRUE; | 
|---|
| 197 | if(WinSendMsg(hwndCnr, | 
|---|
| 198 | CM_INSERTRECORD, | 
|---|
| 199 | MPFROMP(pci), | 
|---|
| 200 | MPFROMP(&ri)) && | 
|---|
| 201 | totalbytes != (ULONG)-1L && | 
|---|
| 202 | totalbytes) { | 
|---|
| 203 | dcd->totalbytes += totalbytes; | 
|---|
| 204 | PostMsg(hwndCnr, | 
|---|
| 205 | UM_RESCAN, | 
|---|
| 206 | MPVOID, | 
|---|
| 207 | MPVOID); | 
|---|
| 208 | if(pci->attrFile & FILE_DIRECTORY) | 
|---|
| 209 | Stubby(hwndCnr,pci); | 
|---|
| 210 | } | 
|---|
| 211 | } | 
|---|
| 212 | } | 
|---|
| 213 | else if(ffb.attrFile & FILE_DIRECTORY) { | 
|---|
| 214 |  | 
|---|
| 215 | /* check all parts and insert as required */ | 
|---|
| 216 | CHAR    *p,temp; | 
|---|
| 217 | PCNRITEM pciParent = NULL,pciT; | 
|---|
| 218 |  | 
|---|
| 219 | p = strchr(filename,'\\'); | 
|---|
| 220 | if(p) { | 
|---|
| 221 | while(p && *p) { | 
|---|
| 222 | if(p < filename + 3) | 
|---|
| 223 | p++; | 
|---|
| 224 | temp = *p; | 
|---|
| 225 | *p = 0; | 
|---|
| 226 | pciT = FindCnrRecord(hwndCnr, | 
|---|
| 227 | filename, | 
|---|
| 228 | NULL, | 
|---|
| 229 | partial, | 
|---|
| 230 | FALSE, | 
|---|
| 231 | TRUE); | 
|---|
| 232 | if(!pciT || (INT)pciT == -1) { | 
|---|
| 233 | pci = WinSendMsg(hwndCnr, | 
|---|
| 234 | CM_ALLOCRECORD, | 
|---|
| 235 | MPFROMLONG(EXTRA_RECORD_BYTES), | 
|---|
| 236 | MPFROMLONG(1L)); | 
|---|
| 237 | if(pci) { | 
|---|
| 238 |  | 
|---|
| 239 | RECORDINSERT ri; | 
|---|
| 240 | ULONG        totalbytes; | 
|---|
| 241 |  | 
|---|
| 242 | *ffb.achName = 0; | 
|---|
| 243 | totalbytes = FillInRecordFromFFB(hwndCnr, | 
|---|
| 244 | pci, | 
|---|
| 245 | filename, | 
|---|
| 246 | &ffb, | 
|---|
| 247 | partial, | 
|---|
| 248 | dcd); | 
|---|
| 249 | if(strlen(pci->szFileName) < 4) { | 
|---|
| 250 | *pci->szFileName = toupper(*pci->szFileName); | 
|---|
| 251 | if(isalpha(*pci->szFileName) && toupper(*pci->szFileName) > 'B') { | 
|---|
| 252 | if(driveflags[toupper(*pci->szFileName) - 'A'] & DRIVE_CDROM) | 
|---|
| 253 | pci->rc.hptrIcon = hptrCDROM; | 
|---|
| 254 | else | 
|---|
| 255 | pci->rc.hptrIcon = (driveflags[toupper(*pci->szFileName) - 'A'] & DRIVE_REMOVABLE) ? | 
|---|
| 256 | hptrRemovable : | 
|---|
| 257 | (driveflags[toupper(*pci->szFileName) - 'A'] & DRIVE_REMOTE) ? | 
|---|
| 258 | hptrRemote : | 
|---|
| 259 | (driveflags[toupper(*pci->szFileName) - 'A'] & DRIVE_ZIPSTREAM) ? | 
|---|
| 260 | hptrZipstrm : hptrDrive; | 
|---|
| 261 | } | 
|---|
| 262 | else | 
|---|
| 263 | pci->rc.hptrIcon = hptrFloppy; | 
|---|
| 264 | } | 
|---|
| 265 | memset(&ri,0,sizeof(RECORDINSERT)); | 
|---|
| 266 | ri.cb                 = sizeof(RECORDINSERT); | 
|---|
| 267 | ri.pRecordOrder       = (PRECORDCORE)CMA_END; | 
|---|
| 268 | ri.pRecordParent      = (PRECORDCORE)pciParent; | 
|---|
| 269 | ri.zOrder             = (USHORT)CMA_TOP; | 
|---|
| 270 | ri.cRecordsInsert     = 1L; | 
|---|
| 271 | ri.fInvalidateRecord  = TRUE; | 
|---|
| 272 | if(WinSendMsg(hwndCnr, | 
|---|
| 273 | CM_INSERTRECORD, | 
|---|
| 274 | MPFROMP(pci), | 
|---|
| 275 | MPFROMP(&ri))) { | 
|---|
| 276 | Flesh(hwndCnr,pci); | 
|---|
| 277 | *p = temp; | 
|---|
| 278 | pci = FindCnrRecord(hwndCnr, | 
|---|
| 279 | filename, | 
|---|
| 280 | pciT, | 
|---|
| 281 | partial, | 
|---|
| 282 | FALSE, | 
|---|
| 283 | TRUE); | 
|---|
| 284 | if(pci) | 
|---|
| 285 | goto Update; | 
|---|
| 286 | } | 
|---|
| 287 | } | 
|---|
| 288 | } | 
|---|
| 289 | else { | 
|---|
| 290 | pciParent = pciT; | 
|---|
| 291 | if(!(pciT->rc.flRecordAttr & CRA_EXPANDED)) { | 
|---|
| 292 | Flesh(hwndCnr,pciT); | 
|---|
| 293 | *p = temp; | 
|---|
| 294 | pci = FindCnrRecord(hwndCnr, | 
|---|
| 295 | filename, | 
|---|
| 296 | pciT, | 
|---|
| 297 | partial, | 
|---|
| 298 | FALSE, | 
|---|
| 299 | TRUE); | 
|---|
| 300 | if(pci) | 
|---|
| 301 | goto Update; | 
|---|
| 302 | } | 
|---|
| 303 | } | 
|---|
| 304 | *p = temp; | 
|---|
| 305 | p = strchr(p + ((temp == '\\') ? 1 : 0),'\\'); | 
|---|
| 306 | } | 
|---|
| 307 | } | 
|---|
| 308 | pci = WinSendMsg(hwndCnr, | 
|---|
| 309 | CM_ALLOCRECORD, | 
|---|
| 310 | MPFROMLONG(EXTRA_RECORD_BYTES), | 
|---|
| 311 | MPFROMLONG(1L)); | 
|---|
| 312 | if(pci) { | 
|---|
| 313 |  | 
|---|
| 314 | RECORDINSERT ri; | 
|---|
| 315 | ULONG        totalbytes; | 
|---|
| 316 |  | 
|---|
| 317 | *ffb.achName = 0; | 
|---|
| 318 | totalbytes = FillInRecordFromFFB(hwndCnr, | 
|---|
| 319 | pci, | 
|---|
| 320 | filename, | 
|---|
| 321 | &ffb, | 
|---|
| 322 | partial, | 
|---|
| 323 | dcd); | 
|---|
| 324 | if(strlen(pci->szFileName) < 4) { | 
|---|
| 325 | *pci->szFileName = toupper(*pci->szFileName); | 
|---|
| 326 | if(isalpha(*pci->szFileName) && | 
|---|
| 327 | toupper(*pci->szFileName) > 'B') { | 
|---|
| 328 | if(driveflags[toupper(*pci->szFileName) - 'A'] & DRIVE_CDROM) | 
|---|
| 329 | pci->rc.hptrIcon = hptrCDROM; | 
|---|
| 330 | else | 
|---|
| 331 | pci->rc.hptrIcon = (driveflags[toupper(*pci->szFileName) - 'A'] & DRIVE_REMOVABLE) ? | 
|---|
| 332 | hptrRemovable : | 
|---|
| 333 | (driveflags[toupper(*pci->szFileName) - 'A'] & DRIVE_REMOTE) ? | 
|---|
| 334 | hptrRemote : | 
|---|
| 335 | (driveflags[toupper(*pci->szFileName) - 'A'] & DRIVE_ZIPSTREAM) ? | 
|---|
| 336 | hptrZipstrm : hptrDrive; | 
|---|
| 337 | } | 
|---|
| 338 | else | 
|---|
| 339 | pci->rc.hptrIcon = hptrFloppy; | 
|---|
| 340 | } | 
|---|
| 341 | memset(&ri,0,sizeof(RECORDINSERT)); | 
|---|
| 342 | ri.cb                 = sizeof(RECORDINSERT); | 
|---|
| 343 | ri.pRecordOrder       = (PRECORDCORE)CMA_END; | 
|---|
| 344 | ri.pRecordParent      = (PRECORDCORE)pciParent; | 
|---|
| 345 | ri.zOrder             = (USHORT)CMA_TOP; | 
|---|
| 346 | ri.cRecordsInsert     = 1L; | 
|---|
| 347 | ri.fInvalidateRecord  = TRUE; | 
|---|
| 348 | if(WinSendMsg(hwndCnr, | 
|---|
| 349 | CM_INSERTRECORD, | 
|---|
| 350 | MPFROMP(pci), | 
|---|
| 351 | MPFROMP(&ri)) && | 
|---|
| 352 | totalbytes != (ULONG)-1L && | 
|---|
| 353 | totalbytes) { | 
|---|
| 354 | if(dcd->type == DIR_FRAME) | 
|---|
| 355 | dcd->totalbytes += totalbytes; | 
|---|
| 356 | Stubby(hwndCnr,pci); | 
|---|
| 357 | } | 
|---|
| 358 | } | 
|---|
| 359 | } | 
|---|
| 360 | } | 
|---|
| 361 | } | 
|---|
| 362 | else if((pci = FindCnrRecord(hwndCnr, | 
|---|
| 363 | filename, | 
|---|
| 364 | (PCNRITEM)NULL, | 
|---|
| 365 | partial, | 
|---|
| 366 | FALSE, | 
|---|
| 367 | TRUE)) != | 
|---|
| 368 | NULL && (INT)pci != -1 && strlen(pci->szFileName) > 3) { | 
|---|
| 369 | /* file doesn't exist; delete record */ | 
|---|
| 370 | #ifdef DEBUG | 
|---|
| 371 | found=TRUE; | 
|---|
| 372 | deleted=TRUE; | 
|---|
| 373 | #endif | 
|---|
| 374 | if(!dcd) | 
|---|
| 375 | dcd = INSTDATA(hwndCnr); | 
|---|
| 376 | if(pci->rc.flRecordAttr & CRA_SELECTED) | 
|---|
| 377 | WinSendMsg(hwndCnr, | 
|---|
| 378 | CM_SETRECORDEMPHASIS, | 
|---|
| 379 | MPFROMP(pci), | 
|---|
| 380 | MPFROM2SHORT(FALSE, | 
|---|
| 381 | CRA_SELECTED)); | 
|---|
| 382 | if(dcd->type == DIR_FRAME) | 
|---|
| 383 | dcd->totalbytes -= (pci->cbFile + pci->easize); | 
|---|
| 384 | WinSendMsg(hwndCnr, | 
|---|
| 385 | CM_REMOVERECORD, | 
|---|
| 386 | MPFROMP(&pci), | 
|---|
| 387 | MPFROM2SHORT(1, | 
|---|
| 388 | CMA_FREE | CMA_INVALIDATE)); | 
|---|
| 389 | pci = (PCNRITEM)NULL; | 
|---|
| 390 | PostMsg(hwndCnr, | 
|---|
| 391 | UM_RESCAN, | 
|---|
| 392 | MPVOID, | 
|---|
| 393 | MPVOID); | 
|---|
| 394 | } | 
|---|
| 395 | #ifdef DEBUG | 
|---|
| 396 | { | 
|---|
| 397 | char s[CCHMAXPATH + 80]; | 
|---|
| 398 | sprintf(s,"%s:%s%s%s%s%s",filename,(existed) ? " Existed" : "", | 
|---|
| 399 | (updated) ? " Updated" : "",(added) ? " Added" : "", | 
|---|
| 400 | (deleted) ? " Deleted" : "",(found) ? " Found" : ""); | 
|---|
| 401 | WinSetWindowText(WinQueryWindow(hwndMain,QW_PARENT),s); | 
|---|
| 402 | } | 
|---|
| 403 | #endif | 
|---|
| 404 | return pci; | 
|---|
| 405 | } | 
|---|
| 406 |  | 
|---|
| 407 |  | 
|---|
| 408 |  | 
|---|
| 409 | BOOL UpdateCnrList (HWND hwndCnr,CHAR **filename,INT howmany,BOOL partial, | 
|---|
| 410 | DIRCNRDATA *dcd) { | 
|---|
| 411 |  | 
|---|
| 412 | PCNRITEM      pci,*pciList = NULL; | 
|---|
| 413 | FILEFINDBUF4  ffb; | 
|---|
| 414 | HDIR          hDir; | 
|---|
| 415 | ULONG         nm = 1L; | 
|---|
| 416 | register INT  x,numlist = 0,numremain; | 
|---|
| 417 | BOOL          repos = FALSE,needtosort = FALSE,ret = FALSE; | 
|---|
| 418 | APIRET        status; | 
|---|
| 419 |  | 
|---|
| 420 | if(!dcd) | 
|---|
| 421 | dcd = INSTDATA(hwndCnr); | 
|---|
| 422 | if(!dcd) | 
|---|
| 423 | return ret; | 
|---|
| 424 | if(!filename || !howmany || !filename[0]) | 
|---|
| 425 | return ret; | 
|---|
| 426 | { | 
|---|
| 427 | CNRINFO cnri; | 
|---|
| 428 |  | 
|---|
| 429 | memset(&cnri,0,sizeof(CNRINFO)); | 
|---|
| 430 | cnri.cb = sizeof(CNRINFO); | 
|---|
| 431 | WinSendMsg(hwndCnr, | 
|---|
| 432 | CM_QUERYCNRINFO, | 
|---|
| 433 | MPFROMP(&cnri), | 
|---|
| 434 | MPFROMLONG(sizeof(CNRINFO))); | 
|---|
| 435 | numremain = cnri.cRecords; | 
|---|
| 436 | } | 
|---|
| 437 | pciList = malloc(sizeof(PCNRITEM) * howmany); | 
|---|
| 438 | for(x = 0;filename[x] && x < howmany;x++) { | 
|---|
| 439 | if(IsFullName(filename[x])) { | 
|---|
| 440 | if(driveflags[toupper(*filename[x]) - 'A'] & DRIVE_NOTWRITEABLE) | 
|---|
| 441 | /* ignore non-writeable drives */ | 
|---|
| 442 | continue; | 
|---|
| 443 | } | 
|---|
| 444 | hDir = HDIR_CREATE; | 
|---|
| 445 | status = DosFindFirst(filename[x], | 
|---|
| 446 | &hDir, | 
|---|
| 447 | FILE_NORMAL   | FILE_DIRECTORY | | 
|---|
| 448 | FILE_ARCHIVED | FILE_READONLY | | 
|---|
| 449 | FILE_HIDDEN   | FILE_SYSTEM, | 
|---|
| 450 | &ffb, | 
|---|
| 451 | sizeof(ffb), | 
|---|
| 452 | &nm, | 
|---|
| 453 | FIL_QUERYEASIZE); | 
|---|
| 454 | if(!status) { | 
|---|
| 455 | /* file exists */ | 
|---|
| 456 | DosFindClose(hDir); | 
|---|
| 457 | //      if(dcd->type == TREE_FRAME && !(ffb.attrFile & FILE_DIRECTORY)) | 
|---|
| 458 | //        continue; | 
|---|
| 459 | if(dcd->type == DIR_FRAME && | 
|---|
| 460 | *dcd->directory) { | 
|---|
| 461 |  | 
|---|
| 462 | CHAR *p,temp; | 
|---|
| 463 |  | 
|---|
| 464 | p = strrchr(filename[x],'\\'); | 
|---|
| 465 | if(p) { | 
|---|
| 466 | if(p < filename[x] + 3) | 
|---|
| 467 | p++; | 
|---|
| 468 | temp = *p; | 
|---|
| 469 | *p = 0; | 
|---|
| 470 | if(stricmp(filename[x],dcd->directory)) { | 
|---|
| 471 | *p = temp; | 
|---|
| 472 | continue; | 
|---|
| 473 | } | 
|---|
| 474 | *p = temp; | 
|---|
| 475 | } | 
|---|
| 476 | else | 
|---|
| 477 | continue; | 
|---|
| 478 | } | 
|---|
| 479 | ret = TRUE; | 
|---|
| 480 | pci = FindCnrRecord(hwndCnr, | 
|---|
| 481 | filename[x], | 
|---|
| 482 | (PCNRITEM)NULL, | 
|---|
| 483 | partial, | 
|---|
| 484 | FALSE, | 
|---|
| 485 | TRUE); | 
|---|
| 486 | if(pci) {     /* update record? */ | 
|---|
| 487 | if((!fForceUpper && !fForceLower && | 
|---|
| 488 | strcmp(pci->szFileName,filename[x])) || | 
|---|
| 489 | pci->cbFile != ffb.cbFile || pci->attrFile != ffb.attrFile || | 
|---|
| 490 | pci->easize != ((ffb.cbList > 4L) ? (ffb.cbList / 2) : 0L) || | 
|---|
| 491 | pci->date.day != ffb.fdateLastWrite.day || | 
|---|
| 492 | pci->date.month != ffb.fdateLastWrite.month || | 
|---|
| 493 | pci->date.year != ffb.fdateLastWrite.year + 1980 || | 
|---|
| 494 | pci->time.seconds != ffb.ftimeLastWrite.twosecs * 2 || | 
|---|
| 495 | pci->time.minutes != ffb.ftimeLastWrite.minutes || | 
|---|
| 496 | pci->time.hours != ffb.ftimeLastWrite.hours || | 
|---|
| 497 | pci->ladate.day != ffb.fdateLastAccess.day || | 
|---|
| 498 | pci->ladate.month != ffb.fdateLastAccess.month || | 
|---|
| 499 | pci->ladate.year != ffb.fdateLastAccess.year + 1980 || | 
|---|
| 500 | pci->latime.seconds != ffb.ftimeLastAccess.twosecs * 2 || | 
|---|
| 501 | pci->latime.minutes != ffb.ftimeLastAccess.minutes || | 
|---|
| 502 | pci->latime.hours != ffb.ftimeLastAccess.hours) { /* changed; update */ | 
|---|
| 503 | pciList[numlist++] = pci; | 
|---|
| 504 | *ffb.achName = 0; | 
|---|
| 505 | ffb.cchName = 0; | 
|---|
| 506 | FillInRecordFromFFB(hwndCnr, | 
|---|
| 507 | pci, | 
|---|
| 508 | filename[x], | 
|---|
| 509 | &ffb, | 
|---|
| 510 | partial, | 
|---|
| 511 | dcd); | 
|---|
| 512 | if(IsRoot(pci->szFileName)) { | 
|---|
| 513 | *pci->szFileName = toupper(*pci->szFileName); | 
|---|
| 514 | if(isalpha(*pci->szFileName) && | 
|---|
| 515 | toupper(*pci->szFileName) > 'B') { | 
|---|
| 516 | if(driveflags[toupper(*pci->szFileName) - 'A'] & DRIVE_CDROM) | 
|---|
| 517 | pci->rc.hptrIcon = hptrCDROM; | 
|---|
| 518 | else | 
|---|
| 519 | pci->rc.hptrIcon = (driveflags[toupper(*pci->szFileName) - 'A'] & DRIVE_REMOVABLE) ? | 
|---|
| 520 | hptrRemovable : | 
|---|
| 521 | (driveflags[toupper(*pci->szFileName) - 'A'] & DRIVE_REMOTE) ? | 
|---|
| 522 | hptrRemote : | 
|---|
| 523 | (driveflags[toupper(*pci->szFileName) - 'A'] & DRIVE_ZIPSTREAM) ? | 
|---|
| 524 | hptrZipstrm : hptrDrive; | 
|---|
| 525 | } | 
|---|
| 526 | else | 
|---|
| 527 | pci->rc.hptrIcon = hptrFloppy; | 
|---|
| 528 | } | 
|---|
| 529 | WinSendMsg(hwndCnr, | 
|---|
| 530 | CM_SETRECORDEMPHASIS, | 
|---|
| 531 | MPFROMP(pci), | 
|---|
| 532 | MPFROM2SHORT(FALSE, | 
|---|
| 533 | CRA_SELECTED | CRA_CURSORED)); | 
|---|
| 534 | } | 
|---|
| 535 | } | 
|---|
| 536 | else {        /* add record */ | 
|---|
| 537 | needtosort = TRUE; | 
|---|
| 538 | if(dcd->type == DIR_FRAME) { | 
|---|
| 539 |  | 
|---|
| 540 | RECORDINSERT ri; | 
|---|
| 541 | ULONG        totalbytes; | 
|---|
| 542 |  | 
|---|
| 543 | pci = WinSendMsg(hwndCnr, | 
|---|
| 544 | CM_ALLOCRECORD, | 
|---|
| 545 | MPFROMLONG(EXTRA_RECORD_BYTES), | 
|---|
| 546 | MPFROMLONG(1L)); | 
|---|
| 547 | if(pci) { | 
|---|
| 548 | ret = TRUE; | 
|---|
| 549 | *ffb.achName = 0; | 
|---|
| 550 | totalbytes = FillInRecordFromFFB(hwndCnr, | 
|---|
| 551 | pci, | 
|---|
| 552 | filename[x], | 
|---|
| 553 | &ffb, | 
|---|
| 554 | partial, | 
|---|
| 555 | dcd); | 
|---|
| 556 | if(strlen(pci->szFileName) < 4) { | 
|---|
| 557 | *pci->szFileName = toupper(*pci->szFileName); | 
|---|
| 558 | if(isalpha(*pci->szFileName) && | 
|---|
| 559 | toupper(*pci->szFileName) > 'B') { | 
|---|
| 560 | if(driveflags[toupper(*pci->szFileName) - 'A'] & DRIVE_CDROM) | 
|---|
| 561 | pci->rc.hptrIcon = hptrCDROM; | 
|---|
| 562 | else | 
|---|
| 563 | pci->rc.hptrIcon = (driveflags[toupper(*pci->szFileName) - 'A'] & DRIVE_REMOVABLE) ? | 
|---|
| 564 | hptrRemovable : | 
|---|
| 565 | (driveflags[toupper(*pci->szFileName) - 'A'] & DRIVE_REMOTE) ? | 
|---|
| 566 | hptrRemote : | 
|---|
| 567 | (driveflags[toupper(*pci->szFileName) - 'A'] & DRIVE_ZIPSTREAM) ? | 
|---|
| 568 | hptrZipstrm : hptrDrive; | 
|---|
| 569 | } | 
|---|
| 570 | else | 
|---|
| 571 | pci->rc.hptrIcon = hptrFloppy; | 
|---|
| 572 | } | 
|---|
| 573 | memset(&ri,0,sizeof(RECORDINSERT)); | 
|---|
| 574 | ri.cb                 = sizeof(RECORDINSERT); | 
|---|
| 575 | ri.pRecordOrder       = (PRECORDCORE)CMA_END; | 
|---|
| 576 | ri.pRecordParent      = (PRECORDCORE)NULL; | 
|---|
| 577 | ri.zOrder             = (USHORT)CMA_TOP; | 
|---|
| 578 | ri.cRecordsInsert     = 1L; | 
|---|
| 579 | ri.fInvalidateRecord  = FALSE; | 
|---|
| 580 | if(WinSendMsg(hwndCnr, | 
|---|
| 581 | CM_INSERTRECORD, | 
|---|
| 582 | MPFROMP(pci), | 
|---|
| 583 | MPFROMP(&ri))) { | 
|---|
| 584 | if(totalbytes != (ULONG)-1L && | 
|---|
| 585 | totalbytes) { | 
|---|
| 586 | dcd->totalbytes += totalbytes; | 
|---|
| 587 | numremain++; | 
|---|
| 588 | } | 
|---|
| 589 | repos = TRUE; | 
|---|
| 590 | if(pci->attrFile & FILE_DIRECTORY) | 
|---|
| 591 | Stubby(hwndCnr,pci); | 
|---|
| 592 | } | 
|---|
| 593 | else | 
|---|
| 594 | WinSendMsg(hwndCnr, | 
|---|
| 595 | CM_FREERECORD, | 
|---|
| 596 | MPFROMP(&pci), | 
|---|
| 597 | MPFROMSHORT(1)); | 
|---|
| 598 | } | 
|---|
| 599 | } | 
|---|
| 600 | else if(ffb.attrFile & FILE_DIRECTORY) {  /* check all parts and insert as required */ | 
|---|
| 601 |  | 
|---|
| 602 | CHAR    *p,temp; | 
|---|
| 603 | PCNRITEM pciParent = NULL,pciT; | 
|---|
| 604 |  | 
|---|
| 605 | p = strchr(filename[x],'\\'); | 
|---|
| 606 | if(p) { | 
|---|
| 607 | while(p && *p) { | 
|---|
| 608 | if(p < filename[x] + 3) | 
|---|
| 609 | p++; | 
|---|
| 610 | temp = *p; | 
|---|
| 611 | *p = 0; | 
|---|
| 612 | pciT = FindCnrRecord(hwndCnr, | 
|---|
| 613 | filename[x], | 
|---|
| 614 | NULL, | 
|---|
| 615 | partial, | 
|---|
| 616 | FALSE, | 
|---|
| 617 | TRUE); | 
|---|
| 618 | if(!pciT || (INT)pciT == -1) { | 
|---|
| 619 | pci = WinSendMsg(hwndCnr, | 
|---|
| 620 | CM_ALLOCRECORD, | 
|---|
| 621 | MPFROMLONG(EXTRA_RECORD_BYTES), | 
|---|
| 622 | MPFROMLONG(1L)); | 
|---|
| 623 | if(pci) { | 
|---|
| 624 |  | 
|---|
| 625 | RECORDINSERT ri; | 
|---|
| 626 | ULONG        totalbytes; | 
|---|
| 627 |  | 
|---|
| 628 | ret = TRUE; | 
|---|
| 629 | *ffb.achName = 0; | 
|---|
| 630 | totalbytes = FillInRecordFromFFB(hwndCnr, | 
|---|
| 631 | pci, | 
|---|
| 632 | filename[x], | 
|---|
| 633 | &ffb, | 
|---|
| 634 | partial, | 
|---|
| 635 | dcd); | 
|---|
| 636 | if(strlen(pci->szFileName) < 4) { | 
|---|
| 637 | *pci->szFileName = toupper(*pci->szFileName); | 
|---|
| 638 | if(isalpha(*pci->szFileName) && | 
|---|
| 639 | toupper(*pci->szFileName) > 'B') { | 
|---|
| 640 | if(driveflags[toupper(*pci->szFileName) - 'A'] & DRIVE_CDROM) | 
|---|
| 641 | pci->rc.hptrIcon = hptrCDROM; | 
|---|
| 642 | else | 
|---|
| 643 | pci->rc.hptrIcon = (driveflags[toupper(*pci->szFileName) - 'A'] & DRIVE_REMOVABLE) ? | 
|---|
| 644 | hptrRemovable : | 
|---|
| 645 | (driveflags[toupper(*pci->szFileName) - 'A'] & DRIVE_REMOTE) ? | 
|---|
| 646 | hptrRemote : | 
|---|
| 647 | (driveflags[toupper(*pci->szFileName) - 'A'] & DRIVE_ZIPSTREAM) ? | 
|---|
| 648 | hptrZipstrm : hptrDrive; | 
|---|
| 649 | } | 
|---|
| 650 | else | 
|---|
| 651 | pci->rc.hptrIcon = hptrFloppy; | 
|---|
| 652 | } | 
|---|
| 653 | memset(&ri,0,sizeof(RECORDINSERT)); | 
|---|
| 654 | ri.cb                 = sizeof(RECORDINSERT); | 
|---|
| 655 | ri.pRecordOrder       = (PRECORDCORE)CMA_END; | 
|---|
| 656 | ri.pRecordParent      = (PRECORDCORE)pciParent; | 
|---|
| 657 | ri.zOrder             = (USHORT)CMA_TOP; | 
|---|
| 658 | ri.cRecordsInsert     = 1L; | 
|---|
| 659 | ri.fInvalidateRecord  = FALSE; | 
|---|
| 660 | if(WinSendMsg(hwndCnr, | 
|---|
| 661 | CM_INSERTRECORD, | 
|---|
| 662 | MPFROMP(pci), | 
|---|
| 663 | MPFROMP(&ri))) { | 
|---|
| 664 | if(totalbytes != (ULONG)-1L && totalbytes) { | 
|---|
| 665 | numremain++; | 
|---|
| 666 | if(dcd->type == DIR_FRAME) | 
|---|
| 667 | dcd->totalbytes += totalbytes; | 
|---|
| 668 | } | 
|---|
| 669 | repos = TRUE; | 
|---|
| 670 | } | 
|---|
| 671 | else | 
|---|
| 672 | WinSendMsg(hwndCnr, | 
|---|
| 673 | CM_FREERECORD, | 
|---|
| 674 | MPFROMP(&pci), | 
|---|
| 675 | MPFROMSHORT(1)); | 
|---|
| 676 | } | 
|---|
| 677 | } | 
|---|
| 678 | else | 
|---|
| 679 | pciParent = pciT; | 
|---|
| 680 | *p = temp; | 
|---|
| 681 | p = strchr(p + ((temp == '\\') ? 1 : 0),'\\'); | 
|---|
| 682 | } | 
|---|
| 683 | } | 
|---|
| 684 | { | 
|---|
| 685 | pci = WinSendMsg(hwndCnr, | 
|---|
| 686 | CM_ALLOCRECORD, | 
|---|
| 687 | MPFROMLONG(EXTRA_RECORD_BYTES), | 
|---|
| 688 | MPFROMLONG(1L)); | 
|---|
| 689 | if(pci) { | 
|---|
| 690 |  | 
|---|
| 691 | RECORDINSERT ri; | 
|---|
| 692 | ULONG        totalbytes; | 
|---|
| 693 |  | 
|---|
| 694 | ret = TRUE; | 
|---|
| 695 | *ffb.achName = 0; | 
|---|
| 696 | totalbytes = FillInRecordFromFFB(hwndCnr, | 
|---|
| 697 | pci, | 
|---|
| 698 | filename[x], | 
|---|
| 699 | &ffb, | 
|---|
| 700 | partial, | 
|---|
| 701 | dcd); | 
|---|
| 702 | if(strlen(pci->szFileName) < 4) { | 
|---|
| 703 | *pci->szFileName = toupper(*pci->szFileName); | 
|---|
| 704 | if(isalpha(*pci->szFileName) && | 
|---|
| 705 | toupper(*pci->szFileName) > 'B') { | 
|---|
| 706 | if(driveflags[toupper(*pci->szFileName) - 'A'] & DRIVE_CDROM) | 
|---|
| 707 | pci->rc.hptrIcon = hptrCDROM; | 
|---|
| 708 | else | 
|---|
| 709 | pci->rc.hptrIcon = (driveflags[toupper(*pci->szFileName) - 'A'] & DRIVE_REMOVABLE) ? | 
|---|
| 710 | hptrRemovable : | 
|---|
| 711 | (driveflags[toupper(*pci->szFileName) - 'A'] & DRIVE_REMOTE) ? | 
|---|
| 712 | hptrRemote : | 
|---|
| 713 | (driveflags[toupper(*pci->szFileName) - 'A'] & DRIVE_ZIPSTREAM) ? | 
|---|
| 714 | hptrZipstrm : hptrDrive; | 
|---|
| 715 | } | 
|---|
| 716 | else | 
|---|
| 717 | pci->rc.hptrIcon = hptrFloppy; | 
|---|
| 718 | } | 
|---|
| 719 | memset(&ri,0,sizeof(RECORDINSERT)); | 
|---|
| 720 | ri.cb                 = sizeof(RECORDINSERT); | 
|---|
| 721 | ri.pRecordOrder       = (PRECORDCORE)CMA_END; | 
|---|
| 722 | ri.pRecordParent      = (PRECORDCORE)pciParent; | 
|---|
| 723 | ri.zOrder             = (USHORT)CMA_TOP; | 
|---|
| 724 | ri.cRecordsInsert     = 1L; | 
|---|
| 725 | ri.fInvalidateRecord  = FALSE; | 
|---|
| 726 | if(WinSendMsg(hwndCnr, | 
|---|
| 727 | CM_INSERTRECORD, | 
|---|
| 728 | MPFROMP(pci), | 
|---|
| 729 | MPFROMP(&ri))) { | 
|---|
| 730 | if(totalbytes != (ULONG)-1L && totalbytes) { | 
|---|
| 731 | numremain++; | 
|---|
| 732 | if(dcd->type == DIR_FRAME) | 
|---|
| 733 | dcd->totalbytes += totalbytes; | 
|---|
| 734 | } | 
|---|
| 735 | repos = TRUE; | 
|---|
| 736 | Stubby(hwndCnr,pci); | 
|---|
| 737 | } | 
|---|
| 738 | else | 
|---|
| 739 | WinSendMsg(hwndCnr, | 
|---|
| 740 | CM_FREERECORD, | 
|---|
| 741 | MPFROMP(&pci), | 
|---|
| 742 | MPFROMSHORT(1)); | 
|---|
| 743 | } | 
|---|
| 744 | } | 
|---|
| 745 | } | 
|---|
| 746 | } | 
|---|
| 747 | } | 
|---|
| 748 | else if((pci = FindCnrRecord(hwndCnr, | 
|---|
| 749 | filename[x], | 
|---|
| 750 | (PCNRITEM)NULL, | 
|---|
| 751 | partial, | 
|---|
| 752 | FALSE, | 
|---|
| 753 | TRUE)) !=  NULL && | 
|---|
| 754 | (INT)pci != -1 && !IsRoot(pci->szFileName)) { | 
|---|
| 755 | /* file doesn't exist; delete record */ | 
|---|
| 756 | if(pci->rc.flRecordAttr & CRA_SELECTED) | 
|---|
| 757 | WinSendMsg(hwndCnr, | 
|---|
| 758 | CM_SETRECORDEMPHASIS, | 
|---|
| 759 | MPFROMP(pci), | 
|---|
| 760 | MPFROM2SHORT(FALSE, | 
|---|
| 761 | CRA_SELECTED)); | 
|---|
| 762 | if(dcd->type == DIR_FRAME) | 
|---|
| 763 | dcd->totalbytes -= (pci->cbFile + pci->easize); | 
|---|
| 764 | if(WinSendMsg(hwndCnr, | 
|---|
| 765 | CM_REMOVERECORD, | 
|---|
| 766 | MPFROMP(&pci), | 
|---|
| 767 | MPFROM2SHORT(1, | 
|---|
| 768 | CMA_FREE | | 
|---|
| 769 | ((numremain == 1) ? | 
|---|
| 770 | CMA_INVALIDATE : 0)))) { | 
|---|
| 771 | numremain--; | 
|---|
| 772 | repos = TRUE; | 
|---|
| 773 | } | 
|---|
| 774 | } | 
|---|
| 775 | } | 
|---|
| 776 | if(repos || (pciList && numlist)) { | 
|---|
| 777 |  | 
|---|
| 778 | QUERYRECORDRECT qrr; | 
|---|
| 779 | RECTL           rCnr,rCItem; | 
|---|
| 780 |  | 
|---|
| 781 | pci = WinSendMsg(hwndCnr, | 
|---|
| 782 | CM_QUERYRECORDEMPHASIS, | 
|---|
| 783 | MPFROMLONG(CMA_FIRST), | 
|---|
| 784 | MPFROMLONG(CRA_CURSORED)); | 
|---|
| 785 | if(pci && (INT)pci != -1) { | 
|---|
| 786 | memset(&qrr, 0, sizeof(QUERYRECORDRECT)); | 
|---|
| 787 | qrr.cb = sizeof(QUERYRECORDRECT); | 
|---|
| 788 | qrr.pRecord = (PRECORDCORE) pci; | 
|---|
| 789 | qrr.fRightSplitWindow = FALSE; | 
|---|
| 790 | qrr.fsExtent = CMA_TEXT; | 
|---|
| 791 | if(!WinSendMsg(hwndCnr, | 
|---|
| 792 | CM_QUERYRECORDRECT, | 
|---|
| 793 | MPFROMP(&rCItem), | 
|---|
| 794 | MPFROMP(&qrr))) | 
|---|
| 795 | qrr.cb = 0; | 
|---|
| 796 | } | 
|---|
| 797 | if(pciList && numlist && !repos) | 
|---|
| 798 | WinSendMsg(hwndCnr, | 
|---|
| 799 | CM_INVALIDATERECORD, | 
|---|
| 800 | MPFROMP(pciList), | 
|---|
| 801 | MPFROM2SHORT(numlist,((repos) ? | 
|---|
| 802 | CMA_NOREPOSITION : | 
|---|
| 803 | CMA_REPOSITION | CMA_ERASE))); | 
|---|
| 804 | if(repos) | 
|---|
| 805 | WinSendMsg(hwndCnr, | 
|---|
| 806 | CM_INVALIDATERECORD, | 
|---|
| 807 | MPVOID, | 
|---|
| 808 | MPFROM2SHORT(0, | 
|---|
| 809 | CMA_ERASE | CMA_REPOSITION)); | 
|---|
| 810 | if(pci && (INT)pci != -1 && qrr.cb) { | 
|---|
| 811 | WinSendMsg(hwndCnr, | 
|---|
| 812 | CM_QUERYVIEWPORTRECT, | 
|---|
| 813 | MPFROMP(&rCnr), | 
|---|
| 814 | MPFROM2SHORT(CMA_WINDOW, | 
|---|
| 815 | (SHORT)FALSE)); | 
|---|
| 816 | WinSendMsg(hwndCnr, | 
|---|
| 817 | CM_SCROLLWINDOW, | 
|---|
| 818 | MPFROMSHORT(CMA_VERTICAL), | 
|---|
| 819 | MPFROMLONG(rCnr.yTop - rCItem.yTop)); | 
|---|
| 820 | } | 
|---|
| 821 | } | 
|---|
| 822 | PostMsg(hwndCnr, | 
|---|
| 823 | UM_RESCAN, | 
|---|
| 824 | MPVOID, | 
|---|
| 825 | MPVOID); | 
|---|
| 826 | if(pciList) { | 
|---|
| 827 | free(pciList); | 
|---|
| 828 | DosPostEventSem(CompactSem); | 
|---|
| 829 | } | 
|---|
| 830 | return ret; | 
|---|
| 831 | } | 
|---|
| 832 |  | 
|---|