Changeset 140 for trunk/src/helpers
- Timestamp:
- Feb 9, 2002, 6:48:12 PM (24 years ago)
- Location:
- trunk/src/helpers
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/helpers/apps.c
r133 r140 1250 1250 ProgDetails.pszParameters = strParamsPatched.psz; 1251 1251 1252 _Pmpf((__FUNCTION__ ": progt.progc: %d", ProgDetails.progt.progc));1252 /* _Pmpf((__FUNCTION__ ": progt.progc: %d", ProgDetails.progt.progc)); 1253 1253 _Pmpf((" progt.fbVisible: 0x%lX", ProgDetails.progt.fbVisible)); 1254 1254 _Pmpf((" progt.pszTitle: \"%s\"", (ProgDetails.pszTitle) ? ProgDetails.pszTitle : "NULL")); … … 1257 1257 _Pmpf((" startup: \"%s\"", (ProgDetails.pszStartupDir) ? ProgDetails.pszStartupDir : "NULL")); 1258 1258 _Pmpf((" pszIcon: \"%s\"", (ProgDetails.pszIcon) ? ProgDetails.pszIcon : "NULL")); 1259 /*_Pmpf((" environment: "));1259 _Pmpf((" environment: ")); 1260 1260 { 1261 1261 PSZ pszThis = ProgDetails.pszEnvironment; … … 1268 1268 */ 1269 1269 1270 _Pmpf((" swpInitial.fl = 0x%lX, x = %d, y = %d, cx = %d, cy = %d:",1270 /* _Pmpf((" swpInitial.fl = 0x%lX, x = %d, y = %d, cx = %d, cy = %d:", 1271 1271 ProgDetails.swpInitial.fl, 1272 1272 ProgDetails.swpInitial.x, … … 1279 1279 ProgDetails.swpInitial.ulReserved1, 1280 1280 ProgDetails.swpInitial.ulReserved2)); 1281 */ 1281 1282 1282 1283 if (pszFailingName) … … 1308 1309 { 1309 1310 // cannot start app: 1310 _Pmpf((__FUNCTION__ ": WinStartApp failed"));1311 // _Pmpf((__FUNCTION__ ": WinStartApp failed")); 1311 1312 arc = ERROR_FILE_NOT_FOUND; 1312 1313 // unfortunately WinStartApp doesn't … … 1405 1406 } // end if (ProgDetails.pszExecutable) 1406 1407 1407 _Pmpf((__FUNCTION__ ": returning %d", arc));1408 // _Pmpf((__FUNCTION__ ": returning %d", arc)); 1408 1409 1409 1410 return (arc); -
trunk/src/helpers/exeh.c
r132 r140 2490 2490 if (ulObjPageTblIndexThis - 1 >= pExec->pLXHeader->ulPageCount) 2491 2491 { 2492 _Pmpf(("ulObjPageTblIndexThis %d is too large", ulObjPageTblIndexThis));2492 // _Pmpf(("ulObjPageTblIndexThis %d is too large", ulObjPageTblIndexThis)); 2493 2493 return ERROR_INVALID_SEGMENT_NUMBER; // 180 2494 2494 } … … 2535 2535 ulOffset += ulExeOffset; 2536 2536 2537 _Pmpf((" reading pgtbl %d, ofs %d, type %s",2537 /* _Pmpf((" reading pgtbl %d, ofs %d, type %s", 2538 2538 ulObjPageTblIndex, 2539 2539 ulOffset, 2540 2540 (ulFlags == 0x0001) ? "ITERDATA" 2541 2541 : (ulFlags == 0x0005) ? "ITERDATA2" 2542 : "uncompressed")); 2542 : "uncompressed")); */ 2543 2543 2544 2544 if (ulSize > ulPageSize) … … 2551 2551 0))) 2552 2552 { 2553 _Pmpf((" %d bytes read", ulSize));2553 // _Pmpf((" %d bytes read", ulSize)); 2554 2554 2555 2555 // terminate buffer for decompress … … 2644 2644 *ppbResData = 0; 2645 2645 2646 _Pmpf((__FUNCTION__ " %s: ulType = %d, idResource %d",2646 /* _Pmpf((__FUNCTION__ " %s: ulType = %d, idResource %d", 2647 2647 pExec->pFile->pszFilename, 2648 ulType, idResource)); 2648 ulType, idResource)); */ 2649 2649 2650 2650 if (!(pLXHeader = pExec->pLXHeader)) … … 2693 2693 if (pRsEntry->obj - 1 >= pLXHeader->ulObjCount) 2694 2694 { 2695 _Pmpf(("pRsEntry->obj %d is too large", pRsEntry->obj));2695 // _Pmpf(("pRsEntry->obj %d is too large", pRsEntry->obj)); 2696 2696 arc = ERROR_INVALID_SEGMENT_NUMBER; // 180 2697 2697 } … … 2756 2756 ulPageThis; 2757 2757 2758 _Pmpf((" found RT_POINTER %d, size %d, resofs %d",2758 /* _Pmpf((" found RT_POINTER %d, size %d, resofs %d", 2759 2759 pRsEntry->name, 2760 2760 pRsEntry->cb, 2761 2761 pRsEntry->offset)); 2762 2762 _Pmpf((" ulFirstPage %d, ulResOffsetInFirstPage %d, cPages %d", 2763 ulFirstPage, ulResOffsetInFirstPage, cPages)); 2763 ulFirstPage, ulResOffsetInFirstPage, cPages)); */ 2764 2764 2765 2765 ulPageThis = ulObjPageTblIndex + ulFirstPage; … … 2826 2826 } 2827 2827 2828 _Pmpf((__FUNCTION__ ": returning %d", arc));2828 // _Pmpf((__FUNCTION__ ": returning %d", arc)); 2829 2829 2830 2830 return (arc); … … 3011 3011 ulNewHeaderOfs = pExec->pDosExeHeader->ulNewHeaderOfs; 3012 3012 3013 _Pmpf((__FUNCTION__ ": entering, checking %d resources", pNEHeader->usResSegmCount));3013 // _Pmpf((__FUNCTION__ ": entering, checking %d resources", pNEHeader->usResSegmCount)); 3014 3014 3015 3015 if (!(cResources = pNEHeader->usResSegmCount)) … … 3080 3080 arc = ERROR_NO_DATA; 3081 3081 } 3082 else3083 _Pmpf(("exehLoadOS2NEMaps returned %d"));3082 // else 3083 // _Pmpf(("exehLoadOS2NEMaps returned %d")); 3084 3084 3085 3085 return (arc); -
trunk/src/helpers/gpih.c
r135 r140 1526 1526 bih2.cPlanes = (cPlanes) ? cPlanes : alData[0]; 1527 1527 bih2.cBitCount = (cBitCount) ? cBitCount : alData[1]; 1528 _Pmpf((__FUNCTION__ ": cPlanes %d, cBitCount %d",1529 bih2.cPlanes, bih2.cBitCount));1528 // _Pmpf((__FUNCTION__ ": cPlanes %d, cBitCount %d", 1529 // bih2.cPlanes, bih2.cBitCount)); 1530 1530 bih2.ulCompression = BCA_UNCOMP; 1531 1531 bih2.cbImage = ( ( (bih2.cx -
trunk/src/helpers/stringh.c
r132 r140 81 81 PCSZ pcszSource, 82 82 PULONG pulLength, // out: length of new string (ptr can be NULL) 83 const char *pcszSourceFile,83 PCSZ pcszSourceFile, 84 84 unsigned long ulLine, 85 const char *pcszFunction)85 PCSZ pcszFunction) 86 86 { 87 87 ULONG ulLength = 0; … … 169 169 */ 170 170 171 PSZ strhcpy(PSZ string1, const char *string2)171 PSZ strhcpy(PSZ string1, PCSZ string2) 172 172 { 173 173 if (string2) … … 187 187 */ 188 188 189 PSZ strhdupDebug( const char *pcszSource,189 PSZ strhdupDebug(PCSZ pcszSource, 190 190 unsigned long *pulLength, 191 const char *pcszSourceFile,191 PCSZ pcszSourceFile, 192 192 unsigned long ulLine, 193 const char *pcszFunction)193 PCSZ pcszFunction) 194 194 { 195 195 PSZ pszReturn = NULL; … … 225 225 */ 226 226 227 PSZ strhdup( const char *pcszSource,227 PSZ strhdup(PCSZ pcszSource, 228 228 unsigned long *pulLength) // out: length of string excl. null terminator (ptr can be NULL) 229 229 { … … 259 259 */ 260 260 261 int strhcmp( const char *p1, const char *p2)261 int strhcmp(PCSZ p1, PCSZ p2) 262 262 { 263 263 if (p1 && p2) … … 286 286 */ 287 287 288 int strhicmp( const char *p1, const char *p2)288 int strhicmp(PCSZ p1, PCSZ p2) 289 289 { 290 290 if (p1 && p2) … … 312 312 */ 313 313 314 PSZ strhistr( const char *string1, const char *string2)314 PSZ strhistr(PCSZ string1, PCSZ string2) 315 315 { 316 316 PSZ prc = NULL; … … 352 352 353 353 ULONG strhncpy0(PSZ pszTarget, 354 const char *pszSource,354 PCSZ pszSource, 355 355 ULONG cbSource) 356 356 { … … 378 378 */ 379 379 380 ULONG strhCount( const char *pszSearch,380 ULONG strhCount(PCSZ pszSearch, 381 381 CHAR c) 382 382 { … … 424 424 */ 425 425 426 PSZ strhSubstrDebug( const char *pBegin, // in: first char427 const char *pEnd, // in: last char (not included)428 const char *pcszSourceFile,426 PSZ strhSubstrDebug(PCSZ pBegin, // in: first char 427 PCSZ pEnd, // in: last char (not included) 428 PCSZ pcszSourceFile, 429 429 unsigned long ulLine, 430 const char *pcszFunction)430 PCSZ pcszFunction) 431 431 { 432 432 PSZ pszSubstr = NULL; … … 469 469 */ 470 470 471 PSZ strhSubstr( const char *pBegin, // in: first char472 const char *pEnd) // in: last char (not included)471 PSZ strhSubstr(PCSZ pBegin, // in: first char 472 PCSZ pEnd) // in: last char (not included) 473 473 { 474 474 PSZ pszSubstr = NULL; … … 671 671 */ 672 672 673 PSZ strhins( const char *pcszBuffer,673 PSZ strhins(PCSZ pcszBuffer, 674 674 ULONG ulInsertOfs, 675 const char *pcszInsert)675 PCSZ pcszInsert) 676 676 { 677 677 PSZ pszNew = NULL; … … 723 723 PULONG pulOfs, // in: where to begin search (0 = start); 724 724 // out: ofs of first char after replacement string 725 const char *pcszSearch, // in: search string; cannot be NULL726 const char *pcszReplace) // in: replacement string; cannot be NULL725 PCSZ pcszSearch, // in: search string; cannot be NULL 726 PCSZ pcszReplace) // in: replacement string; cannot be NULL 727 727 { 728 728 ULONG ulrc = 0; … … 797 797 BOOL strhGetWord(PSZ *ppszStart, // in: start of search, 798 798 // out: start of word (if TRUE is returned) 799 const char *pLimit, // in: ptr to last char after *ppszStart to be799 PCSZ pLimit, // in: ptr to last char after *ppszStart to be 800 800 // searched; if the word does not end before 801 801 // or with this char, FALSE is returned 802 const char *pcszBeginChars, // stringh.h defines STRH_BEGIN_CHARS803 const char *pcszEndChars, // stringh.h defines STRH_END_CHARS802 PCSZ pcszBeginChars, // stringh.h defines STRH_BEGIN_CHARS 803 PCSZ pcszEndChars, // stringh.h defines STRH_END_CHARS 804 804 PSZ *ppszEnd) // out: first char _after_ word 805 805 // (if TRUE is returned) 806 806 { 807 807 // characters after which a word can be started 808 // const char *pcszBeginChars = "\x0d\x0a ";809 // const char *pcszEndChars = "\x0d\x0a /-";808 // PCSZ pcszBeginChars = "\x0d\x0a "; 809 // PCSZ pcszEndChars = "\x0d\x0a /-"; 810 810 811 811 PSZ pStart = *ppszStart; … … 855 855 */ 856 856 857 BOOL strhIsWord( const char *pcszBuf,858 const char *p, // in: start of word857 BOOL strhIsWord(PCSZ pcszBuf, 858 PCSZ p, // in: start of word 859 859 ULONG cbSearch, // in: length of word 860 const char *pcszBeginChars, // suggestion: "\x0d\x0a ()/\\-,."861 const char *pcszEndChars) // suggestion: "\x0d\x0a ()/\\-,.:;"860 PCSZ pcszBeginChars, // suggestion: "\x0d\x0a ()/\\-,." 861 PCSZ pcszEndChars) // suggestion: "\x0d\x0a ()/\\-,.:;" 862 862 { 863 863 BOOL fEndOK = FALSE; … … 915 915 */ 916 916 917 PSZ strhFindWord( const char *pszBuf,918 const char *pszSearch,919 const char *pcszBeginChars, // suggestion: "\x0d\x0a ()/\\-,."920 const char *pcszEndChars) // suggestion: "\x0d\x0a ()/\\-,.:;"917 PSZ strhFindWord(PCSZ pszBuf, 918 PCSZ pszSearch, 919 PCSZ pcszBeginChars, // suggestion: "\x0d\x0a ()/\\-,." 920 PCSZ pcszEndChars) // suggestion: "\x0d\x0a ()/\\-,.:;" 921 921 { 922 922 PSZ pszReturn = 0; … … 926 926 if ((cbBuf) && (cbSearch)) 927 927 { 928 const char *p = pszBuf;928 PCSZ p = pszBuf; 929 929 930 930 do // while p … … 966 966 */ 967 967 968 PSZ strhFindEOL( const char *pcszSearchIn, // in: where to search968 PSZ strhFindEOL(PCSZ pcszSearchIn, // in: where to search 969 969 PULONG pulOffset) // out: offset (ptr can be NULL) 970 970 { 971 const char *p = pcszSearchIn,972 *prc = 0;971 PCSZ p = pcszSearchIn, 972 prc = 0; 973 973 while (TRUE) 974 974 { -
trunk/src/helpers/wphandle.c
r129 r140 260 260 /* 261 261 *@@ wphRebuildNodeHashTable: 262 * builds all the complex cache trees in the 263 * given handles buffer. 264 * 265 * If (fQuitOnErrors == TRUE), we'll fail as 266 * soon as an invalid handle is found. Otherwise 267 * we will try to continue if the error is not fatal. 262 268 * 263 269 * Returns: … … 269 275 * -- ERROR_WPH_CORRUPT_HANDLES_DATA 270 276 * 277 * -- ERROR_WPH_DRIV_TREEINSERT_FAILED: duplicate DRIV node 278 * (non-fatal) 279 * 271 280 *@@added V0.9.16 (2001-10-02) [umoeller] 272 */ 273 274 APIRET wphRebuildNodeHashTable(HHANDLES hHandles) 281 *@@changted V0.9.17 (2002-02-05) [umoeller]: added fQuitOnErrors 282 */ 283 284 APIRET wphRebuildNodeHashTable(HHANDLES hHandles, 285 BOOL fQuitOnErrors) 275 286 { 276 287 APIRET arc = NO_ERROR; … … 322 333 (TREE*)pLastDriveTreeNode, 323 334 treeCompareStrings)) 324 arc = ERROR_WPH_DRIV_TREEINSERT_FAILED; 335 if (fQuitOnErrors) 336 arc = ERROR_WPH_DRIV_TREEINSERT_FAILED; 325 337 } 326 338 … … 355 367 PNODETREENODE pParent; 356 368 if (!(pParent = pHandlesBuf->NodeHashTable[pNode->usParentHandle])) 369 { 357 370 // this parent handle is invalid: 358 arc = ERROR_WPH_INVALID_PARENT_HANDLE; 371 if (fQuitOnErrors) 372 arc = ERROR_WPH_INVALID_PARENT_HANDLE; 373 } 359 374 else 360 375 { … … 372 387 } 373 388 else 374 arc = ERROR_WPH_NODE_BEFORE_DRIV; 375 376 if (!arc) 389 if (fQuitOnErrors) 390 arc = ERROR_WPH_NODE_BEFORE_DRIV; 391 392 if (ppTree && pcChildren) 377 393 if (!treeInsert(ppTree, 378 394 pcChildren, 379 395 (TREE*)pNew, 380 396 treeCompareStrings)) 397 { 381 398 // store PNODE in hash table 382 399 pHandlesBuf->NodeHashTable[pNode->usHandle] = pNew; 400 // do not free 401 pNew = NULL; 402 } 383 403 else 384 404 ; … … 387 407 // arc = ERROR_WPH_NODE_TREEINSERT_FAILED; 388 408 389 if ( arc)409 if (pNew) 390 410 free(pNew); 391 411 … … 641 661 // rebuild cache 642 662 if (!pHandlesBuf->fCacheValid) 643 arc = wphRebuildNodeHashTable(hHandles); 663 arc = wphRebuildNodeHashTable(hHandles, 664 TRUE); // fail on errors 644 665 645 666 if (!arc) … … 922 943 { 923 944 if (!pHandlesBuf->fCacheValid) 924 arc = wphRebuildNodeHashTable(hHandles); 945 arc = wphRebuildNodeHashTable(hHandles, 946 TRUE); // fail on errors 925 947 926 948 if (!arc)
Note:
See TracChangeset
for help on using the changeset viewer.