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
a3afeef3
Commit
a3afeef3
authored
Jul 10, 1999
by
Ulrich Weigand
Committed by
Alexandre Julliard
Jul 10, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix InitTask() to work if DGROUP was manually resized.
parent
ec6aab51
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
50 deletions
+43
-50
task.c
loader/task.c
+43
-50
No files found.
loader/task.c
View file @
a3afeef3
...
...
@@ -711,65 +711,58 @@ void TASK_Reschedule(void)
void
WINAPI
InitTask16
(
CONTEXT86
*
context
)
{
TDB
*
pTask
;
NE_MODULE
*
pModule
;
SEGTABLEENTRY
*
pSegTable
;
INSTANCEDATA
*
pinstance
;
LONG
stacklow
,
stackhi
;
SEGPTR
ptr
;
if
(
context
)
EAX_reg
(
context
)
=
0
;
EAX_reg
(
context
)
=
0
;
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 */
NE_InitializeDLLs
(
pTask
->
hModule
);
if
(
context
)
{
/* Registers on return are:
* ax 1 if OK, 0 on error
* cx stack limit in bytes
* dx cmdShow parameter
* si instance handle of the previous instance
* di instance handle of the new task
* es:bx pointer to command-line inside PSP
*
* 0 (=%bp) is pushed on the stack
*/
SEGPTR
ptr
=
STACK16_PUSH
(
pTask
->
teb
,
sizeof
(
WORD
)
);
*
(
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
;
}
/* Registers on return are:
* ax 1 if OK, 0 on error
* cx stack limit in bytes
* dx cmdShow parameter
* si instance handle of the previous instance
* di instance handle of the new task
* es:bx pointer to command-line inside PSP
*
* 0 (=%bp) is pushed on the stack
*/
ptr
=
STACK16_PUSH
(
pTask
->
teb
,
sizeof
(
WORD
)
);
*
(
WORD
*
)
PTR_SEG_TO_LIN
(
ptr
)
=
0
;
SP_reg
(
context
)
-=
2
;
/* Initialize the local heap */
if
(
pModule
->
heap_size
)
EAX_reg
(
context
)
=
1
;
if
(
!
pTask
->
pdb
.
cmdLine
[
0
])
EBX_reg
(
context
)
=
0x80
;
else
{
LocalInit16
(
pTask
->
hInstance
,
0
,
pModule
->
heap_size
);
}
/* Initialize the INSTANCEDATA structure */
pSegTable
=
NE_SEG_TABLE
(
pModule
);
stacklow
=
pSegTable
[
pModule
->
ss
-
1
].
minsize
;
stackhi
=
stacklow
+
pModule
->
stack_size
;
if
(
stackhi
>
0xffff
)
stackhi
=
0xffff
;
pinstance
=
(
INSTANCEDATA
*
)
PTR_SEG_OFF_TO_LIN
(
CURRENT_DS
,
0
);
pinstance
->
stackbottom
=
stackhi
;
/* yup, that's right. Confused me too. */
pinstance
->
stacktop
=
stacklow
;
pinstance
->
stackmin
=
OFFSETOF
(
pTask
->
teb
->
cur_stack
);
LPBYTE
p
=
&
pTask
->
pdb
.
cmdLine
[
1
];
while
((
*
p
==
' '
)
||
(
*
p
==
'\t'
))
p
++
;
EBX_reg
(
context
)
=
0x80
+
(
p
-
pTask
->
pdb
.
cmdLine
);
}
ECX_reg
(
context
)
=
pinstance
->
stacktop
;
EDX_reg
(
context
)
=
pTask
->
nCmdShow
;
ESI_reg
(
context
)
=
(
DWORD
)
pTask
->
hPrevInstance
;
EDI_reg
(
context
)
=
(
DWORD
)
pTask
->
hInstance
;
ES_reg
(
context
)
=
(
WORD
)
pTask
->
hPDB
;
}
...
...
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