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
4d057619
Commit
4d057619
authored
May 11, 2000
by
Bernd Herd
Committed by
Alexandre Julliard
May 11, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure hInstance is a proper global handle and not a selector
value.
parent
07723941
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
12 deletions
+15
-12
module.c
loader/ne/module.c
+1
-1
segment.c
loader/ne/segment.c
+2
-3
task.c
loader/task.c
+12
-8
No files found.
loader/ne/module.c
View file @
4d057619
...
...
@@ -1206,7 +1206,7 @@ BOOL NE_InitProcess( NE_MODULE *pModule )
if
(
!
(
sp
=
pModule
->
sp
))
sp
=
pSegTable
[
pModule
->
ss
-
1
].
minsize
+
pModule
->
stack_size
;
sp
&=
~
1
;
sp
-=
sizeof
(
STACK16FRAME
);
pTask
->
teb
->
cur_stack
=
PTR_SEG_OFF_TO_SEGPTR
(
hInstance
,
sp
);
pTask
->
teb
->
cur_stack
=
PTR_SEG_OFF_TO_SEGPTR
(
GlobalHandleToSel16
(
hInstance
)
,
sp
);
SYSLEVEL_LeaveWin16Lock
();
...
...
loader/ne/segment.c
View file @
4d057619
...
...
@@ -576,7 +576,7 @@ static VOID NE_GetDLLInitParams( NE_MODULE *pModule,
}
}
*
hInst
=
*
ds
?
*
ds
:
pModule
->
self
;
*
hInst
=
*
ds
?
GlobalHandle16
(
*
ds
)
:
pModule
->
self
;
}
...
...
@@ -834,8 +834,7 @@ HINSTANCE16 NE_GetInstance( NE_MODULE *pModule )
{
SEGTABLEENTRY
*
pSeg
;
pSeg
=
NE_SEG_TABLE
(
pModule
)
+
pModule
->
dgroup
-
1
;
return
SEL
(
pSeg
->
hSeg
);
return
pSeg
->
hSeg
;
}
}
...
...
loader/task.c
View file @
4d057619
...
...
@@ -716,7 +716,7 @@ void WINAPI InitTask16( CONTEXT86 *context )
/* Initialize the local heap */
if
(
CX_reg
(
context
)
)
LocalInit16
(
pTask
->
hInstance
,
0
,
CX_reg
(
context
)
);
LocalInit16
(
GlobalHandleToSel16
(
pTask
->
hInstance
)
,
0
,
CX_reg
(
context
)
);
/* Initialize implicitly loaded DLLs */
NE_InitializeDLLs
(
pTask
->
hModule
);
...
...
@@ -928,6 +928,9 @@ FARPROC16 WINAPI MakeProcInstance16( FARPROC16 func, HANDLE16 hInstance )
{
BYTE
*
thunk
,
*
lfunc
;
SEGPTR
thunkaddr
;
WORD
hInstanceSelector
;
hInstanceSelector
=
GlobalHandleToSel16
(
hInstance
);
TRACE
(
"(%08lx, %04x);"
,
(
DWORD
)
func
,
hInstance
);
...
...
@@ -948,7 +951,7 @@ FARPROC16 WINAPI MakeProcInstance16( FARPROC16 func, HANDLE16 hInstance )
}
}
if
(
(
CURRENT_DS
!=
hInstance
)
if
(
(
CURRENT_DS
!=
hInstance
Selector
)
&&
(
hInstance
!=
0
)
&&
(
hInstance
!=
0xffff
)
)
{
...
...
@@ -961,7 +964,8 @@ FARPROC16 WINAPI MakeProcInstance16( FARPROC16 func, HANDLE16 hInstance )
* We used to set hInstance to GetTaskDS16(), but this should be wrong
* as CURRENT_DS provides the DSEG value we need.
* ("calling" DS, *not* "task" DS !) */
hInstance
=
CURRENT_DS
;
hInstanceSelector
=
CURRENT_DS
;
hInstance
=
GlobalHandle16
(
hInstanceSelector
);
/* no thunking for DLLs */
if
(
NE_GetPtr
(
FarGetOwner16
(
hInstance
))
->
flags
&
NE_FFLAGS_LIBMODULE
)
...
...
@@ -979,10 +983,10 @@ FARPROC16 WINAPI MakeProcInstance16( FARPROC16 func, HANDLE16 hInstance )
)
{
FIXME
(
"This was the (in)famous
\"
thunk useless
\"
warning. We thought we have to overwrite with nop;nop;, but this isn't true.
\n
"
);
}
*
thunk
++
=
0xb8
;
/* movw instance, %ax */
*
thunk
++
=
(
BYTE
)(
hInstance
&
0xff
);
*
thunk
++
=
(
BYTE
)(
hInstance
>>
8
);
*
thunk
++
=
(
BYTE
)(
hInstance
Selector
&
0xff
);
*
thunk
++
=
(
BYTE
)(
hInstance
Selector
>>
8
);
*
thunk
++
=
0xea
;
/* ljmp func */
*
(
DWORD
*
)
thunk
=
(
DWORD
)
func
;
return
(
FARPROC16
)
thunkaddr
;
...
...
@@ -1433,7 +1437,7 @@ HINSTANCE16 WINAPI GetTaskDS16(void)
TDB
*
pTask
;
if
(
!
(
pTask
=
(
TDB
*
)
GlobalLock16
(
GetCurrentTask
()
)))
return
0
;
return
pTask
->
hInstance
;
return
GlobalHandleToSel16
(
pTask
->
hInstance
)
;
}
/***********************************************************************
...
...
@@ -1631,7 +1635,7 @@ BOOL16 WINAPI TaskNext16( TASKENTRY *lpte )
if
(
!
lpte
->
hNext
)
return
FALSE
;
pTask
=
(
TDB
*
)
GlobalLock16
(
lpte
->
hNext
);
if
(
!
pTask
||
pTask
->
magic
!=
TDB_MAGIC
)
return
FALSE
;
pInstData
=
(
INSTANCEDATA
*
)
PTR_SEG_OFF_TO_LIN
(
pTask
->
hInstance
,
0
);
pInstData
=
(
INSTANCEDATA
*
)
PTR_SEG_OFF_TO_LIN
(
GlobalHandleToSel16
(
pTask
->
hInstance
)
,
0
);
lpte
->
hTask
=
lpte
->
hNext
;
lpte
->
hTaskParent
=
pTask
->
hParent
;
lpte
->
hInst
=
pTask
->
hInstance
;
...
...
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