Changeset 21457 for trunk/src


Ignore:
Timestamp:
Sep 23, 2010, 11:51:19 PM (15 years ago)
Author:
ydario
Message:

In low mem situations, DosAllocMem() can fail while new() can still work, check for a valid TEB structure also.

Location:
trunk/src/kernel32
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/hmthread.cpp

    r21302 r21457  
    8888
    8989    if(winthread == 0) {
     90        dprintf(("Win32Thread creation failed, no more memory"));
    9091        DebugInt3();
    9192        SetLastError(ERROR_NOT_ENOUGH_MEMORY);
    9293        return(0);
    9394    }
     95    if(winthread->_GetTEB() == 0) {
     96        dprintf(("Win32Thread->teb creation failed, no more memory"));
     97        DebugInt3();
     98        SetLastError(ERROR_NOT_ENOUGH_MEMORY);
     99        return(0);
     100    }
     101
    94102    // @@@PH Note: with debug code enabled, ODIN might request more stack space!
    95103    //SvL: Also need more stack in release build (RealPlayer 7 sometimes runs
  • trunk/src/kernel32/thread.H

    r8648 r21457  
    2121
    2222    PTHREAD_START_ROUTINE_O32 GetOS2Callback()  { return Win32ThreadProc; };
     23    /* this is to be privately used by hmthread.cpp only */
     24    LPVOID _GetTEB()  { return teb; };
    2325
    2426private:
Note: See TracChangeset for help on using the changeset viewer.