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
2c76c73a
Commit
2c76c73a
authored
Dec 06, 2022
by
Piotr Caban
Committed by
Alexandre Julliard
Dec 07, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineps: Support parsing EMRI_METAFILE_EXT records.
parent
659b4e51
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
1 deletion
+74
-1
printproc.c
dlls/wineps.drv/printproc.c
+74
-1
No files found.
dlls/wineps.drv/printproc.c
View file @
2c76c73a
...
...
@@ -127,6 +127,55 @@ static struct pp_data* get_handle_data(HANDLE pp)
return
ret
;
}
static
int
WINAPI
hmf_proc
(
HDC
hdc
,
HANDLETABLE
*
htable
,
const
ENHMETARECORD
*
rec
,
int
n
,
LPARAM
arg
)
{
FIXME
(
"unsupported record: %ld
\n
"
,
rec
->
iType
);
return
1
;
}
static
BOOL
print_metafile
(
struct
pp_data
*
data
,
HANDLE
hdata
)
{
record_hdr
header
;
HENHMETAFILE
hmf
;
BYTE
*
buf
;
BOOL
ret
;
DWORD
r
;
if
(
!
ReadPrinter
(
hdata
,
&
header
,
sizeof
(
header
),
&
r
))
return
FALSE
;
if
(
r
!=
sizeof
(
header
))
{
SetLastError
(
ERROR_INVALID_DATA
);
return
FALSE
;
}
buf
=
malloc
(
header
.
cjSize
);
if
(
!
buf
)
return
FALSE
;
if
(
!
ReadPrinter
(
hdata
,
buf
,
header
.
cjSize
,
&
r
))
{
free
(
buf
);
return
FALSE
;
}
if
(
r
!=
header
.
cjSize
)
{
free
(
buf
);
SetLastError
(
ERROR_INVALID_DATA
);
return
FALSE
;
}
hmf
=
SetEnhMetaFileBits
(
header
.
cjSize
,
buf
);
free
(
buf
);
if
(
!
hmf
)
return
FALSE
;
ret
=
EnumEnhMetaFile
(
NULL
,
hmf
,
hmf_proc
,
NULL
,
NULL
);
DeleteEnhMetaFile
(
hmf
);
return
ret
;
}
BOOL
WINAPI
EnumPrintProcessorDatatypesW
(
WCHAR
*
server
,
WCHAR
*
name
,
DWORD
level
,
BYTE
*
datatypes
,
DWORD
size
,
DWORD
*
needed
,
DWORD
*
no
)
{
...
...
@@ -197,9 +246,9 @@ BOOL WINAPI PrintDocumentOnPrintProcessor(HANDLE pp, WCHAR *doc_name)
{
struct
pp_data
*
data
=
get_handle_data
(
pp
);
emfspool_header
header
;
LARGE_INTEGER
pos
,
cur
;
record_hdr
record
;
HANDLE
spool_data
;
LARGE_INTEGER
pos
;
DOC_INFO_1W
info
;
BOOL
ret
;
DWORD
r
;
...
...
@@ -261,6 +310,30 @@ BOOL WINAPI PrintDocumentOnPrintProcessor(HANDLE pp, WCHAR *doc_name)
if
(
!
ret
)
goto
cleanup
;
break
;
case
EMRI_METAFILE_EXT
:
case
EMRI_BW_METAFILE_EXT
:
pos
.
QuadPart
=
0
;
ret
=
SeekPrinter
(
spool_data
,
pos
,
&
cur
,
FILE_CURRENT
,
FALSE
);
if
(
ret
)
{
cur
.
QuadPart
+=
record
.
cjSize
;
ret
=
ReadPrinter
(
spool_data
,
&
pos
,
sizeof
(
pos
),
&
r
);
if
(
r
!=
sizeof
(
pos
))
{
SetLastError
(
ERROR_INVALID_DATA
);
ret
=
FALSE
;
}
}
pos
.
QuadPart
=
-
pos
.
QuadPart
-
2
*
sizeof
(
record
);
if
(
ret
)
ret
=
SeekPrinter
(
spool_data
,
pos
,
NULL
,
FILE_CURRENT
,
FALSE
);
if
(
ret
)
ret
=
print_metafile
(
data
,
spool_data
);
if
(
ret
)
ret
=
SeekPrinter
(
spool_data
,
cur
,
NULL
,
FILE_BEGIN
,
FALSE
);
if
(
!
ret
)
goto
cleanup
;
break
;
default:
FIXME
(
"%s not supported, skipping
\n
"
,
debugstr_rec_type
(
record
.
ulID
));
pos
.
QuadPart
=
record
.
cjSize
;
...
...
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