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
1cf1412a
Commit
1cf1412a
authored
Nov 21, 2022
by
Piotr Caban
Committed by
Alexandre Julliard
Nov 22, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Get printer output file name in StartDoc.
parent
4e527045
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
8 deletions
+53
-8
Makefile.in
dlls/gdi32/Makefile.in
+1
-1
dc.c
dlls/gdi32/dc.c
+50
-7
ntgdi.h
include/ntgdi.h
+2
-0
No files found.
dlls/gdi32/Makefile.in
View file @
1cf1412a
...
@@ -2,7 +2,7 @@ EXTRADEFS = -D_GDI32_
...
@@ -2,7 +2,7 @@ EXTRADEFS = -D_GDI32_
MODULE
=
gdi32.dll
MODULE
=
gdi32.dll
IMPORTLIB
=
gdi32
IMPORTLIB
=
gdi32
IMPORTS
=
user32 advapi32 win32u
IMPORTS
=
user32 advapi32 win32u
DELAYIMPORTS
=
setupapi
DELAYIMPORTS
=
setupapi
winspool
C_SRCS
=
\
C_SRCS
=
\
dc.c
\
dc.c
\
...
...
dlls/gdi32/dc.c
View file @
1cf1412a
...
@@ -199,8 +199,11 @@ HDC WINAPI CreateDCW( LPCWSTR driver, LPCWSTR device, LPCWSTR output,
...
@@ -199,8 +199,11 @@ HDC WINAPI CreateDCW( LPCWSTR driver, LPCWSTR device, LPCWSTR output,
UNICODE_STRING
device_str
,
output_str
;
UNICODE_STRING
device_str
,
output_str
;
driver_entry_point
entry_point
=
NULL
;
driver_entry_point
entry_point
=
NULL
;
const
WCHAR
*
display
=
NULL
,
*
p
;
const
WCHAR
*
display
=
NULL
,
*
p
;
WCHAR
buf
[
300
],
*
port
=
NULL
;
BOOL
is_display
=
FALSE
;
BOOL
is_display
=
FALSE
;
WCHAR
buf
[
300
];
HANDLE
hspool
=
NULL
;
DC_ATTR
*
dc_attr
;
HDC
ret
;
if
(
!
device
||
!
get_driver_name
(
device
,
buf
,
300
))
if
(
!
device
||
!
get_driver_name
(
device
,
buf
,
300
))
{
{
...
@@ -212,6 +215,12 @@ HDC WINAPI CreateDCW( LPCWSTR driver, LPCWSTR device, LPCWSTR output,
...
@@ -212,6 +215,12 @@ HDC WINAPI CreateDCW( LPCWSTR driver, LPCWSTR device, LPCWSTR output,
lstrcpyW
(
buf
,
driver
);
lstrcpyW
(
buf
,
driver
);
}
}
if
(
output
)
{
output_str
.
Length
=
output_str
.
MaximumLength
=
lstrlenW
(
output
)
*
sizeof
(
WCHAR
);
output_str
.
Buffer
=
(
WCHAR
*
)
output
;
}
if
(
is_display_device
(
driver
))
if
(
is_display_device
(
driver
))
{
{
display
=
driver
;
display
=
driver
;
...
@@ -231,6 +240,15 @@ HDC WINAPI CreateDCW( LPCWSTR driver, LPCWSTR device, LPCWSTR output,
...
@@ -231,6 +240,15 @@ HDC WINAPI CreateDCW( LPCWSTR driver, LPCWSTR device, LPCWSTR output,
ERR
(
"no driver found for %s
\n
"
,
debugstr_w
(
buf
)
);
ERR
(
"no driver found for %s
\n
"
,
debugstr_w
(
buf
)
);
return
0
;
return
0
;
}
}
else
if
(
!
OpenPrinterW
(
(
WCHAR
*
)
device
,
&
hspool
,
NULL
))
{
return
0
;
}
else
if
(
output
&&
!
(
port
=
HeapAlloc
(
GetProcessHeap
(),
0
,
output_str
.
Length
)))
{
ClosePrinter
(
hspool
);
return
0
;
}
if
(
display
)
if
(
display
)
{
{
...
@@ -247,14 +265,23 @@ HDC WINAPI CreateDCW( LPCWSTR driver, LPCWSTR device, LPCWSTR output,
...
@@ -247,14 +265,23 @@ HDC WINAPI CreateDCW( LPCWSTR driver, LPCWSTR device, LPCWSTR output,
device_str
.
Buffer
=
(
WCHAR
*
)
device
;
device_str
.
Buffer
=
(
WCHAR
*
)
device
;
}
}
if
(
output
)
ret
=
NtGdiOpenDCW
(
device
||
display
?
&
device_str
:
NULL
,
devmode
,
output
?
&
output_str
:
NULL
,
0
,
is_display
,
entry_point
,
NULL
,
NULL
);
if
(
ret
&&
hspool
&&
(
dc_attr
=
get_dc_attr
(
ret
)))
{
{
output_str
.
Length
=
output_str
.
MaximumLength
=
lstrlenW
(
output
)
*
sizeof
(
WCHAR
);
if
(
port
)
output_str
.
Buffer
=
(
WCHAR
*
)
output
;
memcpy
(
port
,
output
,
output_str
.
Length
);
dc_attr
->
hspool
=
HandleToULong
(
hspool
);
dc_attr
->
output
=
(
ULONG_PTR
)
port
;
}
else
if
(
hspool
)
{
ClosePrinter
(
hspool
);
HeapFree
(
GetProcessHeap
(),
0
,
port
);
}
}
return
NtGdiOpenDCW
(
device
||
display
?
&
device_str
:
NULL
,
devmode
,
output
?
&
output_str
:
NULL
,
return
ret
;
0
,
is_display
,
entry_point
,
NULL
,
NULL
);
}
}
/***********************************************************************
/***********************************************************************
...
@@ -371,6 +398,10 @@ BOOL WINAPI DeleteDC( HDC hdc )
...
@@ -371,6 +398,10 @@ BOOL WINAPI DeleteDC( HDC hdc )
if
(
is_meta_dc
(
hdc
))
return
METADC_DeleteDC
(
hdc
);
if
(
is_meta_dc
(
hdc
))
return
METADC_DeleteDC
(
hdc
);
if
(
!
(
dc_attr
=
get_dc_attr
(
hdc
)))
return
FALSE
;
if
(
!
(
dc_attr
=
get_dc_attr
(
hdc
)))
return
FALSE
;
HeapFree
(
GetProcessHeap
(),
0
,
(
WCHAR
*
)(
ULONG_PTR
)
dc_attr
->
output
);
dc_attr
->
output
=
0
;
if
(
dc_attr
->
hspool
)
ClosePrinter
(
ULongToHandle
(
dc_attr
->
hspool
)
);
dc_attr
->
hspool
=
0
;
if
(
dc_attr
->
emf
)
EMFDC_DeleteDC
(
dc_attr
);
if
(
dc_attr
->
emf
)
EMFDC_DeleteDC
(
dc_attr
);
return
NtGdiDeleteObjectApp
(
hdc
);
return
NtGdiDeleteObjectApp
(
hdc
);
}
}
...
@@ -2153,9 +2184,11 @@ BOOL WINAPI CancelDC(HDC hdc)
...
@@ -2153,9 +2184,11 @@ BOOL WINAPI CancelDC(HDC hdc)
*/
*/
INT
WINAPI
StartDocW
(
HDC
hdc
,
const
DOCINFOW
*
doc
)
INT
WINAPI
StartDocW
(
HDC
hdc
,
const
DOCINFOW
*
doc
)
{
{
WCHAR
*
output
=
NULL
;
DC_ATTR
*
dc_attr
;
DC_ATTR
*
dc_attr
;
ABORTPROC
proc
;
ABORTPROC
proc
;
DOCINFOW
info
;
DOCINFOW
info
;
INT
ret
;
TRACE
(
"%p %p
\n
"
,
hdc
,
doc
);
TRACE
(
"%p %p
\n
"
,
hdc
,
doc
);
...
@@ -2177,7 +2210,17 @@ INT WINAPI StartDocW( HDC hdc, const DOCINFOW *doc )
...
@@ -2177,7 +2210,17 @@ INT WINAPI StartDocW( HDC hdc, const DOCINFOW *doc )
proc
=
(
ABORTPROC
)(
UINT_PTR
)
dc_attr
->
abort_proc
;
proc
=
(
ABORTPROC
)(
UINT_PTR
)
dc_attr
->
abort_proc
;
if
(
proc
&&
!
proc
(
hdc
,
0
))
return
0
;
if
(
proc
&&
!
proc
(
hdc
,
0
))
return
0
;
return
NtGdiStartDoc
(
hdc
,
&
info
,
NULL
,
0
);
if
(
dc_attr
->
hspool
)
{
if
(
!
info
.
lpszOutput
)
info
.
lpszOutput
=
(
const
WCHAR
*
)(
ULONG_PTR
)
dc_attr
->
output
;
output
=
StartDocDlgW
(
ULongToHandle
(
dc_attr
->
hspool
),
&
info
);
if
(
output
)
info
.
lpszOutput
=
output
;
}
ret
=
NtGdiStartDoc
(
hdc
,
&
info
,
NULL
,
0
);
HeapFree
(
GetProcessHeap
(),
0
,
output
);
return
ret
;
}
}
/***********************************************************************
/***********************************************************************
...
...
include/ntgdi.h
View file @
1cf1412a
...
@@ -198,6 +198,8 @@ typedef struct DC_ATTR
...
@@ -198,6 +198,8 @@ typedef struct DC_ATTR
RECTL
emf_bounds
;
RECTL
emf_bounds
;
UINT64
emf
;
/* client EMF record pointer */
UINT64
emf
;
/* client EMF record pointer */
UINT64
abort_proc
;
/* AbortProc for printing */
UINT64
abort_proc
;
/* AbortProc for printing */
UINT64
hspool
;
UINT64
output
;
}
DC_ATTR
;
}
DC_ATTR
;
struct
font_enum_entry
struct
font_enum_entry
...
...
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