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
05385575
Commit
05385575
authored
Dec 04, 2022
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Initialize Unix calls early during startup.
parent
bef09697
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
loader.c
dlls/ntdll/loader.c
+10
-9
No files found.
dlls/ntdll/loader.c
View file @
05385575
...
...
@@ -2187,22 +2187,17 @@ static NTSTATUS build_module( LPCWSTR load_path, const UNICODE_STRING *nt_name,
*
* Build the module data for the initially-loaded ntdll.
*/
static
void
build_ntdll_module
(
void
)
static
void
build_ntdll_module
(
HMODULE
module
)
{
MEMORY_BASIC_INFORMATION
meminfo
;
UNICODE_STRING
nt_name
;
WINE_MODREF
*
wm
;
RtlInitUnicodeString
(
&
nt_name
,
L"
\\
??
\\
C:
\\
windows
\\
system32
\\
ntdll.dll"
);
NtQueryVirtualMemory
(
GetCurrentProcess
(),
build_ntdll_module
,
MemoryBasicInformation
,
&
meminfo
,
sizeof
(
meminfo
),
NULL
);
wm
=
alloc_module
(
meminfo
.
AllocationBase
,
&
nt_name
,
TRUE
);
wm
=
alloc_module
(
module
,
&
nt_name
,
TRUE
);
assert
(
wm
);
wm
->
ldr
.
Flags
&=
~
LDR_DONT_RESOLVE_REFS
;
node_ntdll
=
wm
->
ldr
.
DdagNode
;
if
(
TRACE_ON
(
relay
))
RELAY_SetupDLL
(
meminfo
.
AllocationBase
);
NtQueryVirtualMemory
(
GetCurrentProcess
(),
meminfo
.
AllocationBase
,
MemoryWineUnixFuncs
,
&
ntdll_unix_handle
,
sizeof
(
ntdll_unix_handle
),
NULL
);
if
(
TRACE_ON
(
relay
))
RELAY_SetupDLL
(
module
);
}
...
...
@@ -4112,10 +4107,16 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unknown2, ULONG_PTR
if
(
!
imports_fixup_done
)
{
MEMORY_BASIC_INFORMATION
meminfo
;
ANSI_STRING
func_name
;
WINE_MODREF
*
kernel32
;
PEB
*
peb
=
NtCurrentTeb
()
->
Peb
;
NtQueryVirtualMemory
(
GetCurrentProcess
(),
LdrInitializeThunk
,
MemoryBasicInformation
,
&
meminfo
,
sizeof
(
meminfo
),
NULL
);
NtQueryVirtualMemory
(
GetCurrentProcess
(),
meminfo
.
AllocationBase
,
MemoryWineUnixFuncs
,
&
ntdll_unix_handle
,
sizeof
(
ntdll_unix_handle
),
NULL
);
peb
->
LdrData
=
&
ldr
;
peb
->
FastPebLock
=
&
peb_lock
;
peb
->
TlsBitmap
=
&
tls_bitmap
;
...
...
@@ -4137,7 +4138,7 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unknown2, ULONG_PTR
wm
=
build_main_module
();
wm
->
ldr
.
LoadCount
=
-
1
;
build_ntdll_module
();
build_ntdll_module
(
meminfo
.
AllocationBase
);
if
(
NtCurrentTeb
()
->
WowTebOffset
)
init_wow64
(
context
);
...
...
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