Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Felix Münchhalfen
wine
Commits
e257cb5a
Commit
e257cb5a
authored
26 years ago
by
Ove Kåven
Committed by
Alexandre Julliard
26 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Moved DOS handle allocation slightly, to fix potential memory
leaks and lost handles. Also removed some useless init code.
parent
36a806cf
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
loader/dos/dosvm.c
+8
-20
8 additions, 20 deletions
loader/dos/dosvm.c
with
8 additions
and
20 deletions
loader/dos/dosvm.c
+
8
−
20
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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment