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
7406583e
Commit
7406583e
authored
Feb 14, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Store the unixlib handle at ntdll load time.
parent
157be051
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
28 deletions
+16
-28
loader.c
dlls/ntdll/loader.c
+0
-2
ntdll.spec
dlls/ntdll/ntdll.spec
+1
-0
loader.c
dlls/ntdll/unix/loader.c
+14
-4
unix_private.h
dlls/ntdll/unix/unix_private.h
+0
-1
virtual.c
dlls/ntdll/unix/virtual.c
+1
-21
No files found.
dlls/ntdll/loader.c
View file @
7406583e
...
...
@@ -4120,8 +4120,6 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unknown2, ULONG_PTR
NtQueryVirtualMemory
(
GetCurrentProcess
(),
LdrInitializeThunk
,
MemoryBasicInformation
,
&
meminfo
,
sizeof
(
meminfo
),
NULL
);
NtQueryVirtualMemory
(
GetCurrentProcess
(),
meminfo
.
AllocationBase
,
MemoryWineUnixFuncs
,
&
__wine_unixlib_handle
,
sizeof
(
__wine_unixlib_handle
),
NULL
);
peb
->
LdrData
=
&
ldr
;
peb
->
FastPebLock
=
&
peb_lock
;
...
...
dlls/ntdll/ntdll.spec
View file @
7406583e
...
...
@@ -1698,6 +1698,7 @@
@ stdcall __wine_ctrl_routine(ptr)
@ extern -private __wine_syscall_dispatcher
@ extern -private __wine_unix_call_dispatcher
@ extern -private __wine_unixlib_handle
@ extern -arch=arm64 __wine_current_teb
# Debugging
...
...
dlls/ntdll/unix/loader.c
View file @
7406583e
...
...
@@ -117,7 +117,6 @@ void (WINAPI *p__wine_ctrl_routine)(void*);
SYSTEM_DLL_INIT_BLOCK
*
pLdrSystemDllInitBlock
=
NULL
;
static
void
*
p__wine_syscall_dispatcher
;
static
void
**
p__wine_unix_call_dispatcher
;
static
void
*
const
syscalls
[]
=
{
...
...
@@ -398,7 +397,6 @@ const char **dll_paths = NULL;
const
char
**
system_dll_paths
=
NULL
;
const
char
*
user_name
=
NULL
;
SECTION_IMAGE_INFORMATION
main_image_info
=
{
NULL
};
HMODULE
ntdll_module
=
0
;
static
const
IMAGE_EXPORT_DIRECTORY
*
ntdll_exports
;
/* adjust an array of pointers to make them into RVAs */
...
...
@@ -1037,6 +1035,9 @@ static const void *get_module_data_dir( HMODULE module, ULONG dir, ULONG *size )
static
void
load_ntdll_functions
(
HMODULE
module
)
{
void
**
p__wine_unix_call_dispatcher
;
unixlib_handle_t
*
p__wine_unixlib_handle
;
ntdll_exports
=
get_module_data_dir
(
module
,
IMAGE_FILE_EXPORT_DIRECTORY
,
NULL
);
assert
(
ntdll_exports
);
...
...
@@ -1055,6 +1056,9 @@ static void load_ntdll_functions( HMODULE module )
GET_FUNC
(
__wine_ctrl_routine
);
GET_FUNC
(
__wine_syscall_dispatcher
);
GET_FUNC
(
__wine_unix_call_dispatcher
);
GET_FUNC
(
__wine_unixlib_handle
);
*
p__wine_unix_call_dispatcher
=
__wine_unix_call_dispatcher
;
*
p__wine_unixlib_handle
=
(
UINT_PTR
)
__wine_unix_call_funcs
;
#ifdef __aarch64__
{
void
**
p__wine_current_teb
;
...
...
@@ -1087,6 +1091,14 @@ static void load_ntdll_wow64_functions( HMODULE module )
p__wine_ctrl_routine
=
(
void
*
)
find_named_export
(
module
,
exports
,
"__wine_ctrl_routine"
);
#ifdef _WIN64
{
unixlib_handle_t
*
p__wine_unixlib_handle
=
(
void
*
)
find_named_export
(
module
,
exports
,
"__wine_unixlib_handle"
);
*
p__wine_unixlib_handle
=
(
UINT_PTR
)
__wine_unix_call_wow64_funcs
;
}
#endif
/* also set the 32-bit LdrSystemDllInitBlock */
memcpy
(
(
void
*
)(
ULONG_PTR
)
pLdrSystemDllInitBlock
->
pLdrSystemDllInitBlock
,
pLdrSystemDllInitBlock
,
sizeof
(
*
pLdrSystemDllInitBlock
)
);
...
...
@@ -1905,7 +1917,6 @@ static void load_ntdll(void)
else
if
(
status
)
fatal_error
(
"failed to load %s error %x
\n
"
,
name
,
status
);
free
(
name
);
load_ntdll_functions
(
module
);
ntdll_module
=
module
;
}
...
...
@@ -2099,7 +2110,6 @@ static void start_main_thread(void)
if
(
main_image_info
.
Machine
!=
current_machine
)
load_wow64_ntdll
(
main_image_info
.
Machine
);
load_apiset_dll
();
ntdll_init_syscalls
(
0
,
&
syscall_table
,
p__wine_syscall_dispatcher
);
*
p__wine_unix_call_dispatcher
=
__wine_unix_call_dispatcher
;
server_init_process_done
();
}
...
...
dlls/ntdll/unix/unix_private.h
View file @
7406583e
...
...
@@ -41,7 +41,6 @@ static const WORD current_machine = IMAGE_FILE_MACHINE_ARMNT;
static
const
WORD
current_machine
=
IMAGE_FILE_MACHINE_ARM64
;
#endif
extern
WORD
native_machine
DECLSPEC_HIDDEN
;
extern
HMODULE
ntdll_module
DECLSPEC_HIDDEN
;
extern
const
unixlib_entry_t
__wine_unix_call_funcs
[]
DECLSPEC_HIDDEN
;
extern
const
unixlib_entry_t
__wine_unix_call_wow64_funcs
[]
DECLSPEC_HIDDEN
;
...
...
dlls/ntdll/unix/virtual.c
View file @
7406583e
...
...
@@ -640,35 +640,15 @@ void *get_builtin_so_handle( void *module )
*/
static
NTSTATUS
get_builtin_unix_funcs
(
void
*
module
,
BOOL
wow
,
const
void
**
funcs
)
{
const
char
*
p
,
*
p
tr_name
=
wow
?
"__wine_unix_call_wow64_funcs"
:
"__wine_unix_call_funcs"
;
const
char
*
ptr_name
=
wow
?
"__wine_unix_call_wow64_funcs"
:
"__wine_unix_call_funcs"
;
sigset_t
sigset
;
NTSTATUS
status
=
STATUS_DLL_NOT_FOUND
;
struct
builtin_module
*
builtin
;
if
(
module
==
ntdll_module
)
{
#ifdef _WIN64
*
funcs
=
wow
?
__wine_unix_call_wow64_funcs
:
__wine_unix_call_funcs
;
#else
*
funcs
=
__wine_unix_call_funcs
;
#endif
return
STATUS_SUCCESS
;
}
server_enter_uninterrupted_section
(
&
virtual_mutex
,
&
sigset
);
LIST_FOR_EACH_ENTRY
(
builtin
,
&
builtin_modules
,
struct
builtin_module
,
entry
)
{
if
(
builtin
->
module
!=
module
)
continue
;
if
(
builtin
->
unix_path
&&
(
p
=
strrchr
(
builtin
->
unix_path
,
'/'
))
&&
!
strcmp
(
p
,
"/ntdll.so"
))
{
#ifdef _WIN64
*
funcs
=
wow
?
__wine_unix_call_wow64_funcs
:
__wine_unix_call_funcs
;
#else
*
funcs
=
__wine_unix_call_funcs
;
#endif
status
=
STATUS_SUCCESS
;
break
;
}
if
(
builtin
->
unix_path
&&
!
builtin
->
unix_handle
)
builtin
->
unix_handle
=
dlopen
(
builtin
->
unix_path
,
RTLD_NOW
);
if
(
builtin
->
unix_handle
)
...
...
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