Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
f86aab84
Commit
f86aab84
authored
Sep 20, 1999
by
Ulrich Weigand
Committed by
Alexandre Julliard
Sep 20, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DC hook proc thunk management simplified.
parent
974fd10c
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
43 additions
and
11 deletions
+43
-11
gdi.spec
if1632/gdi.spec
+2
-2
gdi.h
include/gdi.h
+5
-1
.cvsignore
objects/.cvsignore
+1
-0
Makefile.in
objects/Makefile.in
+2
-0
clipping.c
objects/clipping.c
+2
-2
dc.c
objects/dc.c
+26
-5
dce.c
windows/dce.c
+5
-1
No files found.
if1632/gdi.spec
View file @
f86aab84
...
...
@@ -157,8 +157,8 @@ file gdi.exe
180 pascal16 SetDCState(word word) SetDCState16
181 pascal16 RectInRegionOld(word ptr) RectInRegion16
188 stub GetTextExtentEx
190 pascal16 SetDCHook(word segptr long)
THUNK_
SetDCHook
191 pascal GetDCHook(word ptr)
THUNK_
GetDCHook
190 pascal16 SetDCHook(word segptr long) SetDCHook
191 pascal GetDCHook(word ptr) GetDCHook
192 pascal16 SetHookFlags(word word) SetHookFlags16
193 pascal16 SetBoundsRect(word ptr word) SetBoundsRect16
194 pascal16 GetBoundsRect(word ptr word) GetBoundsRect16
...
...
include/gdi.h
View file @
f86aab84
...
...
@@ -137,6 +137,9 @@ typedef struct
BOOL
vport2WorldValid
;
/* Is xformVport2World valid? */
}
WIN_DC_INFO
;
typedef
BOOL16
(
CALLBACK
*
DCHOOKPROC
)(
HDC16
,
WORD
,
DWORD
,
LPARAM
);
typedef
struct
tagDC
{
GDIOBJHDR
header
;
...
...
@@ -145,7 +148,8 @@ typedef struct tagDC
void
*
physDev
;
/* Physical device (driver-specific) */
INT
saveLevel
;
DWORD
dwHookData
;
FARPROC16
hookProc
;
FARPROC16
hookProc
;
/* the original SEGPTR ... */
DCHOOKPROC
hookThunk
;
/* ... and the thunk to call it */
INT
wndOrgX
;
/* Window origin */
INT
wndOrgY
;
...
...
objects/.cvsignore
View file @
f86aab84
Makefile
dc.glue.c
objects/Makefile.in
View file @
f86aab84
...
...
@@ -24,6 +24,8 @@ C_SRCS = \
region.c
\
text.c
GLUE
=
dc.c
all
:
$(MODULE).o
@MAKE_RULES@
...
...
objects/clipping.c
View file @
f86aab84
...
...
@@ -15,8 +15,8 @@ DECLARE_DEBUG_CHANNEL(region)
#define UPDATE_DIRTY_DC(dc) \
do { \
if ((dc)->hook
Proc
&& !((dc)->w.flags & (DC_SAVED | DC_MEMORY))) \
(dc)->hook
Proc
( (dc)->hSelf, DCHC_INVALIDVISRGN, (dc)->dwHookData, 0 ); \
if ((dc)->hook
Thunk
&& !((dc)->w.flags & (DC_SAVED | DC_MEMORY))) \
(dc)->hook
Thunk
( (dc)->hSelf, DCHC_INVALIDVISRGN, (dc)->dwHookData, 0 ); \
} while(0)
...
...
objects/dc.c
View file @
f86aab84
...
...
@@ -99,6 +99,7 @@ DC *DC_AllocDC( const DC_FUNCTIONS *funcs )
dc
->
saveLevel
=
0
;
dc
->
dwHookData
=
0L
;
dc
->
hookProc
=
NULL
;
dc
->
hookThunk
=
NULL
;
dc
->
wndOrgX
=
0
;
dc
->
wndOrgY
=
0
;
dc
->
wndExtX
=
1
;
...
...
@@ -680,8 +681,8 @@ BOOL WINAPI DeleteDC( HDC hdc )
TRACE
(
"%04x
\n
"
,
hdc
);
/* Call hook procedure to check whether is it OK to delete this DC */
if
(
dc
->
hook
Proc
&&
!
(
dc
->
w
.
flags
&
(
DC_SAVED
|
DC_MEMORY
))
&&
dc
->
hook
Proc
(
hdc
,
DCHC_DELETEDC
,
dc
->
dwHookData
,
0
)
==
FALSE
)
if
(
dc
->
hook
Thunk
&&
!
(
dc
->
w
.
flags
&
(
DC_SAVED
|
DC_MEMORY
))
&&
dc
->
hook
Thunk
(
hdc
,
DCHC_DELETEDC
,
dc
->
dwHookData
,
0
)
==
FALSE
)
{
GDI_HEAP_UNLOCK
(
hdc
);
return
FALSE
;
...
...
@@ -710,6 +711,7 @@ BOOL WINAPI DeleteDC( HDC hdc )
if
(
dc
->
w
.
hVisRgn
)
DeleteObject
(
dc
->
w
.
hVisRgn
);
if
(
dc
->
w
.
hGCClipRgn
)
DeleteObject
(
dc
->
w
.
hGCClipRgn
);
if
(
dc
->
w
.
pAbortProc
)
THUNK_Free
(
(
FARPROC
)
dc
->
w
.
pAbortProc
);
if
(
dc
->
hookThunk
)
THUNK_Free
(
(
FARPROC
)
dc
->
hookThunk
);
PATH_DestroyGdiPath
(
&
dc
->
w
.
path
);
return
GDI_FreeObject
(
hdc
);
...
...
@@ -1201,16 +1203,35 @@ BOOL WINAPI CombineTransform( LPXFORM xformResult, const XFORM *xform1,
/***********************************************************************
* SetDCHook (GDI.190)
*/
/* ### start build ### */
extern
WORD
CALLBACK
GDI_CallTo16_word_wwll
(
FARPROC16
,
WORD
,
WORD
,
LONG
,
LONG
);
/* ### stop build ### */
BOOL16
WINAPI
SetDCHook
(
HDC16
hdc
,
FARPROC16
hookProc
,
DWORD
dwHookData
)
{
DC
*
dc
=
(
DC
*
)
GDI_GetObjPtr
(
hdc
,
DC_MAGIC
);
if
(
!
dc
)
return
FALSE
;
TRACE
(
"hookProc %08x, default is %08x
\n
"
,
(
UINT
)
hookProc
,
(
UINT
)
DCHook16
);
/*
* Note: We store the original SEGPTR 'hookProc' as we need to be
* able to return it verbatim in GetDCHook,
*
* On the other hand, we still call THUNK_Alloc and store the
* 32-bit thunk into another DC member, because THUNK_Alloc
* recognizes the (typical) case that the 'hookProc' is indeed
* the 16-bit API entry point of a built-in routine (e.g. DCHook16)
*
* We could perform that test every time the hook is about to
* be called (or else we could live with the 32->16->32 detour),
* but this way is the most efficient ...
*/
if
(
!
dc
)
return
FALSE
;
dc
->
hookProc
=
hookProc
;
dc
->
dwHookData
=
dwHookData
;
THUNK_Free
(
(
FARPROC
)
dc
->
hookThunk
);
dc
->
hookThunk
=
(
DCHOOKPROC
)
THUNK_Alloc
(
hookProc
,
(
RELAY
)
GDI_CallTo16_word_wwll
);
GDI_HEAP_UNLOCK
(
hdc
);
return
TRUE
;
}
...
...
windows/dce.c
View file @
f86aab84
...
...
@@ -27,7 +27,9 @@
#include "region.h"
#include "heap.h"
#include "local.h"
#include "module.h"
#include "debugtools.h"
#include "wine/winbase16.h"
#include "wine/winuser16.h"
DEFAULT_DEBUG_CHANNEL
(
dc
)
...
...
@@ -71,6 +73,7 @@ static void DCE_DumpCache(void)
*/
DCE
*
DCE_AllocDCE
(
HWND
hWnd
,
DCE_TYPE
type
)
{
FARPROC16
hookProc
;
DCE
*
dce
;
WND
*
wnd
;
...
...
@@ -85,7 +88,8 @@ DCE *DCE_AllocDCE( HWND hWnd, DCE_TYPE type )
/* store DCE handle in DC hook data field */
SetDCHook
(
dce
->
hDC
,
(
FARPROC16
)
DCHook16
,
(
DWORD
)
dce
);
hookProc
=
(
FARPROC16
)
NE_GetEntryPoint
(
GetModuleHandle16
(
"USER"
),
362
);
SetDCHook
(
dce
->
hDC
,
hookProc
,
(
DWORD
)
dce
);
dce
->
hwndCurrent
=
hWnd
;
dce
->
hClipRgn
=
0
;
...
...
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