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
64756039
Commit
64756039
authored
Nov 29, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libwine: Work around the Mac OS dynamic loader support for PE files.
parent
b314f132
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
loader.c
libs/wine/loader.c
+19
-0
No files found.
libs/wine/loader.c
View file @
64756039
...
...
@@ -668,6 +668,25 @@ void *wine_dlopen( const char *filename, int flag, char *error, size_t errorsize
#ifdef HAVE_DLOPEN
void
*
ret
;
const
char
*
s
;
#ifdef __APPLE__
/* the Mac OS loader pretends to be able to load PE files, so avoid them here */
unsigned
char
magic
[
2
];
int
fd
=
open
(
filename
,
O_RDONLY
);
if
(
fd
!=
-
1
)
{
if
(
pread
(
fd
,
magic
,
2
,
0
)
==
2
&&
magic
[
0
]
==
'M'
&&
magic
[
1
]
==
'Z'
)
{
static
const
char
msg
[]
=
"MZ format"
;
size_t
len
=
min
(
errorsize
,
sizeof
(
msg
)
);
memcpy
(
error
,
msg
,
len
);
error
[
len
-
1
]
=
0
;
close
(
fd
);
return
NULL
;
}
close
(
fd
);
}
#endif
dlerror
();
dlerror
();
#ifdef __sun
if
(
strchr
(
filename
,
':'
))
...
...
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