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
ab293478
Commit
ab293478
authored
May 30, 2007
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
May 30, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Make SetDCHook 64-bit safe.
parent
a1e8343e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
17 deletions
+16
-17
dc.c
dlls/gdi32/dc.c
+7
-8
gdi_private.h
dlls/gdi32/gdi_private.h
+1
-1
dce.c
dlls/winex11.drv/dce.c
+6
-6
wingdi16.h
include/wine/wingdi16.h
+2
-2
No files found.
dlls/gdi32/dc.c
View file @
ab293478
...
...
@@ -166,9 +166,9 @@ DC *DC_GetDCUpdate( HDC hdc )
dc
->
flags
&=
~
DC_DIRTY
;
if
(
proc
)
{
DWORD
data
=
dc
->
dwHookData
;
DWORD
_PTR
data
=
dc
->
dwHookData
;
GDI_ReleaseObj
(
hdc
);
proc
(
HDC_16
(
hdc
)
,
DCHC_INVALIDVISRGN
,
data
,
0
);
proc
(
hdc
,
DCHC_INVALIDVISRGN
,
data
,
0
);
if
(
!
(
dc
=
DC_GetDCPtr
(
hdc
)))
break
;
/* otherwise restart the loop in case it became dirty again in the meantime */
}
...
...
@@ -791,9 +791,9 @@ BOOL WINAPI DeleteDC( HDC hdc )
if
(
dc
->
hookThunk
)
{
DCHOOKPROC
proc
=
dc
->
hookThunk
;
DWORD
data
=
dc
->
dwHookData
;
DWORD
_PTR
data
=
dc
->
dwHookData
;
GDI_ReleaseObj
(
hdc
);
if
(
!
proc
(
HDC_16
(
hdc
)
,
DCHC_DELETEDC
,
data
,
0
))
return
FALSE
;
if
(
!
proc
(
hdc
,
DCHC_DELETEDC
,
data
,
0
))
return
FALSE
;
if
(
!
(
dc
=
DC_GetDCPtr
(
hdc
)))
return
TRUE
;
/* deleted by the hook */
}
...
...
@@ -1328,7 +1328,7 @@ BOOL WINAPI CombineTransform( LPXFORM xformResult, const XFORM *xform1,
*
* Note: this doesn't exist in Win32, we add it here because user32 needs it.
*/
BOOL
WINAPI
SetDCHook
(
HDC
hdc
,
DCHOOKPROC
hookProc
,
DWORD
dwHookData
)
BOOL
WINAPI
SetDCHook
(
HDC
hdc
,
DCHOOKPROC
hookProc
,
DWORD
_PTR
dwHookData
)
{
DC
*
dc
=
GDI_GetObjPtr
(
hdc
,
DC_MAGIC
);
...
...
@@ -1345,19 +1345,18 @@ BOOL WINAPI SetDCHook( HDC hdc, DCHOOKPROC hookProc, DWORD dwHookData )
/* relay function to call the 16-bit DC hook proc */
static
BOOL
16
WINAPI
call_dc_hook16
(
HDC16
hdc16
,
WORD
code
,
DWORD
data
,
LPARAM
lParam
)
static
BOOL
WINAPI
call_dc_hook16
(
HDC
hdc
,
WORD
code
,
DWORD_PTR
data
,
LPARAM
lParam
)
{
WORD
args
[
6
];
DWORD
ret
;
FARPROC16
proc
=
NULL
;
HDC
hdc
=
HDC_32
(
hdc16
);
DC
*
dc
=
DC_GetDCPtr
(
hdc
);
if
(
!
dc
)
return
FALSE
;
proc
=
dc
->
hookProc
;
GDI_ReleaseObj
(
hdc
);
if
(
!
proc
)
return
FALSE
;
args
[
5
]
=
hdc16
;
args
[
5
]
=
HDC_16
(
hdc
)
;
args
[
4
]
=
code
;
args
[
3
]
=
HIWORD
(
data
);
args
[
2
]
=
LOWORD
(
data
);
...
...
dlls/gdi32/gdi_private.h
View file @
ab293478
...
...
@@ -271,7 +271,7 @@ typedef struct tagDC
PHYSDEV
physDev
;
/* Physical device (driver-specific) */
INT
saveLevel
;
HDC
saved_dc
;
DWORD
dwHookData
;
DWORD
_PTR
dwHookData
;
FARPROC16
hookProc
;
/* the original SEGPTR ... */
DCHOOKPROC
hookThunk
;
/* ... and the thunk to call it */
...
...
dlls/winex11.drv/dce.c
View file @
ab293478
...
...
@@ -51,7 +51,7 @@ struct dce
static
struct
list
dce_list
=
LIST_INIT
(
dce_list
);
static
BOOL
16
CALLBACK
dc_hook
(
HDC16
hDC
,
WORD
code
,
DWORD
data
,
LPARAM
lParam
);
static
BOOL
CALLBACK
dc_hook
(
HDC
hDC
,
WORD
code
,
DWORD_PTR
data
,
LPARAM
lParam
);
static
CRITICAL_SECTION
dce_section
;
static
CRITICAL_SECTION_DEBUG
critsect_debug
=
...
...
@@ -224,7 +224,7 @@ static struct dce *alloc_cache_dce(void)
SaveDC
(
dce
->
hdc
);
/* store DCE handle in DC hook data field */
SetDCHook
(
dce
->
hdc
,
dc_hook
,
(
DWORD
)
dce
);
SetDCHook
(
dce
->
hdc
,
dc_hook
,
(
DWORD
_PTR
)
dce
);
dce
->
hwnd
=
0
;
dce
->
clip_rgn
=
0
;
...
...
@@ -290,7 +290,7 @@ void alloc_window_dce( struct x11drv_win_data *data )
/* store DCE handle in DC hook data field */
SetDCHook
(
dce
->
hdc
,
dc_hook
,
(
DWORD
)
dce
);
SetDCHook
(
dce
->
hdc
,
dc_hook
,
(
DWORD
_PTR
)
dce
);
dce
->
hwnd
=
data
->
hwnd
;
dce
->
clip_rgn
=
0
;
...
...
@@ -593,15 +593,15 @@ INT X11DRV_ReleaseDC( HWND hwnd, HDC hdc, BOOL end_paint )
*
* See "Undoc. Windows" for hints (DC, SetDCHook, SetHookFlags)..
*/
static
BOOL
16
CALLBACK
dc_hook
(
HDC16
hDC
,
WORD
code
,
DWORD
data
,
LPARAM
lParam
)
static
BOOL
CALLBACK
dc_hook
(
HDC
hDC
,
WORD
code
,
DWORD_PTR
data
,
LPARAM
lParam
)
{
BOOL
retv
=
TRUE
;
struct
dce
*
dce
=
(
struct
dce
*
)
data
;
TRACE
(
"hDC = %
04x, %i
\n
"
,
hDC
,
code
);
TRACE
(
"hDC = %
p, %u
\n
"
,
hDC
,
code
);
if
(
!
dce
)
return
0
;
assert
(
HDC_16
(
dce
->
hdc
)
==
hDC
);
assert
(
dce
->
hdc
==
hDC
);
switch
(
code
)
{
...
...
include/wine/wingdi16.h
View file @
ab293478
...
...
@@ -269,7 +269,7 @@ typedef struct
FONTSIGNATURE
ntmFontSig
;
}
NEWTEXTMETRICEX16
,
*
LPNEWTEXTMETRICEX16
;
typedef
BOOL
16
(
CALLBACK
*
DCHOOKPROC
)(
HDC16
,
WORD
,
DWORD
,
LPARAM
);
typedef
BOOL
(
CALLBACK
*
DCHOOKPROC
)(
HDC
,
WORD
,
DWORD_PTR
,
LPARAM
);
typedef
INT16
(
CALLBACK
*
FONTENUMPROC16
)(
SEGPTR
,
SEGPTR
,
UINT16
,
LPARAM
);
typedef
VOID
(
CALLBACK
*
LINEDDAPROC16
)(
INT16
,
INT16
,
LPARAM
);
typedef
INT16
(
CALLBACK
*
GOBJENUMPROC16
)(
SEGPTR
,
LPARAM
);
...
...
@@ -577,7 +577,7 @@ COLORREF WINAPI SetBkColor16(HDC16,COLORREF);
INT16
WINAPI
SetBkMode16
(
HDC16
,
INT16
);
UINT16
WINAPI
SetBoundsRect16
(
HDC16
,
const
RECT16
*
,
UINT16
);
DWORD
WINAPI
SetBrushOrg16
(
HDC16
,
INT16
,
INT16
);
BOOL
WINAPI
SetDCHook
(
HDC
,
DCHOOKPROC
,
DWORD
);
BOOL
WINAPI
SetDCHook
(
HDC
,
DCHOOKPROC
,
DWORD
_PTR
);
BOOL16
WINAPI
SetDCHook16
(
HDC16
,
FARPROC16
,
DWORD
);
DWORD
WINAPI
SetDCOrg16
(
HDC16
,
INT16
,
INT16
);
VOID
WINAPI
SetDCState16
(
HDC16
,
HDC16
);
...
...
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