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
Johnny Cai
wine
Commits
a3afeef3
Commit
a3afeef3
authored
25 years ago
by
Ulrich Weigand
Committed by
Alexandre Julliard
25 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix InitTask() to work if DGROUP was manually resized.
parent
ec6aab51
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
loader/task.c
+43
-50
43 additions, 50 deletions
loader/task.c
with
43 additions
and
50 deletions
loader/task.c
+
43
−
50
View file @
a3afeef3
...
@@ -711,65 +711,58 @@ void TASK_Reschedule(void)
...
@@ -711,65 +711,58 @@ void TASK_Reschedule(void)
void
WINAPI
InitTask16
(
CONTEXT86
*
context
)
void
WINAPI
InitTask16
(
CONTEXT86
*
context
)
{
{
TDB
*
pTask
;
TDB
*
pTask
;
NE_MODULE
*
pModule
;
SEGTABLEENTRY
*
pSegTable
;
INSTANCEDATA
*
pinstance
;
INSTANCEDATA
*
pinstance
;
LONG
stacklow
,
stackhi
;
SEGPTR
ptr
;
if
(
context
)
EAX_reg
(
context
)
=
0
;
EAX_reg
(
context
)
=
0
;
if
(
!
(
pTask
=
(
TDB
*
)
GlobalLock16
(
GetCurrentTask
()
)))
return
;
if
(
!
(
pTask
=
(
TDB
*
)
GlobalLock16
(
GetCurrentTask
()
)))
return
;
if
(
!
(
pModule
=
NE_GetPtr
(
pTask
->
hModule
)))
return
;
/* Note: we need to trust that BX/CX contain the stack/heap sizes,
as some apps, notably Visual Basic apps, *modify* the heap/stack
size of the instance data segment before calling InitTask() */
/* Initialize the INSTANCEDATA structure */
pinstance
=
(
INSTANCEDATA
*
)
PTR_SEG_OFF_TO_LIN
(
CURRENT_DS
,
0
);
pinstance
->
stackmin
=
OFFSETOF
(
pTask
->
teb
->
cur_stack
);
pinstance
->
stackbottom
=
pinstance
->
stackmin
;
/* yup, that's right. Confused me too. */
pinstance
->
stacktop
=
(
pinstance
->
stackmin
>
BX_reg
(
context
)
?
pinstance
->
stackmin
-
BX_reg
(
context
)
:
0
)
+
150
;
/* Initialize the local heap */
if
(
CX_reg
(
context
)
)
LocalInit16
(
pTask
->
hInstance
,
0
,
CX_reg
(
context
)
);
/* Initialize implicitly loaded DLLs */
/* Initialize implicitly loaded DLLs */
NE_InitializeDLLs
(
pTask
->
hModule
);
NE_InitializeDLLs
(
pTask
->
hModule
);
if
(
context
)
/* Registers on return are:
{
* ax 1 if OK, 0 on error
/* Registers on return are:
* cx stack limit in bytes
* ax 1 if OK, 0 on error
* dx cmdShow parameter
* cx stack limit in bytes
* si instance handle of the previous instance
* dx cmdShow parameter
* di instance handle of the new task
* si instance handle of the previous instance
* es:bx pointer to command-line inside PSP
* di instance handle of the new task
*
* es:bx pointer to command-line inside PSP
* 0 (=%bp) is pushed on the stack
*
*/
* 0 (=%bp) is pushed on the stack
ptr
=
STACK16_PUSH
(
pTask
->
teb
,
sizeof
(
WORD
)
);
*/
*
(
WORD
*
)
PTR_SEG_TO_LIN
(
ptr
)
=
0
;
SEGPTR
ptr
=
STACK16_PUSH
(
pTask
->
teb
,
sizeof
(
WORD
)
);
SP_reg
(
context
)
-=
2
;
*
(
WORD
*
)
PTR_SEG_TO_LIN
(
ptr
)
=
0
;
SP_reg
(
context
)
-=
2
;
EAX_reg
(
context
)
=
1
;
if
(
!
pTask
->
pdb
.
cmdLine
[
0
])
EBX_reg
(
context
)
=
0x80
;
else
{
LPBYTE
p
=
&
pTask
->
pdb
.
cmdLine
[
1
];
while
((
*
p
==
' '
)
||
(
*
p
==
'\t'
))
p
++
;
EBX_reg
(
context
)
=
0x80
+
(
p
-
pTask
->
pdb
.
cmdLine
);
}
ECX_reg
(
context
)
=
pModule
->
stack_size
;
EDX_reg
(
context
)
=
pTask
->
nCmdShow
;
ESI_reg
(
context
)
=
(
DWORD
)
pTask
->
hPrevInstance
;
EDI_reg
(
context
)
=
(
DWORD
)
pTask
->
hInstance
;
ES_reg
(
context
)
=
(
WORD
)
pTask
->
hPDB
;
}
/* Initialize the local heap */
EAX_reg
(
context
)
=
1
;
if
(
pModule
->
heap_size
)
if
(
!
pTask
->
pdb
.
cmdLine
[
0
])
EBX_reg
(
context
)
=
0x80
;
else
{
{
LocalInit16
(
pTask
->
hInstance
,
0
,
pModule
->
heap_size
);
LPBYTE
p
=
&
pTask
->
pdb
.
cmdLine
[
1
];
}
while
((
*
p
==
' '
)
||
(
*
p
==
'\t'
))
p
++
;
EBX_reg
(
context
)
=
0x80
+
(
p
-
pTask
->
pdb
.
cmdLine
);
/* Initialize the INSTANCEDATA structure */
}
pSegTable
=
NE_SEG_TABLE
(
pModule
);
ECX_reg
(
context
)
=
pinstance
->
stacktop
;
stacklow
=
pSegTable
[
pModule
->
ss
-
1
].
minsize
;
EDX_reg
(
context
)
=
pTask
->
nCmdShow
;
stackhi
=
stacklow
+
pModule
->
stack_size
;
ESI_reg
(
context
)
=
(
DWORD
)
pTask
->
hPrevInstance
;
if
(
stackhi
>
0xffff
)
stackhi
=
0xffff
;
EDI_reg
(
context
)
=
(
DWORD
)
pTask
->
hInstance
;
pinstance
=
(
INSTANCEDATA
*
)
PTR_SEG_OFF_TO_LIN
(
CURRENT_DS
,
0
);
ES_reg
(
context
)
=
(
WORD
)
pTask
->
hPDB
;
pinstance
->
stackbottom
=
stackhi
;
/* yup, that's right. Confused me too. */
pinstance
->
stacktop
=
stacklow
;
pinstance
->
stackmin
=
OFFSETOF
(
pTask
->
teb
->
cur_stack
);
}
}
...
...
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