Commit a19862fc authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

Small hack to check if we need to relocate the TLS directory or not

(some seem to need this pointer relocateable, some already do relocate it by themselves).
parent 96075121
......@@ -1056,7 +1056,12 @@ void PE_InitTls( void )
if ( pem->tlsindex == -1 ) {
pem->tlsindex = TlsAlloc();
*pdir->AddressOfIndex=pem->tlsindex;
if ((((DWORD)pdir->AddressOfIndex)>peh->OptionalHeader.ImageBase)
&&(((DWORD)pdir->AddressOfIndex)<peh->OptionalHeader.ImageBase+peh->OptionalHeader.SizeOfImage)
)
*pdir->AddressOfIndex=pem->tlsindex;
else
*(LPDWORD)((((char*)pdir->AddressOfIndex)+delta))=pem->tlsindex;
}
datasize= pdir->EndAddressOfRawData-pdir->StartAddressOfRawData;
size = datasize + pdir->SizeOfZeroFill;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment