Changeset 1750 for trunk/dll/avv.c
- Timestamp:
- Mar 1, 2014, 2:55:57 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/avv.c
r1746 r1750 34 34 24 Feb 14 JBS Ticket #517: Replaced a call to DosQueryAppType to a call to the wrapped xDosQueryApptType 35 35 24 Feb 14 JBS Ticket #523: Stop considering missing "list", "create" or "extract" commands as errors 36 01 Mar 14 JBS Ticket #524: Made "searchapath" thread-safe. Function names and signatures were changed. 37 So calls to these functions had to be changed and checkfile's signature was changed. 36 38 37 39 ***********************************************************************/ … … 64 66 #include "strips.h" // bstrip 65 67 #include "misc.h" // CheckDriveSpaceAvail 66 #include "srchpath.h" // searchpath68 #include "srchpath.h" // Search*Path*ForFile 67 69 #include "systemf.h" // runemf2 68 70 #include "fortify.h" … … 73 75 static PSZ pszSrcFile = __FILE__; 74 76 75 static PSZ checkfile(PSZ file, INT * error);77 static ULONG checkfile(PSZ file); 76 78 static BOOL check_archiver(HWND hwnd, ARC_TYPE * info); 77 79 static INT get_int_from_window(HWND hwnd, USHORT id); … … 393 395 } 394 396 395 static PSZ checkfile(PSZ file, INT * error) 396 { 397 CHAR *p, *pp = NULL; 398 INT ret; 397 /** 398 * checkfile: Determine if a program is reachable and of an acceptable type. 399 * 400 * @param pFilename: the name of a program file to check (input) 401 * 402 * @return 0 if the program reachable and of an acceptable type 403 * 1 if the program is unreachable (or pFilename is invalid) 404 * 2 if the program is of an unacceptable type 405 * 3 if pFilename is null or points to a null string 406 * 407 */ 408 static ULONG checkfile(PSZ file) 409 { 410 CHAR szFullFilename[CCHMAXPATH], *pp = NULL; 411 ULONG ret; 399 412 ULONG apptype; 400 413 401 414 if (!file || !*file) { 402 *error = 3; 403 return NULL; 415 return 3; 404 416 } 405 417 pp = strchr(file, ' '); 406 418 if (pp) 407 419 *pp = 0; 408 p = searchpath(file);409 if (!p || !*p)410 *error = 1;420 if (SearchPathForFile(PCSZ_PATH, file, szFullFilename)) { 421 ret = 1; 422 } 411 423 else { 412 ret = (INT) xDosQueryAppType(p, &apptype);424 ret = xDosQueryAppType(szFullFilename, &apptype); 413 425 apptype &= (~FAPPTYP_32BIT); 414 426 if (!apptype || … … 417 429 (apptype & FAPPTYP_BOUND) || 418 430 (apptype & FAPPTYP_WINDOWAPI) || (apptype & FAPPTYP_DOS)) { 419 *error= 0;431 ret = 0; 420 432 } 421 433 else 422 *error= 2;434 ret = 2; 423 435 } 424 436 if (pp) 425 437 *pp = ' '; 426 return p;438 return ret; 427 439 } 428 440 … … 444 456 badPos = TRUE; 445 457 if (info->list) 446 checkfile(info->list, &badList);458 badList = checkfile(info->list); 447 459 if (info->create) 448 checkfile(info->create, &badCreate);460 badCreate = checkfile(info->create); 449 461 if (info->extract) 450 checkfile(info->extract, &badExtract);462 badExtract = checkfile(info->extract); 451 463 if (!noStart && !noEnd && !badPos && !badList && !badCreate && !badExtract) 452 464 return TRUE; // OK … … 927 939 MBID_YES) { 928 940 929 PSZ ab2;930 931 ab2 = searchpath(PCSZ_ARCHIVERBB2); // Rewrite without alerting932 rewrite_archiverbb2(a b2);941 // PSZ ab2; 942 943 // ab2 = searchpath(PCSZ_ARCHIVERBB2); // Rewrite without alerting 944 rewrite_archiverbb2(archiverbb2); // jbs: Re-use path set by load_archivers 933 945 } 934 946 }
Note:
See TracChangeset
for help on using the changeset viewer.