Ignore:
Timestamp:
Nov 27, 1999, 1:05:40 AM (26 years ago)
Author:
sandervl
Message:

TLS fix

File:
1 edited

Legend:

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

    r1844 r1853  
    1 /* $Id: winimagepeldr.cpp,v 1.17 1999-11-26 00:05:19 sandervl Exp $ */
     1/* $Id: winimagepeldr.cpp,v 1.18 1999-11-27 00:05:39 sandervl Exp $ */
    22
    33/*
     
    451451        setTLSIndexAddr((LPDWORD)(sect->realvirtaddr + ((ULONG)tlsDir->AddressOfIndex - sect->virtaddr)));
    452452
    453         sect = findSectionByAddr((ULONG)tlsDir->AddressOfCallBacks);
    454         if(sect == NULL) {
    455                 fout << "Couldn't find TLS AddressOfCallBacks section!!" << endl;
    456                 goto failure;
    457         }
    458         setTLSCallBackAddr((PIMAGE_TLS_CALLBACK *)(sect->realvirtaddr + ((ULONG)tlsDir->AddressOfCallBacks - sect->virtaddr)));
     453        if((ULONG)tlsDir->AddressOfCallBacks != 0) {
     454                sect = findSectionByAddr((ULONG)tlsDir->AddressOfCallBacks);
     455                if(sect == NULL) {
     456                        fout << "Couldn't find TLS AddressOfCallBacks section!!" << endl;
     457                        goto failure;
     458                }
     459                setTLSCallBackAddr((PIMAGE_TLS_CALLBACK *)(sect->realvirtaddr + ((ULONG)tlsDir->AddressOfCallBacks - sect->virtaddr)));
     460        }
    459461   }
    460462
Note: See TracChangeset for help on using the changeset viewer.