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
e257cb5a
Commit
e257cb5a
authored
Jan 24, 1999
by
Ove Kaaven
Committed by
Alexandre Julliard
Jan 24, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved DOS handle allocation slightly, to fix potential memory
leaks and lost handles. Also removed some useless init code.
parent
36a806cf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
20 deletions
+8
-20
dosvm.c
loader/dos/dosvm.c
+8
-20
No files found.
loader/dos/dosvm.c
View file @
e257cb5a
...
...
@@ -192,26 +192,11 @@ int DOSVM_Enter( PCONTEXT context )
ERR
(
module
,
"No task is currently active!
\n
"
);
return
-
1
;
}
if
(
!
pModule
->
lpDosTask
)
{
/* no VM86 (dosmod) task is currently running, start one */
if
((
lpDosTask
=
calloc
(
1
,
sizeof
(
DOSTASK
)))
==
NULL
)
return
0
;
lpDosTask
->
hModule
=
pModule
->
self
;
stat
=
MZ_InitMemory
(
lpDosTask
,
pModule
);
if
(
stat
>=
32
)
stat
=
MZ_InitTask
(
lpDosTask
);
if
(
stat
<
32
)
{
free
(
lpDosTask
);
return
-
1
;
}
pModule
->
lpDosTask
=
lpDosTask
;
pModule
->
dos_image
=
lpDosTask
->
img
;
/* Note: we're leaving it running after this, in case we need it again,
as this minimizes the overhead of starting it up every time...
it will be killed automatically when the current task terminates */
}
else
lpDosTask
=
pModule
->
lpDosTask
;
/* allocate standard DOS handles */
FILE_InitProcessDosHandles
();
if
(
!
(
lpDosTask
=
pModule
->
lpDosTask
))
{
/* MZ_CreateProcess or MZ_AllocDPMITask should have been called first */
ERR
(
module
,
"dosmod has not been initialized!"
);
return
-
1
;
}
if
(
context
)
{
#define CP(x,y) VM86.regs.x = y##_reg(context)
...
...
@@ -219,6 +204,9 @@ int DOSVM_Enter( PCONTEXT context )
#undef CP
}
else
{
/* initial setup */
/* allocate standard DOS handles */
FILE_InitProcessDosHandles
();
/* registers */
memset
(
&
VM86
,
0
,
sizeof
(
VM86
));
VM86
.
regs
.
cs
=
lpDosTask
->
init_cs
;
VM86
.
regs
.
eip
=
lpDosTask
->
init_ip
;
...
...
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