Changeset 257 for trunk/src/helpers/dosh.c
- Timestamp:
- Jan 8, 2004, 5:43:29 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/helpers/dosh.c
r253 r257 2588 2588 *@@changed V0.9.16 (2001-12-18) [umoeller]: fixed error codes 2589 2589 *@@changed V1.0.1 (2003-01-10) [umoeller]: now allowing read for all modes 2590 *@@changed V1.0.2 (2003-11-13) [umoeller]: optimized; now calling doshQueryPathSize only on failure 2590 2591 */ 2591 2592 … … 2615 2616 // which isn't that meaningful 2616 2617 // V0.9.16 (2001-12-08) [umoeller] 2617 arc = doshQueryPathSize(pcszFilename, 2618 pcbFile); 2618 /* arc = doshQueryPathSize(pcszFilename, 2619 pcbFile); */ 2620 // moved this down V1.0.2 (2003-11-13) [umoeller] 2619 2621 break; 2620 2622 … … 2625 2627 | OPEN_ACCESS_READWRITE; 2626 2628 2627 arc = doshQueryPathSize(pcszFilename, 2628 pcbFile); 2629 /* arc = doshQueryPathSize(pcszFilename, 2630 pcbFile); */ 2631 // moved this down V1.0.2 (2003-11-13) [umoeller] 2629 2632 break; 2630 2633 … … 2646 2649 } 2647 2650 2648 if ((!arc) && fsOpenFlags && pcbFile && ppFile) 2651 if ( (!arc) 2652 && fsOpenFlags 2653 && pcbFile 2654 && ppFile 2655 ) 2649 2656 { 2650 2657 PXFILE pFile; … … 2695 2702 pFile->pszFilename = strdup(pcszFilename); 2696 2703 } 2697 #ifdef DEBUG_DOSOPEN2698 2704 else 2699 _Pmpf((__FUNCTION__ ": DosOpen returned %d for %s", 2705 { 2706 #ifdef DEBUG_DOSOPEN 2707 _Pmpf((__FUNCTION__ ": DosOpen returned %d for %s", 2700 2708 arc, pcszFilename)); 2701 #endif 2709 #endif 2710 2711 // open failed: if the file doesn't exist, DosOpen only 2712 // returns OPEN_FAILED, while ERROR_FILE_NOT_FOUND would 2713 // be a bit more informative 2714 // (this check used to be before DosOpen, but is a bit 2715 // excessive and should only be run if we really have no open) 2716 if (arc == ERROR_OPEN_FAILED) 2717 arc = doshQueryPathSize(pcszFilename, 2718 pcbFile); 2719 } 2702 2720 2703 2721 if (arc) … … 2750 2768 *@@added V0.9.13 (2001-06-14) [umoeller] 2751 2769 *@@changed V0.9.16 (2001-12-18) [umoeller]: now with XFILE, and always using FILE_BEGIN 2752 *@@chaanged V0.9.19 (2002-04-02) [umoeller]: added params checking 2770 *@@changed V0.9.19 (2002-04-02) [umoeller]: added params checking 2771 *@@changed V1.0.2 (2003-11-13) [umoeller]: optimized cache (using realloc) 2753 2772 */ 2754 2773 … … 2828 2847 #endif 2829 2848 2849 #if 0 2830 2850 // free old cache 2831 2851 if (pFile->pbCache) … … 2834 2854 // allocate new cache 2835 2855 if (!(pFile->pbCache = (PBYTE)malloc(pFile->cbCache))) 2856 #else 2857 // realloc is better V1.0.2 (2003-11-13) [umoeller] 2858 if (!(pFile->pbCache = (PBYTE)realloc(pFile->pbCache, 2859 pFile->cbCache))) 2860 #endif 2836 2861 arc = ERROR_NOT_ENOUGH_MEMORY; 2837 2862 else … … 4487 4512 4488 4513 /* 4514 *@@ doshMyParentPID: 4515 * returns the PID of the parent of the current process. 4516 * 4517 * This uses an interesting hack which is way 4518 * faster than DosGetInfoBlocks. 4519 * 4520 *@@added V1.0.2 (2003-11-13) [umoeller] 4521 */ 4522 4523 ULONG doshMyParentPID(VOID) 4524 { 4525 if (!G_pvLocalInfoSeg) 4526 // first call: 4527 GetInfoSegs(); 4528 4529 // parent PID is at offset 2 in the local info seg 4530 return *(PUSHORT)((PBYTE)G_pvLocalInfoSeg + 2); 4531 } 4532 4533 /* 4489 4534 *@@ doshMyTID: 4490 4535 * returns the TID of the current thread.
Note:
See TracChangeset
for help on using the changeset viewer.