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
f244c3b5
Commit
f244c3b5
authored
Feb 09, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Add custom flag for fake dlls in PE image information.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f1bb3580
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
7 deletions
+19
-7
virtual.c
dlls/ntdll/virtual.c
+1
-1
server_protocol.h
include/wine/server_protocol.h
+2
-1
mapping.c
server/mapping.c
+15
-5
protocol.def
server/protocol.def
+1
-0
No files found.
dlls/ntdll/virtual.c
View file @
f244c3b5
...
...
@@ -3200,7 +3200,7 @@ void virtual_fill_image_information( const pe_image_info_t *pe_info, SECTION_IMA
info
->
DllCharacteristics
=
pe_info
->
dll_charact
;
info
->
Machine
=
pe_info
->
machine
;
info
->
ImageContainsCode
=
pe_info
->
contains_code
;
info
->
u
.
ImageFlags
=
pe_info
->
image_flags
;
info
->
u
.
ImageFlags
=
pe_info
->
image_flags
&
~
IMAGE_FLAGS_WineFakeDll
;
info
->
LoaderFlags
=
pe_info
->
loader_flags
;
info
->
ImageFileSize
=
pe_info
->
file_size
;
info
->
CheckSum
=
pe_info
->
checksum
;
...
...
include/wine/server_protocol.h
View file @
f244c3b5
...
...
@@ -714,6 +714,7 @@ typedef struct
#define IMAGE_FLAGS_ImageDynamicallyRelocated 0x04
#define IMAGE_FLAGS_ImageMappedFlat 0x08
#define IMAGE_FLAGS_BaseBelow4gb 0x10
#define IMAGE_FLAGS_WineFakeDll 0x80
struct
rawinput_device
{
...
...
@@ -6553,6 +6554,6 @@ union generic_reply
struct
terminate_job_reply
terminate_job_reply
;
};
#define SERVER_PROTOCOL_VERSION 57
1
#define SERVER_PROTOCOL_VERSION 57
2
#endif
/* __WINE_WINE_SERVER_PROTOCOL_H */
server/mapping.c
View file @
f244c3b5
...
...
@@ -555,11 +555,17 @@ static int load_clr_header( IMAGE_COR20_HEADER *hdr, size_t va, size_t size, int
/* retrieve the mapping parameters for an executable (PE) image */
static
unsigned
int
get_image_params
(
struct
mapping
*
mapping
,
file_pos_t
file_size
,
int
unix_fd
)
{
IMAGE_DOS_HEADER
dos
;
static
const
char
fakedll_signature
[]
=
"Wine placeholder DLL"
;
IMAGE_COR20_HEADER
clr
;
IMAGE_SECTION_HEADER
sec
[
96
];
struct
{
IMAGE_DOS_HEADER
dos
;
char
buffer
[
sizeof
(
fakedll_signature
)];
}
mz
;
struct
{
DWORD
Signature
;
IMAGE_FILE_HEADER
FileHeader
;
union
...
...
@@ -570,15 +576,17 @@ static unsigned int get_image_params( struct mapping *mapping, file_pos_t file_s
}
nt
;
off_t
pos
;
int
size
;
size_t
clr_va
,
clr_size
;
size_t
mz_size
,
clr_va
,
clr_size
;
unsigned
int
i
,
cpu_mask
=
get_supported_cpu_mask
();
/* load the headers */
if
(
!
file_size
)
return
STATUS_INVALID_FILE_FOR_SECTION
;
if
(
pread
(
unix_fd
,
&
dos
,
sizeof
(
dos
),
0
)
!=
sizeof
(
dos
))
return
STATUS_INVALID_IMAGE_NOT_MZ
;
if
(
dos
.
e_magic
!=
IMAGE_DOS_SIGNATURE
)
return
STATUS_INVALID_IMAGE_NOT_MZ
;
pos
=
dos
.
e_lfanew
;
size
=
pread
(
unix_fd
,
&
mz
,
sizeof
(
mz
),
0
);
if
(
size
<
sizeof
(
mz
.
dos
))
return
STATUS_INVALID_IMAGE_NOT_MZ
;
if
(
mz
.
dos
.
e_magic
!=
IMAGE_DOS_SIGNATURE
)
return
STATUS_INVALID_IMAGE_NOT_MZ
;
mz_size
=
size
;
pos
=
mz
.
dos
.
e_lfanew
;
size
=
pread
(
unix_fd
,
&
nt
,
sizeof
(
nt
),
pos
);
if
(
size
<
sizeof
(
nt
.
Signature
)
+
sizeof
(
nt
.
FileHeader
))
return
STATUS_INVALID_IMAGE_FORMAT
;
...
...
@@ -691,6 +699,8 @@ static unsigned int get_image_params( struct mapping *mapping, file_pos_t file_s
mapping
->
image
.
gp
=
0
;
/* FIXME */
mapping
->
image
.
file_size
=
file_size
;
mapping
->
image
.
loader_flags
=
clr_va
&&
clr_size
;
if
(
mz_size
==
sizeof
(
mz
)
&&
!
memcmp
(
mz
.
buffer
,
fakedll_signature
,
sizeof
(
fakedll_signature
)
))
mapping
->
image
.
image_flags
|=
IMAGE_FLAGS_WineFakeDll
;
/* load the section headers */
...
...
server/protocol.def
View file @
f244c3b5
...
...
@@ -730,6 +730,7 @@ typedef struct
#define IMAGE_FLAGS_ImageDynamicallyRelocated 0x04
#define IMAGE_FLAGS_ImageMappedFlat 0x08
#define IMAGE_FLAGS_BaseBelow4gb 0x10
#define IMAGE_FLAGS_WineFakeDll 0x80
struct rawinput_device
{
...
...
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