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
b4860a8c
Commit
b4860a8c
authored
Jul 24, 1999
by
Ulrich Weigand
Committed by
Alexandre Julliard
Jul 24, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Always retrieve Callout routines using GetProcAddress().
parent
46166178
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
9 deletions
+26
-9
thunk.c
if1632/thunk.c
+26
-9
No files found.
if1632/thunk.c
View file @
b4860a8c
...
...
@@ -10,6 +10,7 @@
#include "task.h"
#include "hook.h"
#include "callback.h"
#include "builtin16.h"
#include "user.h"
#include "heap.h"
#include "neexe.h"
...
...
@@ -846,17 +847,35 @@ WORD WINAPI WIN16_CreateSystemTimer( WORD rate, FARPROC16 proc )
}
/***********************************************************************
* THUNK_GetCalloutThunk
*
* Retrieve API entry point with given name from given module.
* If module is builtin, return the 32-bit entry point, otherwise
* create a 32->16 thunk to the 16-bit entry point, using the
* given relay code.
*
*/
static
FARPROC
THUNK_GetCalloutThunk
(
NE_MODULE
*
pModule
,
LPSTR
name
,
RELAY
relay
)
{
FARPROC16
proc
=
WIN32_GetProcAddress16
(
pModule
->
self
,
name
);
if
(
!
proc
)
return
0
;
if
(
pModule
->
flags
&
NE_FFLAGS_BUILTIN
)
return
(
FARPROC
)((
ENTRYPOINT16
*
)
PTR_SEG_TO_LIN
(
proc
))
->
target
;
else
return
(
FARPROC
)
THUNK_Alloc
(
proc
,
relay
);
}
/***********************************************************************
* THUNK_InitCallout
*/
void
THUNK_InitCallout
(
void
)
{
HMODULE
hModule
;
WINE_MODREF
*
wm
;
NE_MODULE
*
pModule
;
hModule
=
GetModuleHandleA
(
"USER32"
);
wm
=
MODULE32_LookupHMODULE
(
hModule
);
if
(
wm
&&
!
(
wm
->
flags
&
WINE_MODREF_INTERNAL
)
)
if
(
hModule
)
{
#define GETADDR( var, name ) \
*(FARPROC *)&Callout.##var = GetProcAddress( hModule, name )
...
...
@@ -880,14 +899,12 @@ void THUNK_InitCallout(void)
#undef GETADDR
}
hModule
=
GetModuleHandle16
(
"USER"
);
pModule
=
NE_GetPtr
(
hModule
);
if
(
pModule
&&
!
(
pModule
->
flags
&
NE_FFLAGS_BUILTIN
)
)
pModule
=
NE_GetPtr
(
GetModuleHandle16
(
"USER"
)
);
if
(
pModule
)
{
#define GETADDR( var, name, thk ) \
*(FARPROC *)&Callout.##var = (FARPROC) \
THUNK_Alloc( WIN32_GetProcAddress16( hModule, name ), \
(RELAY)THUNK_CallTo16_##thk )
*(FARPROC *)&Callout.##var = THUNK_GetCalloutThunk( pModule, name, \
(RELAY)THUNK_CallTo16_##thk )
GETADDR
(
PeekMessage16
,
"PeekMessage"
,
word_lwwww
);
GETADDR
(
GetMessage16
,
"GetMessage"
,
word_lwww
);
...
...
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