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
58c6bab9
Commit
58c6bab9
authored
Sep 24, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Don't hold the GDI lock while calling the driver printer functions.
parent
b12a782e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
39 deletions
+31
-39
driver.c
dlls/gdi32/driver.c
+9
-11
printdrv.c
dlls/gdi32/printdrv.c
+22
-28
No files found.
dlls/gdi32/driver.c
View file @
58c6bab9
...
...
@@ -497,7 +497,6 @@ INT WINAPI GDI_CallExtDeviceMode16( HWND hwnd,
HDC
hdc
;
DC
*
dc
;
INT
ret
=
-
1
;
INT
(
*
pExtDeviceMode
)(
LPSTR
,
HWND
,
LPDEVMODEA
,
LPSTR
,
LPSTR
,
LPDEVMODEA
,
LPSTR
,
DWORD
);
TRACE
(
"(%p, %p, %s, %s, %p, %s, %d)
\n
"
,
hwnd
,
lpdmOutput
,
lpszDevice
,
lpszPort
,
lpdmInput
,
lpszProfile
,
fwMode
);
...
...
@@ -511,13 +510,12 @@ INT WINAPI GDI_CallExtDeviceMode16( HWND hwnd,
if
(
!
(
hdc
=
CreateICA
(
buf
,
lpszDevice
,
lpszPort
,
NULL
)))
return
-
1
;
if
((
dc
=
DC_GetDCP
tr
(
hdc
)))
if
((
dc
=
get_dc_p
tr
(
hdc
)))
{
pExtDeviceMode
=
dc
->
funcs
->
pExtDeviceMode
;
DC_ReleaseDCPtr
(
dc
);
if
(
pExtDeviceMode
)
ret
=
pExtDeviceMode
(
buf
,
hwnd
,
lpdmOutput
,
lpszDevice
,
lpszPort
,
lpdmInput
,
lpszProfile
,
fwMode
);
if
(
dc
->
funcs
->
pExtDeviceMode
)
ret
=
dc
->
funcs
->
pExtDeviceMode
(
buf
,
hwnd
,
lpdmOutput
,
lpszDevice
,
lpszPort
,
lpdmInput
,
lpszProfile
,
fwMode
);
release_dc_ptr
(
dc
);
}
DeleteDC
(
hdc
);
return
ret
;
...
...
@@ -566,12 +564,12 @@ DWORD WINAPI GDI_CallDeviceCapabilities16( LPCSTR lpszDevice, LPCSTR lpszPort,
if
(
!
(
hdc
=
CreateICA
(
buf
,
lpszDevice
,
lpszPort
,
NULL
)))
return
-
1
;
if
((
dc
=
DC_GetDCP
tr
(
hdc
)))
if
((
dc
=
get_dc_p
tr
(
hdc
)))
{
if
(
dc
->
funcs
->
pDeviceCapabilities
)
ret
=
dc
->
funcs
->
pDeviceCapabilities
(
buf
,
lpszDevice
,
lpszPort
,
fwCapability
,
lpszOutput
,
lpdm
);
DC_ReleaseDCP
tr
(
dc
);
release_dc_p
tr
(
dc
);
}
DeleteDC
(
hdc
);
return
ret
;
...
...
@@ -695,12 +693,12 @@ INT WINAPI ExtEscape( HDC hdc, INT nEscape, INT cbInput, LPCSTR lpszInData,
INT
cbOutput
,
LPSTR
lpszOutData
)
{
INT
ret
=
0
;
DC
*
dc
=
DC_GetDCP
tr
(
hdc
);
DC
*
dc
=
get_dc_p
tr
(
hdc
);
if
(
dc
)
{
if
(
dc
->
funcs
->
pExtEscape
)
ret
=
dc
->
funcs
->
pExtEscape
(
dc
->
physDev
,
nEscape
,
cbInput
,
lpszInData
,
cbOutput
,
lpszOutData
);
DC_ReleaseDCP
tr
(
dc
);
release_dc_p
tr
(
dc
);
}
return
ret
;
}
...
...
dlls/gdi32/printdrv.c
View file @
58c6bab9
...
...
@@ -71,7 +71,7 @@ static const char Printers[] = "System\\CurrentControlSet\\Control\\Pri
INT
WINAPI
StartDocW
(
HDC
hdc
,
const
DOCINFOW
*
doc
)
{
INT
ret
=
0
;
DC
*
dc
=
DC_GetDCP
tr
(
hdc
);
DC
*
dc
=
get_dc_p
tr
(
hdc
);
TRACE
(
"DocName = %s Output = %s Datatype = %s
\n
"
,
debugstr_w
(
doc
->
lpszDocName
),
debugstr_w
(
doc
->
lpszOutput
),
...
...
@@ -80,7 +80,7 @@ INT WINAPI StartDocW(HDC hdc, const DOCINFOW* doc)
if
(
!
dc
)
return
SP_ERROR
;
if
(
dc
->
funcs
->
pStartDoc
)
ret
=
dc
->
funcs
->
pStartDoc
(
dc
->
physDev
,
doc
);
DC_ReleaseDCP
tr
(
dc
);
release_dc_p
tr
(
dc
);
return
ret
;
}
...
...
@@ -136,11 +136,11 @@ INT WINAPI StartDocA(HDC hdc, const DOCINFOA* doc)
INT
WINAPI
EndDoc
(
HDC
hdc
)
{
INT
ret
=
0
;
DC
*
dc
=
DC_GetDCP
tr
(
hdc
);
DC
*
dc
=
get_dc_p
tr
(
hdc
);
if
(
!
dc
)
return
SP_ERROR
;
if
(
dc
->
funcs
->
pEndDoc
)
ret
=
dc
->
funcs
->
pEndDoc
(
dc
->
physDev
);
DC_ReleaseDCP
tr
(
dc
);
release_dc_p
tr
(
dc
);
return
ret
;
}
...
...
@@ -152,14 +152,14 @@ INT WINAPI EndDoc(HDC hdc)
INT
WINAPI
StartPage
(
HDC
hdc
)
{
INT
ret
=
1
;
DC
*
dc
=
DC_GetDCP
tr
(
hdc
);
DC
*
dc
=
get_dc_p
tr
(
hdc
);
if
(
!
dc
)
return
SP_ERROR
;
if
(
dc
->
funcs
->
pStartPage
)
ret
=
dc
->
funcs
->
pStartPage
(
dc
->
physDev
);
else
FIXME
(
"stub
\n
"
);
DC_ReleaseDCP
tr
(
dc
);
release_dc_p
tr
(
dc
);
return
ret
;
}
...
...
@@ -170,19 +170,17 @@ INT WINAPI StartPage(HDC hdc)
*/
INT
WINAPI
EndPage
(
HDC
hdc
)
{
ABORTPROC
abort_proc
;
INT
ret
=
0
;
DC
*
dc
=
DC_GetDCP
tr
(
hdc
);
DC
*
dc
=
get_dc_p
tr
(
hdc
);
if
(
!
dc
)
return
SP_ERROR
;
if
(
dc
->
funcs
->
pEndPage
)
ret
=
dc
->
funcs
->
pEndPage
(
dc
->
physDev
);
abort_proc
=
dc
->
pAbortProc
;
DC_ReleaseDCPtr
(
dc
);
if
(
abort_proc
&&
!
abort_proc
(
hdc
,
0
))
if
(
dc
->
pAbortProc
&&
!
dc
->
pAbortProc
(
hdc
,
0
))
{
EndDoc
(
hdc
);
ret
=
0
;
}
release_dc_ptr
(
dc
);
return
ret
;
}
...
...
@@ -193,11 +191,11 @@ INT WINAPI EndPage(HDC hdc)
INT
WINAPI
AbortDoc
(
HDC
hdc
)
{
INT
ret
=
0
;
DC
*
dc
=
DC_GetDCP
tr
(
hdc
);
DC
*
dc
=
get_dc_p
tr
(
hdc
);
if
(
!
dc
)
return
SP_ERROR
;
if
(
dc
->
funcs
->
pAbortDoc
)
ret
=
dc
->
funcs
->
pAbortDoc
(
dc
->
physDev
);
DC_ReleaseDCP
tr
(
dc
);
release_dc_p
tr
(
dc
);
return
ret
;
}
...
...
@@ -214,19 +212,14 @@ BOOL16 WINAPI QueryAbort16(HDC16 hdc16, INT16 reserved)
{
BOOL
ret
=
TRUE
;
HDC
hdc
=
HDC_32
(
hdc16
);
DC
*
dc
=
DC_GetDCPtr
(
hdc
);
ABORTPROC
abproc
;
DC
*
dc
=
get_dc_ptr
(
hdc
);
if
(
!
dc
)
{
ERR
(
"Invalid hdc %p
\n
"
,
hdc
);
return
FALSE
;
}
abproc
=
dc
->
pAbortProc
;
DC_ReleaseDCPtr
(
dc
);
if
(
abproc
)
ret
=
abproc
(
hdc
,
0
);
if
(
dc
->
pAbortProc
)
ret
=
dc
->
pAbortProc
(
hdc
,
0
);
release_dc_ptr
(
dc
);
return
ret
;
}
...
...
@@ -237,11 +230,11 @@ BOOL16 WINAPI QueryAbort16(HDC16 hdc16, INT16 reserved)
static
BOOL
CALLBACK
call_abort_proc16
(
HDC
hdc
,
INT
code
)
{
ABORTPROC16
proc16
;
DC
*
dc
=
DC_GetDCP
tr
(
hdc
);
DC
*
dc
=
get_dc_p
tr
(
hdc
);
if
(
!
dc
)
return
FALSE
;
proc16
=
dc
->
pAbortProc16
;
DC_ReleaseDCP
tr
(
dc
);
release_dc_p
tr
(
dc
);
if
(
proc16
)
{
WORD
args
[
2
];
...
...
@@ -262,12 +255,13 @@ static BOOL CALLBACK call_abort_proc16( HDC hdc, INT code )
INT16
WINAPI
SetAbortProc16
(
HDC16
hdc16
,
ABORTPROC16
abrtprc
)
{
HDC
hdc
=
HDC_32
(
hdc16
);
DC
*
dc
=
DC_GetDCP
tr
(
hdc
);
DC
*
dc
=
get_dc_p
tr
(
hdc
);
if
(
!
dc
)
return
FALSE
;
dc
->
pAbortProc16
=
abrtprc
;
DC_ReleaseDCPtr
(
dc
);
return
SetAbortProc
(
hdc
,
call_abort_proc16
);
dc
->
pAbortProc
=
call_abort_proc16
;
release_dc_ptr
(
dc
);
return
TRUE
;
}
/**********************************************************************
...
...
@@ -276,11 +270,11 @@ INT16 WINAPI SetAbortProc16(HDC16 hdc16, ABORTPROC16 abrtprc)
*/
INT
WINAPI
SetAbortProc
(
HDC
hdc
,
ABORTPROC
abrtprc
)
{
DC
*
dc
=
DC_GetDCP
tr
(
hdc
);
DC
*
dc
=
get_dc_p
tr
(
hdc
);
if
(
!
dc
)
return
FALSE
;
dc
->
pAbortProc
=
abrtprc
;
DC_ReleaseDCP
tr
(
dc
);
release_dc_p
tr
(
dc
);
return
TRUE
;
}
...
...
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