[Issue 3342] TLS on dynamically loaded DLLs fails on Windows earlier than Vista

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Mar 10 01:32:30 PST 2010


http://d.puremagic.com/issues/show_bug.cgi?id=3342



--- Comment #4 from Rainer Schuetze <r.sagitario at gmx.de> 2010-03-10 01:32:28 PST ---
There is a detection whether _tls_index is set and the tls-data-array contains
a valid pointer (thinking about it the latter might be flawed), so this should
cover any situation where the OS did not setup TLS correctly (when loaded at
process init time, TLS is correct on XP, too).

Do you think, that an explicite version check is better? What about
applications that are configured to pretend running under a different windows
version?

As much as I can see, the referenced code contains two things not in the patch:

- it keeps track of used tls-indexes in a bitmap, but XP does not have this.
That's why the patch prevents unloading of the DLL.
- it uses ExReleaseRundownProtection before accessing some TEB data, but this
seems to be an (undocumented) kernel function, and I think we should be safe
with our operations as the nt-loader holds a lock that disallows reentrence
into DllMain

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list