[Bug 20466] Brothers in Arms: Hell's Highway crashes on startup (TLS slot index allocation must start at non-zero indexes)

wine-bugs at winehq.org wine-bugs at winehq.org
Mon Mar 17 03:11:45 CDT 2014


http://bugs.winehq.org/show_bug.cgi?id=20466

--- Comment #29 from Anastasius Focht <focht at gmx.net> ---
Hello Andrew,

you need to reserve TLS slot 0 right from the beginning to avoid any TLS alloc
stealing it (Wine builtins do that) before the game accesses it.

If you want to try it on your own there are some options.
For a one-liner hack, have a look here:

http://source.winehq.org/git/wine.git/blob/HEAD:/dlls/ntdll/thread.c#l205

--- snip ---
212 HANDLE thread_init(void)
213 {
...
255     RtlInitializeBitMap( &tls_bitmap, peb->TlsBitmapBits,
sizeof(peb->TlsBitmapBits) * 8 );
256     RtlInitializeBitMap( &tls_expansion_bitmap,
peb->TlsExpansionBitmapBits,
...
331     return exe_file;
332 }
--- snip ---

Insert the following code _after_ line 255 to reserve slot 0 internally:

--- snip ---
RtlSetBits( peb->TlsBitmap, 0, 1);
--- snip ---

Recompile Wine and check with the game.

Regards

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list