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
f44b5c46
Commit
f44b5c46
authored
Jan 20, 2004
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jan 20, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed DOS EXE loader for the case where we realy have only 4 bytes on
the last page of the exe.
parent
998e1520
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
module.c
dlls/winedos/module.c
+9
-2
No files found.
dlls/winedos/module.c
View file @
f44b5c46
...
...
@@ -232,6 +232,9 @@ static BOOL MZ_DoLoadImage( HANDLE hFile, LPCSTR filename, OverlayBlock *oblk )
/* calculate load size */
image_start
=
mz_header
.
e_cparhdr
<<
4
;
image_size
=
mz_header
.
e_cp
<<
9
;
/* pages are 512 bytes */
/* From Ralf Brown Interrupt List: If the word at offset 02h is 4, it should
* be treated as 00h, since pre-1.10 versions of the MS linker set it that
* way. */
if
((
mz_header
.
e_cblp
!=
0
)
&&
(
mz_header
.
e_cblp
!=
4
))
image_size
-=
512
-
mz_header
.
e_cblp
;
image_size
-=
image_start
;
min_size
=
image_size
+
((
DWORD
)
mz_header
.
e_minalloc
<<
4
)
+
(
PSP_SIZE
<<
4
);
...
...
@@ -274,8 +277,12 @@ static BOOL MZ_DoLoadImage( HANDLE hFile, LPCSTR filename, OverlayBlock *oblk )
TRACE
(
"loading DOS %s image, %08lx bytes
\n
"
,
old_com
?
"COM"
:
"EXE"
,
image_size
);
SetFilePointer
(
hFile
,
image_start
,
NULL
,
FILE_BEGIN
);
if
(
!
ReadFile
(
hFile
,
load_start
,
image_size
,
&
len
,
NULL
)
||
len
!=
image_size
)
{
SetLastError
(
ERROR_BAD_FORMAT
);
goto
load_error
;
/* check if this is due to the workaround for the pre-1.10 MS linker and we
realy had only 4 bytes on the last page */
if
(
mz_header
.
e_cblp
!=
4
||
image_size
-
len
!=
512
-
4
)
{
SetLastError
(
ERROR_BAD_FORMAT
);
goto
load_error
;
}
}
if
(
mz_header
.
e_crlc
)
{
...
...
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