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
0167e195
Commit
0167e195
authored
Sep 30, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Fix handle/module confusion in Unix module loading.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a8ddba35
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
loader.c
dlls/ntdll/unix/loader.c
+8
-7
No files found.
dlls/ntdll/unix/loader.c
View file @
0167e195
...
...
@@ -138,7 +138,7 @@ struct builtin_module
struct
file_id
id
;
void
*
handle
;
void
*
module
;
void
*
unix_
modu
le
;
void
*
unix_
hand
le
;
};
static
struct
list
builtin_modules
=
LIST_INIT
(
builtin_modules
);
...
...
@@ -149,7 +149,7 @@ static NTSTATUS add_builtin_module( void *module, void *handle, const struct sta
if
(
!
(
builtin
=
malloc
(
sizeof
(
*
builtin
)
)))
return
STATUS_NO_MEMORY
;
builtin
->
handle
=
handle
;
builtin
->
module
=
module
;
builtin
->
unix_
modu
le
=
NULL
;
builtin
->
unix_
hand
le
=
NULL
;
if
(
st
)
{
builtin
->
id
.
dev
=
st
->
st_dev
;
...
...
@@ -1015,23 +1015,24 @@ static NTSTATUS dlopen_unix_dll( void *module, const char *name, void **unix_ent
{
if
(
builtin
->
module
==
module
)
{
if
(
builtin
->
unix_
module
==
unix_modu
le
)
/* already loaded */
if
(
builtin
->
unix_
handle
==
hand
le
)
/* already loaded */
{
*
unix_entry
=
entry
;
status
=
STATUS_SUCCESS
;
goto
done
;
}
if
(
builtin
->
unix_
modu
le
)
if
(
builtin
->
unix_
hand
le
)
{
ERR
(
"module %p already has a Unix module that's not %s
\n
"
,
module
,
debugstr_a
(
name
)
);
goto
done
;
}
if
((
status
=
map_so_dll
(
nt
,
unix_module
)))
goto
done
;
if
((
status
=
fixup_ntdll_imports
(
name
,
unix_module
)))
goto
done
;
builtin
->
unix_
modu
le
=
handle
;
builtin
->
unix_
hand
le
=
handle
;
*
unix_entry
=
entry
;
return
STATUS_SUCCESS
;
}
else
if
(
builtin
->
unix_
module
==
unix_modu
le
)
else
if
(
builtin
->
unix_
handle
==
hand
le
)
{
ERR
(
"%s already loaded for module %p
\n
"
,
debugstr_a
(
name
),
module
);
goto
done
;
...
...
@@ -1339,7 +1340,7 @@ static NTSTATUS CDECL unload_builtin_dll( void *module )
if
(
builtin
->
module
!=
module
)
continue
;
list_remove
(
&
builtin
->
entry
);
if
(
builtin
->
handle
)
dlclose
(
builtin
->
handle
);
if
(
builtin
->
unix_
module
)
dlclose
(
builtin
->
unix_modu
le
);
if
(
builtin
->
unix_
handle
)
dlclose
(
builtin
->
unix_hand
le
);
free
(
builtin
);
return
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