Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
0a45ada0
Commit
0a45ada0
authored
Nov 22, 1998
by
Marcus Meissner
Committed by
Alexandre Julliard
Nov 22, 1998
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not relocate the pointers in the IMAGE_THREAD_LOCAL_STORAGE
directory, for they seem to be relocated by the standard relocating mechanism. (Explicitly checked one program using it)
parent
e1ab22da
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 deletions
+13
-11
pe_image.c
loader/pe_image.c
+13
-11
No files found.
loader/pe_image.c
View file @
0a45ada0
...
...
@@ -939,6 +939,13 @@ void PE_InitDLL(WINE_MODREF *wm, DWORD type, LPVOID lpReserved)
}
}
/************************************************************************
* PE_InitTls (internal)
*
* If included, initialises the thread local storages of modules.
* Pointers in those structs are not RVAs but real pointers which have been
* relocated by do_relocations() already.
*/
void
PE_InitTls
(
THDB
*
thdb
)
{
WINE_MODREF
*
wm
;
...
...
@@ -958,33 +965,28 @@ void PE_InitTls(THDB *thdb)
delta
=
wm
->
module
-
peh
->
OptionalHeader
.
ImageBase
;
if
(
!
peh
->
OptionalHeader
.
DataDirectory
[
IMAGE_FILE_THREAD_LOCAL_STORAGE
].
VirtualAddress
)
continue
;
FIXME
(
win32
,
"%s has TLS directory.
\n
"
,
wm
->
longname
);
pdir
=
(
LPVOID
)(
wm
->
module
+
peh
->
OptionalHeader
.
DataDirectory
[
IMAGE_FILE_THREAD_LOCAL_STORAGE
].
VirtualAddress
);
if
(
!
(
pem
->
flags
&
PE_MODREF_TLS_ALLOCED
))
{
pem
->
tlsindex
=
THREAD_TlsAlloc
(
thdb
);
*
(
LPDWORD
)
AdjustPtr
(
pdir
->
AddressOfIndex
,
delta
)
=
pem
->
tlsindex
;
*
pdir
->
AddressOfIndex
=
pem
->
tlsindex
;
}
pem
->
flags
|=
PE_MODREF_TLS_ALLOCED
;
datasize
=
pdir
->
EndAddressOfRawData
-
pdir
->
StartAddressOfRawData
;
size
=
datasize
+
pdir
->
SizeOfZeroFill
;
mem
=
VirtualAlloc
(
0
,
size
,
MEM_RESERVE
|
MEM_COMMIT
,
PAGE_READWRITE
);
memcpy
(
mem
,
AdjustPtr
(
pdir
->
StartAddressOfRawData
,
delta
),
datasize
);
/* don't use TlsSetValue, we are in the wrong thread */
memcpy
(
mem
,(
LPVOID
)
pdir
->
StartAddressOfRawData
,
datasize
);
if
(
pdir
->
AddressOfCallBacks
)
{
PIMAGE_TLS_CALLBACK
*
cbs
=
(
PIMAGE_TLS_CALLBACK
*
)
AdjustPtr
(
pdir
->
AddressOfCallBacks
,
delta
);
(
PIMAGE_TLS_CALLBACK
*
)
pdir
->
AddressOfCallBacks
;
if
(
*
cbs
)
{
if
(
*
cbs
)
FIXME
(
win32
,
"TLS Callbacks aren't going to be called
\n
"
);
}
}
/* Don't use TlsSetValue, we are in the wrong thread */
thdb
->
tls_array
[
pem
->
tlsindex
]
=
mem
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment