Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
36203f1b
Commit
36203f1b
authored
Apr 19, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
include: Update the PEB and TEB structures.
According to Geoff Chappell's information.
parent
b7f6620c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
15 deletions
+15
-15
loader.c
dlls/ntdll/loader.c
+3
-3
rtl.c
dlls/ntdll/rtl.c
+3
-3
rtl.c
dlls/ntdll/tests/rtl.c
+4
-4
signal_x86_64.c
dlls/ntdll/unix/signal_x86_64.c
+1
-1
ntoskrnl.c
dlls/ntoskrnl.exe/ntoskrnl.c
+4
-4
winternl.h
include/winternl.h
+0
-0
No files found.
dlls/ntdll/loader.c
View file @
36203f1b
...
...
@@ -1268,7 +1268,7 @@ static BOOL alloc_tls_slot( LDR_DATA_TABLE_ENTRY *mod )
if
(
old
)
memcpy
(
new
,
old
,
tls_module_count
*
sizeof
(
*
new
)
);
teb
->
ThreadLocalStoragePointer
=
new
;
#ifdef __x86_64__
/* macOS-specific hack */
if
(
teb
->
Reserved5
[
0
])
((
TEB
*
)
teb
->
Reserved5
[
0
])
->
ThreadLocalStoragePointer
=
new
;
if
(
teb
->
Instrumentation
[
0
])
((
TEB
*
)
teb
->
Instrumentation
[
0
])
->
ThreadLocalStoragePointer
=
new
;
#endif
TRACE
(
"thread %04lx tls block %p -> %p
\n
"
,
HandleToULong
(
teb
->
ClientId
.
UniqueThread
),
old
,
new
);
/* FIXME: can't free old block here, should be freed at thread exit */
...
...
@@ -1520,8 +1520,8 @@ static NTSTATUS alloc_thread_tls(void)
}
NtCurrentTeb
()
->
ThreadLocalStoragePointer
=
pointers
;
#ifdef __x86_64__
/* macOS-specific hack */
if
(
NtCurrentTeb
()
->
Reserved5
[
0
])
((
TEB
*
)
NtCurrentTeb
()
->
Reserved5
[
0
])
->
ThreadLocalStoragePointer
=
pointers
;
if
(
NtCurrentTeb
()
->
Instrumentation
[
0
])
((
TEB
*
)
NtCurrentTeb
()
->
Instrumentation
[
0
])
->
ThreadLocalStoragePointer
=
pointers
;
#endif
return
STATUS_SUCCESS
;
}
...
...
dlls/ntdll/rtl.c
View file @
36203f1b
...
...
@@ -2072,9 +2072,9 @@ NTSTATUS WINAPI RtlSetThreadErrorMode( DWORD mode, LPDWORD oldmode )
return
STATUS_INVALID_PARAMETER_1
;
if
(
oldmode
)
*
oldmode
=
NtCurrentTeb
()
->
HardError
Disabled
;
*
oldmode
=
NtCurrentTeb
()
->
HardError
Mode
;
NtCurrentTeb
()
->
HardError
Disabled
=
mode
;
NtCurrentTeb
()
->
HardError
Mode
=
mode
;
return
STATUS_SUCCESS
;
}
...
...
@@ -2091,7 +2091,7 @@ NTSTATUS WINAPI RtlSetThreadErrorMode( DWORD mode, LPDWORD oldmode )
*/
DWORD
WINAPI
RtlGetThreadErrorMode
(
void
)
{
return
NtCurrentTeb
()
->
HardError
Disabled
;
return
NtCurrentTeb
()
->
HardError
Mode
;
}
/******************************************************************************
...
...
dlls/ntdll/tests/rtl.c
View file @
36203f1b
...
...
@@ -683,9 +683,9 @@ static void test_RtlThreadErrorMode(void)
"RtlGetThreadErrorMode returned 0x%lx, expected 0x%x
\n
"
,
mode
,
0x70
);
if
(
!
is_wow64
)
{
ok
(
NtCurrentTeb
()
->
HardError
Disabled
==
0x70
,
ok
(
NtCurrentTeb
()
->
HardError
Mode
==
0x70
,
"The TEB contains 0x%lx, expected 0x%x
\n
"
,
NtCurrentTeb
()
->
HardError
Disabled
,
0x70
);
NtCurrentTeb
()
->
HardError
Mode
,
0x70
);
}
status
=
pRtlSetThreadErrorMode
(
0
,
&
mode
);
...
...
@@ -699,9 +699,9 @@ static void test_RtlThreadErrorMode(void)
"RtlGetThreadErrorMode returned 0x%lx, expected 0x%x
\n
"
,
mode
,
0
);
if
(
!
is_wow64
)
{
ok
(
NtCurrentTeb
()
->
HardError
Disabled
==
0
,
ok
(
NtCurrentTeb
()
->
HardError
Mode
==
0
,
"The TEB contains 0x%lx, expected 0x%x
\n
"
,
NtCurrentTeb
()
->
HardError
Disabled
,
0
);
NtCurrentTeb
()
->
HardError
Mode
,
0
);
}
for
(
mode
=
1
;
mode
;
mode
<<=
1
)
...
...
dlls/ntdll/unix/signal_x86_64.c
View file @
36203f1b
...
...
@@ -2531,7 +2531,7 @@ void DECLSPEC_HIDDEN call_init_thunk( LPTHREAD_START_ROUTINE entry, void *arg, B
/* alloc_tls_slot() needs to poke a value to an address relative to each
thread's gsbase. Have each thread record its gsbase pointer into its
TEB so alloc_tls_slot() can find it. */
teb
->
Reserved5
[
0
]
=
amd64_thread_data
()
->
pthread_teb
;
teb
->
Instrumentation
[
0
]
=
amd64_thread_data
()
->
pthread_teb
;
#else
# error Please define setting %gs for your architecture
#endif
...
...
dlls/ntoskrnl.exe/ntoskrnl.c
View file @
36203f1b
...
...
@@ -944,7 +944,7 @@ NTSTATUS CDECL wine_ntoskrnl_main_loop( HANDLE stop_event )
for
(;;)
{
NtCurrentTeb
()
->
Reserved5
[
1
]
=
NULL
;
NtCurrentTeb
()
->
Instrumentation
[
1
]
=
NULL
;
if
(
!
context
.
in_buff
&&
!
(
context
.
in_buff
=
HeapAlloc
(
GetProcessHeap
(),
0
,
context
.
in_size
)))
{
ERR
(
"failed to allocate buffer
\n
"
);
...
...
@@ -995,7 +995,7 @@ NTSTATUS CDECL wine_ntoskrnl_main_loop( HANDLE stop_event )
context
.
params
=
reply
->
params
;
context
.
in_size
=
reply
->
in_size
;
client_tid
=
reply
->
client_tid
;
NtCurrentTeb
()
->
Reserved5
[
1
]
=
wine_server_get_ptr
(
reply
->
client_thread
);
NtCurrentTeb
()
->
Instrumentation
[
1
]
=
wine_server_get_ptr
(
reply
->
client_thread
);
}
else
{
...
...
@@ -2527,7 +2527,7 @@ POBJECT_TYPE PsThreadType = &thread_type;
*/
PRKTHREAD
WINAPI
KeGetCurrentThread
(
void
)
{
struct
_KTHREAD
*
thread
=
NtCurrentTeb
()
->
Reserved5
[
1
];
struct
_KTHREAD
*
thread
=
NtCurrentTeb
()
->
Instrumentation
[
1
];
if
(
!
thread
)
{
...
...
@@ -2540,7 +2540,7 @@ PRKTHREAD WINAPI KeGetCurrentThread(void)
kernel_object_from_handle
(
handle
,
PsThreadType
,
(
void
**
)
&
thread
);
if
(
handle
!=
GetCurrentThread
())
NtClose
(
handle
);
NtCurrentTeb
()
->
Reserved5
[
1
]
=
thread
;
NtCurrentTeb
()
->
Instrumentation
[
1
]
=
thread
;
}
return
thread
;
...
...
include/winternl.h
View file @
36203f1b
This diff is collapsed.
Click to expand it.
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