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
93eb4dbd
Commit
93eb4dbd
authored
Feb 25, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Add a separate helper for creating the initial ntdll module.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7709d9b8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
18 deletions
+22
-18
loader.c
dlls/ntdll/loader.c
+22
-18
No files found.
dlls/ntdll/loader.c
View file @
93eb4dbd
...
...
@@ -1937,20 +1937,23 @@ static NTSTATUS build_module( LPCWSTR load_path, const UNICODE_STRING *nt_name,
/*************************************************************************
* build_
builtin
_module
* build_
ntdll
_module
*
* Build the module
for a builtin library
.
* Build the module
data for the initially-loaded ntdll
.
*/
static
NTSTATUS
build_builtin_module
(
const
WCHAR
*
load_path
,
const
UNICODE_STRING
*
nt_name
,
void
*
module
,
DWORD
flags
,
WINE_MODREF
**
pwm
)
static
void
build_ntdll_module
(
void
)
{
NTSTATUS
status
;
SECTION_IMAGE_INFORMATION
image_info
=
{
0
};
MEMORY_BASIC_INFORMATION
meminfo
;
UNICODE_STRING
nt_name
;
WINE_MODREF
*
wm
;
image_info
.
u
.
s
.
WineBuiltin
=
1
;
status
=
build_module
(
load_path
,
nt_name
,
&
module
,
&
image_info
,
NULL
,
flags
,
pwm
);
if
(
status
&&
module
)
unix_funcs
->
unload_builtin_dll
(
module
);
return
status
;
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
);
assert
(
wm
);
wm
->
ldr
.
Flags
&=
~
LDR_DONT_RESOLVE_REFS
;
if
(
TRACE_ON
(
relay
))
RELAY_SetupDLL
(
meminfo
.
AllocationBase
);
}
...
...
@@ -2348,7 +2351,14 @@ static NTSTATUS load_so_dll( LPCWSTR load_path, const UNICODE_STRING *nt_name,
}
else
{
if
((
status
=
build_builtin_module
(
load_path
,
&
win_name
,
module
,
flags
,
&
wm
)))
return
status
;
SECTION_IMAGE_INFORMATION
image_info
=
{
0
};
image_info
.
u
.
s
.
WineBuiltin
=
1
;
if
((
status
=
build_module
(
load_path
,
&
win_name
,
&
module
,
&
image_info
,
NULL
,
flags
,
pwm
)))
{
if
(
module
)
unix_funcs
->
unload_builtin_dll
(
module
);
return
status
;
}
TRACE_
(
loaddll
)(
"Loaded %s at %p: builtin
\n
"
,
debugstr_us
(
nt_name
),
module
);
}
*
pwm
=
wm
;
...
...
@@ -3958,8 +3968,6 @@ static NTSTATUS process_init(void)
WINE_MODREF
*
wm
;
NTSTATUS
status
;
ANSI_STRING
func_name
;
UNICODE_STRING
nt_name
;
MEMORY_BASIC_INFORMATION
meminfo
;
INITIAL_TEB
stack
;
TEB
*
teb
=
NtCurrentTeb
();
PEB
*
peb
=
teb
->
Peb
;
...
...
@@ -4059,11 +4067,7 @@ static NTSTATUS process_init(void)
}
#endif
RtlInitUnicodeString
(
&
nt_name
,
L"
\\
??
\\
C:
\\
windows
\\
system32
\\
ntdll.dll"
);
NtQueryVirtualMemory
(
GetCurrentProcess
(),
process_init
,
MemoryBasicInformation
,
&
meminfo
,
sizeof
(
meminfo
),
NULL
);
status
=
build_builtin_module
(
params
->
DllPath
.
Buffer
,
&
nt_name
,
meminfo
.
AllocationBase
,
0
,
&
wm
);
assert
(
!
status
);
build_ntdll_module
();
if
((
status
=
load_dll
(
params
->
DllPath
.
Buffer
,
L"C:
\\
windows
\\
system32
\\
kernel32.dll"
,
NULL
,
0
,
&
wm
))
!=
STATUS_SUCCESS
)
...
...
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