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
eccd21e3
Commit
eccd21e3
authored
Jul 10, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Add a helper function to retrieve the NT headers of the main exe.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9ec262eb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
3 deletions
+9
-3
server.c
dlls/ntdll/unix/server.c
+1
-1
unix_private.h
dlls/ntdll/unix/unix_private.h
+6
-0
virtual.c
dlls/ntdll/unix/virtual.c
+2
-2
No files found.
dlls/ntdll/unix/server.c
View file @
eccd21e3
...
...
@@ -1454,7 +1454,7 @@ void server_init_process(void)
void
CDECL
server_init_process_done
(
void
*
relay
)
{
PEB
*
peb
=
NtCurrentTeb
()
->
Peb
;
IMAGE_NT_HEADERS
*
nt
=
RtlImageNtHeader
(
peb
->
ImageBaseAddress
);
IMAGE_NT_HEADERS
*
nt
=
get_exe_nt_header
(
);
void
*
entry
=
(
char
*
)
peb
->
ImageBaseAddress
+
nt
->
OptionalHeader
.
AddressOfEntryPoint
;
NTSTATUS
status
;
int
suspend
;
...
...
dlls/ntdll/unix/unix_private.h
View file @
eccd21e3
...
...
@@ -264,6 +264,12 @@ static inline void ascii_to_unicode( WCHAR *dst, const char *src, size_t len )
while
(
len
--
)
*
dst
++
=
(
unsigned
char
)
*
src
++
;
}
static
inline
IMAGE_NT_HEADERS
*
get_exe_nt_header
(
void
)
{
IMAGE_DOS_HEADER
*
module
=
(
IMAGE_DOS_HEADER
*
)
NtCurrentTeb
()
->
Peb
->
ImageBaseAddress
;
return
(
IMAGE_NT_HEADERS
*
)((
char
*
)
module
+
module
->
e_lfanew
);
}
static
inline
size_t
ntdll_wcslen
(
const
WCHAR
*
str
)
{
const
WCHAR
*
s
=
str
;
...
...
dlls/ntdll/unix/virtual.c
View file @
eccd21e3
...
...
@@ -2728,7 +2728,7 @@ NTSTATUS CDECL virtual_alloc_thread_stack( INITIAL_TEB *stack, SIZE_T reserve_si
if
(
!
reserve_size
||
!
commit_size
)
{
IMAGE_NT_HEADERS
*
nt
=
RtlImageNtHeader
(
NtCurrentTeb
()
->
Peb
->
ImageBaseAddress
);
IMAGE_NT_HEADERS
*
nt
=
get_exe_nt_header
(
);
if
(
!
reserve_size
)
reserve_size
=
nt
->
OptionalHeader
.
SizeOfStackReserve
;
if
(
!
commit_size
)
commit_size
=
nt
->
OptionalHeader
.
SizeOfStackCommit
;
}
...
...
@@ -3325,7 +3325,7 @@ void CDECL virtual_release_address_space(void)
*/
void
CDECL
virtual_set_large_address_space
(
void
)
{
IMAGE_NT_HEADERS
*
nt
=
RtlImageNtHeader
(
NtCurrentTeb
()
->
Peb
->
ImageBaseAddress
);
IMAGE_NT_HEADERS
*
nt
=
get_exe_nt_header
(
);
if
(
!
(
nt
->
FileHeader
.
Characteristics
&
IMAGE_FILE_LARGE_ADDRESS_AWARE
))
return
;
/* no large address space on win9x */
...
...
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