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.

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.