Changeset 1853 for trunk/src


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

TLS fix

Location:
trunk/src/kernel32
Files:
3 edited

Legend:

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

    r1713 r1853  
    1 /* $Id: Fileio.cpp,v 1.15 1999-11-12 14:57:12 sandervl Exp $ */
     1/* $Id: Fileio.cpp,v 1.16 1999-11-27 00:05:39 sandervl Exp $ */
    22
    33/*
     
    390390    dprintf(("KERNEL32:  GetFileAttributesW\n"));
    391391    astring = UnicodeToAsciiString((LPWSTR)arg1);
    392     rc = O32_GetFileAttributes(astring);
     392    rc = ODIN_GetFileAttributesA(astring);
    393393    FreeAsciiString(astring);
    394394    return(rc);
  • 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
  • trunk/src/kernel32/wintls.cpp

    r1670 r1853  
    1 /* $Id: wintls.cpp,v 1.6 1999-11-09 19:22:33 sandervl Exp $ */
     1/* $Id: wintls.cpp,v 1.7 1999-11-27 00:05:40 sandervl Exp $ */
    22/*
    33 * Win32 TLS API functions
     
    7272   dprintf(("tlsIndexAddr     %x", tlsIndexAddr));
    7373   dprintf(("tlsCallbackAddr  %x", tlsCallBackAddr));
    74    dprintf(("*tlsCallbackAddr %x", *tlsCallBackAddr));
     74   dprintf(("*tlsCallbackAddr %x", (tlsCallBackAddr) ? *tlsCallBackAddr : 0));
    7575   tibmem = (char *)VirtualAlloc(0, tlsTotalSize, MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE);
    7676   if(tibmem == NULL) {
     
    8686   *tlsIndexAddr = tlsIndex;
    8787
    88    if((ULONG)*tlsCallBackAddr != 0) {
     88   if(tlsCallBackAddr && (ULONG)*tlsCallBackAddr != 0) {
    8989        pCallback = tlsCallBackAddr;
    9090        while(*pCallback) {
     
    112112   dprintf(("Win32ImageBase::tlsDetachThread for module %x, thread id %x", hinstance, GetCurrentThreadId()));
    113113
    114    if((ULONG)*tlsCallBackAddr != 0) {
     114   if(tlsCallBackAddr && (ULONG)*tlsCallBackAddr != 0) {
    115115        pCallback = tlsCallBackAddr;
    116116        while(*pCallback) {
Note: See TracChangeset for help on using the changeset viewer.