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
8e248c06
Commit
8e248c06
authored
Nov 15, 2009
by
Eric Pouech
Committed by
Alexandre Julliard
Nov 16, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi.exe: No longer use 16bit abort procs inside the DC structure.
parent
6fab1e86
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
129 additions
and
43 deletions
+129
-43
gdi16.c
dlls/gdi32/gdi16.c
+129
-1
gdi_private.h
dlls/gdi32/gdi_private.h
+0
-1
printdrv16.c
dlls/gdi32/printdrv16.c
+0
-41
No files found.
dlls/gdi32/gdi16.c
View file @
8e248c06
...
...
@@ -34,6 +34,127 @@ WINE_DEFAULT_DEBUG_CHANNEL(gdi);
#define HGDIOBJ_32(handle16) ((HGDIOBJ)(ULONG_PTR)(handle16))
#define HGDIOBJ_16(handle32) ((HGDIOBJ16)(ULONG_PTR)(handle32))
/*
* ############################################################################
*/
#include <pshpack1.h>
#define GDI_MAX_THUNKS 32
static
struct
gdi_thunk
{
BYTE
popl_eax
;
/* popl %eax (return address) */
BYTE
pushl_pfn16
;
/* pushl pfn16 */
DWORD
pfn16
;
/* pfn16 */
BYTE
pushl_eax
;
/* pushl %eax */
BYTE
jmp
;
/* ljmp GDI_Callback3216 */
DWORD
callback
;
HDC16
hdc
;
}
*
GDI_Thunks
;
#include <poppack.h>
/**********************************************************************
* GDI_Callback3216
*/
static
BOOL
CALLBACK
GDI_Callback3216
(
DWORD
pfn16
,
HDC
hdc
,
INT
code
)
{
if
(
pfn16
)
{
WORD
args
[
2
];
DWORD
ret
;
args
[
1
]
=
HDC_16
(
hdc
);
args
[
0
]
=
code
;
WOWCallback16Ex
(
pfn16
,
WCB16_PASCAL
,
sizeof
(
args
),
args
,
&
ret
);
return
LOWORD
(
ret
);
}
return
TRUE
;
}
/******************************************************************
* GDI_AddThunk
*
*/
static
struct
gdi_thunk
*
GDI_AddThunk
(
HDC16
dc16
,
ABORTPROC16
pfn16
)
{
struct
gdi_thunk
*
thunk
;
if
(
!
GDI_Thunks
)
{
GDI_Thunks
=
VirtualAlloc
(
NULL
,
GDI_MAX_THUNKS
*
sizeof
(
*
GDI_Thunks
),
MEM_COMMIT
,
PAGE_EXECUTE_READWRITE
);
if
(
!
GDI_Thunks
)
{
return
NULL
;
}
for
(
thunk
=
GDI_Thunks
;
thunk
<
&
GDI_Thunks
[
GDI_MAX_THUNKS
];
thunk
++
)
{
thunk
->
popl_eax
=
0x58
;
/* popl %eax */
thunk
->
pushl_pfn16
=
0x68
;
/* pushl pfn16 */
thunk
->
pfn16
=
0
;
thunk
->
pushl_eax
=
0x50
;
/* pushl %eax */
thunk
->
jmp
=
0xe9
;
/* jmp GDI_Callback3216 */
thunk
->
callback
=
(
char
*
)
GDI_Callback3216
-
(
char
*
)(
&
thunk
->
callback
+
1
);
}
}
for
(
thunk
=
GDI_Thunks
;
thunk
<
&
GDI_Thunks
[
GDI_MAX_THUNKS
];
thunk
++
)
{
if
(
thunk
->
pfn16
==
0
)
{
thunk
->
pfn16
=
(
DWORD
)
pfn16
;
thunk
->
hdc
=
dc16
;
return
thunk
;
}
}
FIXME
(
"Out of mmdrv-thunks. Bump GDI_MAX_THUNKS
\n
"
);
return
NULL
;
}
/******************************************************************
* GDI_DeleteThunk
*/
static
void
GDI_DeleteThunk
(
struct
gdi_thunk
*
thunk
)
{
thunk
->
pfn16
=
0
;
}
/******************************************************************
* GDI_FindThunk
*/
static
struct
gdi_thunk
*
GDI_FindThunk
(
HDC16
hdc
)
{
struct
gdi_thunk
*
thunk
;
for
(
thunk
=
GDI_Thunks
;
thunk
<
&
GDI_Thunks
[
GDI_MAX_THUNKS
];
thunk
++
)
{
if
(
thunk
->
hdc
==
hdc
)
return
thunk
;
}
return
NULL
;
}
/**********************************************************************
* SetAbortProc (GDI.381)
*/
INT16
WINAPI
SetAbortProc16
(
HDC16
hdc16
,
ABORTPROC16
abrtprc
)
{
struct
gdi_thunk
*
thunk
;
thunk
=
GDI_AddThunk
(
hdc16
,
abrtprc
);
if
(
!
thunk
)
return
FALSE
;
if
(
!
SetAbortProc
(
HDC_32
(
hdc16
),
(
ABORTPROC
)
thunk
))
{
GDI_DeleteThunk
(
thunk
);
return
FALSE
;
}
return
TRUE
;
}
/*
* ############################################################################
*/
struct
callback16_info
{
FARPROC16
proc
;
...
...
@@ -1167,7 +1288,14 @@ HBRUSH16 WINAPI CreateSolidBrush16( COLORREF color )
*/
BOOL16
WINAPI
DeleteDC16
(
HDC16
hdc
)
{
return
DeleteDC
(
HDC_32
(
hdc
)
);
if
(
DeleteDC
(
HDC_32
(
hdc
)
))
{
struct
gdi_thunk
*
thunk
;
if
((
thunk
=
GDI_FindThunk
(
hdc
)))
GDI_DeleteThunk
(
thunk
);
return
TRUE
;
}
return
FALSE
;
}
...
...
dlls/gdi32/gdi_private.h
View file @
8e248c06
...
...
@@ -302,7 +302,6 @@ typedef struct tagDC
INT
MapMode
;
INT
GraphicsMode
;
/* Graphics mode */
ABORTPROC
pAbortProc
;
/* AbortProc for Printing */
ABORTPROC16
pAbortProc16
;
INT
CursPosX
;
/* Current position */
INT
CursPosY
;
INT
ArcDirection
;
...
...
dlls/gdi32/printdrv16.c
View file @
8e248c06
...
...
@@ -82,47 +82,6 @@ BOOL16 WINAPI QueryAbort16(HDC16 hdc16, INT16 reserved)
}
/**********************************************************************
* call_abort_proc16
*/
static
BOOL
CALLBACK
call_abort_proc16
(
HDC
hdc
,
INT
code
)
{
ABORTPROC16
proc16
;
DC
*
dc
=
get_dc_ptr
(
hdc
);
if
(
!
dc
)
return
FALSE
;
proc16
=
dc
->
pAbortProc16
;
release_dc_ptr
(
dc
);
if
(
proc16
)
{
WORD
args
[
2
];
DWORD
ret
;
args
[
1
]
=
HDC_16
(
hdc
);
args
[
0
]
=
code
;
WOWCallback16Ex
(
(
DWORD
)
proc16
,
WCB16_PASCAL
,
sizeof
(
args
),
args
,
&
ret
);
return
LOWORD
(
ret
);
}
return
TRUE
;
}
/**********************************************************************
* SetAbortProc (GDI.381)
*/
INT16
WINAPI
SetAbortProc16
(
HDC16
hdc16
,
ABORTPROC16
abrtprc
)
{
HDC
hdc
=
HDC_32
(
hdc16
);
DC
*
dc
=
get_dc_ptr
(
hdc
);
if
(
!
dc
)
return
FALSE
;
dc
->
pAbortProc16
=
abrtprc
;
dc
->
pAbortProc
=
call_abort_proc16
;
release_dc_ptr
(
dc
);
return
TRUE
;
}
/****************** misc. printer related functions */
/*
...
...
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