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
a31f3374
Commit
a31f3374
authored
Feb 21, 2022
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Add a global variable for the WoW PEB.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0d092685
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
23 deletions
+26
-23
env.c
dlls/ntdll/unix/env.c
+21
-23
server.c
dlls/ntdll/unix/server.c
+1
-0
unix_private.h
dlls/ntdll/unix/unix_private.h
+4
-0
No files found.
dlls/ntdll/unix/env.c
View file @
a31f3374
...
...
@@ -60,6 +60,7 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
environ
);
PEB
*
peb
=
NULL
;
WOW_PEB
*
wow_peb
=
NULL
;
USHORT
*
uctable
=
NULL
,
*
lctable
=
NULL
;
SIZE_T
startup_info_size
=
0
;
BOOL
is_prefix_bootstrap
=
FALSE
;
...
...
@@ -2129,37 +2130,34 @@ static void init_peb( RTL_USER_PROCESS_PARAMETERS *params, void *module )
{
NtCurrentTeb
()
->
WowTebOffset
=
teb_offset
;
NtCurrentTeb
()
->
Tib
.
ExceptionList
=
(
void
*
)((
char
*
)
NtCurrentTeb
()
+
teb_offset
);
wow_peb
=
(
PEB32
*
)((
char
*
)
peb
+
page_size
);
set_thread_id
(
NtCurrentTeb
(),
GetCurrentProcessId
(),
GetCurrentThreadId
()
);
}
#endif
load_global_options
(
&
params
->
ImagePathName
);
if
(
NtCurrentTeb
()
->
WowTebOffset
)
if
(
wow_peb
)
{
void
*
wow64_params
=
build_wow64_parameters
(
params
);
#ifdef _WIN64
PEB32
*
wow64_peb
=
(
PEB32
*
)((
char
*
)
peb
+
page_size
);
#else
PEB64
*
wow64_peb
=
(
PEB64
*
)((
char
*
)
peb
-
page_size
);
#endif
wow64_peb
->
ImageBaseAddress
=
PtrToUlong
(
peb
->
ImageBaseAddress
);
wow64_peb
->
ProcessParameters
=
PtrToUlong
(
wow64_params
);
wow64_peb
->
NumberOfProcessors
=
peb
->
NumberOfProcessors
;
wow64_peb
->
NtGlobalFlag
=
peb
->
NtGlobalFlag
;
wow64_peb
->
CriticalSectionTimeout
.
QuadPart
=
peb
->
CriticalSectionTimeout
.
QuadPart
;
wow64_peb
->
HeapSegmentReserve
=
peb
->
HeapSegmentReserve
;
wow64_peb
->
HeapSegmentCommit
=
peb
->
HeapSegmentCommit
;
wow64_peb
->
HeapDeCommitTotalFreeThreshold
=
peb
->
HeapDeCommitTotalFreeThreshold
;
wow64_peb
->
HeapDeCommitFreeBlockThreshold
=
peb
->
HeapDeCommitFreeBlockThreshold
;
wow64_peb
->
OSMajorVersion
=
peb
->
OSMajorVersion
;
wow64_peb
->
OSMinorVersion
=
peb
->
OSMinorVersion
;
wow64_peb
->
OSBuildNumber
=
peb
->
OSBuildNumber
;
wow64_peb
->
OSPlatformId
=
peb
->
OSPlatformId
;
wow64_peb
->
ImageSubSystem
=
peb
->
ImageSubSystem
;
wow64_peb
->
ImageSubSystemMajorVersion
=
peb
->
ImageSubSystemMajorVersion
;
wow64_peb
->
ImageSubSystemMinorVersion
=
peb
->
ImageSubSystemMinorVersion
;
wow64_peb
->
SessionId
=
peb
->
SessionId
;
wow_peb
->
ImageBaseAddress
=
PtrToUlong
(
peb
->
ImageBaseAddress
);
wow_peb
->
ProcessParameters
=
PtrToUlong
(
wow64_params
);
wow_peb
->
NumberOfProcessors
=
peb
->
NumberOfProcessors
;
wow_peb
->
NtGlobalFlag
=
peb
->
NtGlobalFlag
;
wow_peb
->
CriticalSectionTimeout
.
QuadPart
=
peb
->
CriticalSectionTimeout
.
QuadPart
;
wow_peb
->
HeapSegmentReserve
=
peb
->
HeapSegmentReserve
;
wow_peb
->
HeapSegmentCommit
=
peb
->
HeapSegmentCommit
;
wow_peb
->
HeapDeCommitTotalFreeThreshold
=
peb
->
HeapDeCommitTotalFreeThreshold
;
wow_peb
->
HeapDeCommitFreeBlockThreshold
=
peb
->
HeapDeCommitFreeBlockThreshold
;
wow_peb
->
OSMajorVersion
=
peb
->
OSMajorVersion
;
wow_peb
->
OSMinorVersion
=
peb
->
OSMinorVersion
;
wow_peb
->
OSBuildNumber
=
peb
->
OSBuildNumber
;
wow_peb
->
OSPlatformId
=
peb
->
OSPlatformId
;
wow_peb
->
ImageSubSystem
=
peb
->
ImageSubSystem
;
wow_peb
->
ImageSubSystemMajorVersion
=
peb
->
ImageSubSystemMajorVersion
;
wow_peb
->
ImageSubSystemMinorVersion
=
peb
->
ImageSubSystemMinorVersion
;
wow_peb
->
SessionId
=
peb
->
SessionId
;
}
}
...
...
dlls/ntdll/unix/server.c
View file @
a31f3374
...
...
@@ -1518,6 +1518,7 @@ size_t server_init_process(void)
is_wow64
=
TRUE
;
NtCurrentTeb
()
->
GdiBatchCount
=
PtrToUlong
(
(
char
*
)
NtCurrentTeb
()
-
teb_offset
);
NtCurrentTeb
()
->
WowTebOffset
=
-
teb_offset
;
wow_peb
=
(
PEB64
*
)((
char
*
)
peb
-
page_size
);
#endif
}
else
...
...
dlls/ntdll/unix/unix_private.h
View file @
a31f3374
...
...
@@ -393,12 +393,16 @@ static inline client_ptr_t iosb_client_ptr( IO_STATUS_BLOCK *io )
#ifdef _WIN64
typedef
TEB32
WOW_TEB
;
typedef
PEB32
WOW_PEB
;
static
inline
TEB64
*
NtCurrentTeb64
(
void
)
{
return
NULL
;
}
#else
typedef
TEB64
WOW_TEB
;
typedef
PEB64
WOW_PEB
;
static
inline
TEB64
*
NtCurrentTeb64
(
void
)
{
return
(
TEB64
*
)
NtCurrentTeb
()
->
GdiBatchCount
;
}
#endif
extern
WOW_PEB
*
wow_peb
DECLSPEC_HIDDEN
;
static
inline
WOW_TEB
*
get_wow_teb
(
TEB
*
teb
)
{
return
teb
->
WowTebOffset
?
(
WOW_TEB
*
)((
char
*
)
teb
+
teb
->
WowTebOffset
)
:
NULL
;
...
...
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