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
3f8d60e2
Commit
3f8d60e2
authored
Jul 29, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Jul 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Compare builtins by their device and inode number directly.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d9c085f1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
loader.c
dlls/ntdll/unix/loader.c
+12
-9
No files found.
dlls/ntdll/unix/loader.c
View file @
3f8d60e2
...
...
@@ -129,7 +129,8 @@ static HMODULE ntdll_module;
struct
file_id
{
BYTE
ObjectId
[
16
];
dev_t
dev
;
ino_t
ino
;
};
struct
builtin_module
...
...
@@ -142,13 +143,17 @@ struct builtin_module
static
struct
list
builtin_modules
=
LIST_INIT
(
builtin_modules
);
static
NTSTATUS
add_builtin_module
(
void
*
module
,
void
*
handle
,
const
FILE_OBJECTID_BUFFER
*
id
)
static
NTSTATUS
add_builtin_module
(
void
*
module
,
void
*
handle
,
const
struct
stat
*
st
)
{
struct
builtin_module
*
builtin
;
if
(
!
(
builtin
=
malloc
(
sizeof
(
*
builtin
)
)))
return
STATUS_NO_MEMORY
;
builtin
->
handle
=
handle
;
builtin
->
module
=
module
;
if
(
id
)
memcpy
(
&
builtin
->
id
,
id
->
ObjectId
,
sizeof
(
builtin
->
id
)
);
if
(
st
)
{
builtin
->
id
.
dev
=
st
->
st_dev
;
builtin
->
id
.
ino
=
st
->
st_ino
;
}
else
memset
(
&
builtin
->
id
,
0
,
sizeof
(
builtin
->
id
)
);
list_add_tail
(
&
builtin_modules
,
&
builtin
->
entry
);
return
STATUS_SUCCESS
;
...
...
@@ -996,9 +1001,7 @@ static NTSTATUS open_dll_file( const char *name, void **module, pe_image_info_t
{
struct
builtin_module
*
builtin
;
OBJECT_ATTRIBUTES
attr
=
{
sizeof
(
attr
)
};
IO_STATUS_BLOCK
io
;
LARGE_INTEGER
size
;
FILE_OBJECTID_BUFFER
id
;
struct
stat
st
;
SIZE_T
len
=
0
;
NTSTATUS
status
;
...
...
@@ -1017,11 +1020,11 @@ static NTSTATUS open_dll_file( const char *name, void **module, pe_image_info_t
return
STATUS_DLL_NOT_FOUND
;
}
if
(
!
NtFsControlFile
(
handle
,
0
,
NULL
,
NULL
,
&
io
,
FSCTL_GET_OBJECT_ID
,
NULL
,
0
,
&
id
,
sizeof
(
id
)
))
if
(
!
stat
(
name
,
&
st
))
{
LIST_FOR_EACH_ENTRY
(
builtin
,
&
builtin_modules
,
struct
builtin_module
,
entry
)
{
if
(
!
memcmp
(
&
builtin
->
id
,
id
.
ObjectId
,
sizeof
(
builtin
->
id
)
)
)
if
(
builtin
->
id
.
dev
==
st
.
st_dev
&&
builtin
->
id
.
ino
==
st
.
st_ino
)
{
TRACE
(
"%s is the same file as existing module %p
\n
"
,
debugstr_a
(
name
),
builtin
->
module
);
...
...
@@ -1032,7 +1035,7 @@ static NTSTATUS open_dll_file( const char *name, void **module, pe_image_info_t
}
}
}
else
memset
(
id
.
ObjectId
,
0
,
sizeof
(
id
.
ObjectId
)
);
else
memset
(
&
st
,
0
,
sizeof
(
st
)
);
size
.
QuadPart
=
0
;
status
=
NtCreateSection
(
&
mapping
,
STANDARD_RIGHTS_REQUIRED
|
SECTION_QUERY
|
...
...
@@ -1063,7 +1066,7 @@ static NTSTATUS open_dll_file( const char *name, void **module, pe_image_info_t
status
=
STATUS_IMAGE_MACHINE_TYPE_MISMATCH
;
}
if
(
!
status
)
status
=
add_builtin_module
(
*
module
,
NULL
,
&
id
);
if
(
!
status
)
status
=
add_builtin_module
(
*
module
,
NULL
,
&
st
);
if
(
status
)
{
...
...
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