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
7128a659
Commit
7128a659
authored
Oct 10, 2023
by
Piotr Caban
Committed by
Alexandre Julliard
Oct 11, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineps.drv: Use first page DEVMODE to determine number of copies and collation.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=55718
parent
12c3579b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
printproc.c
dlls/wineps.drv/printproc.c
+20
-0
No files found.
dlls/wineps.drv/printproc.c
View file @
7128a659
...
...
@@ -23,6 +23,7 @@
#include <windows.h>
#include <ntgdi.h>
#include <winppi.h>
#include <winspool.h>
#include <ddk/winsplp.h>
#include <usp10.h>
...
...
@@ -40,6 +41,7 @@ struct pp_data
{
DWORD
magic
;
HANDLE
hport
;
WCHAR
*
port
;
WCHAR
*
doc_name
;
WCHAR
*
out_file
;
...
...
@@ -2980,6 +2982,7 @@ HANDLE WINAPI OpenPrintProcessor(WCHAR *port, PRINTPROCESSOROPENDATA *open_data)
return
NULL
;
data
->
magic
=
PP_MAGIC
;
data
->
hport
=
hport
;
data
->
port
=
wcsdup
(
port
);
data
->
doc_name
=
wcsdup
(
open_data
->
pDocumentName
);
data
->
out_file
=
wcsdup
(
open_data
->
pOutputFile
);
...
...
@@ -3003,6 +3006,7 @@ HANDLE WINAPI OpenPrintProcessor(WCHAR *port, PRINTPROCESSOROPENDATA *open_data)
BOOL
WINAPI
PrintDocumentOnPrintProcessor
(
HANDLE
pp
,
WCHAR
*
doc_name
)
{
struct
pp_data
*
data
=
get_handle_data
(
pp
);
DEVMODEW
*
devmode
=
NULL
;
emfspool_header
header
;
LARGE_INTEGER
pos
,
cur
;
record_hdr
record
;
...
...
@@ -3016,6 +3020,21 @@ BOOL WINAPI PrintDocumentOnPrintProcessor(HANDLE pp, WCHAR *doc_name)
if
(
!
data
)
return
FALSE
;
spool_data
=
GdiGetSpoolFileHandle
(
data
->
port
,
&
data
->
ctx
->
Devmode
->
dmPublic
,
doc_name
);
GdiGetDevmodeForPage
(
spool_data
,
1
,
&
devmode
,
NULL
);
if
(
devmode
&&
devmode
->
dmFields
&
DM_COPIES
)
{
data
->
ctx
->
Devmode
->
dmPublic
.
dmFields
|=
DM_COPIES
;
data
->
ctx
->
Devmode
->
dmPublic
.
dmCopies
=
devmode
->
dmCopies
;
}
if
(
devmode
&&
devmode
->
dmFields
&
DM_COLLATE
)
{
data
->
ctx
->
Devmode
->
dmPublic
.
dmFields
|=
DM_COLLATE
;
data
->
ctx
->
Devmode
->
dmPublic
.
dmCollate
=
devmode
->
dmCollate
;
}
GdiDeleteSpoolFileHandle
(
spool_data
);
if
(
!
OpenPrinterW
(
doc_name
,
&
spool_data
,
NULL
))
return
FALSE
;
...
...
@@ -3166,6 +3185,7 @@ BOOL WINAPI ClosePrintProcessor(HANDLE pp)
return
FALSE
;
ClosePrinter
(
data
->
hport
);
free
(
data
->
port
);
free
(
data
->
doc_name
);
free
(
data
->
out_file
);
DeleteDC
(
data
->
ctx
->
hdc
);
...
...
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