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
dd4603d3
Commit
dd4603d3
authored
Apr 27, 2023
by
Piotr Caban
Committed by
Alexandre Julliard
Apr 27, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
localspl: Add support for PRINTER_ATTRIBUTE_RAW_ONLY printer attribute.
parent
7e334a7a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
provider.c
dlls/localspl/provider.c
+29
-0
No files found.
dlls/localspl/provider.c
View file @
dd4603d3
...
...
@@ -237,6 +237,7 @@ typedef struct {
WCHAR
*
port
;
WCHAR
*
print_proc
;
WCHAR
*
datatype
;
DWORD
attributes
;
CRITICAL_SECTION
jobs_cs
;
struct
list
jobs
;
...
...
@@ -546,6 +547,17 @@ static WCHAR * reg_query_value(HKEY key, const WCHAR *name)
return
ret
;
}
static
DWORD
reg_query_dword
(
HKEY
hkey
,
const
WCHAR
*
name
)
{
DWORD
type
,
val
,
size
=
sizeof
(
size
);
if
(
RegQueryValueExW
(
hkey
,
name
,
0
,
&
type
,
(
BYTE
*
)
&
val
,
&
size
))
return
0
;
if
(
type
!=
REG_DWORD
)
return
0
;
return
val
;
}
static
printer_info_t
*
get_printer_info
(
const
WCHAR
*
name
)
{
HKEY
hkey
,
hprinter
=
NULL
;
...
...
@@ -582,6 +594,7 @@ static printer_info_t* get_printer_info(const WCHAR *name)
info
->
port
=
reg_query_value
(
hprinter
,
L"Port"
);
info
->
print_proc
=
reg_query_value
(
hprinter
,
L"Print Processor"
);
info
->
datatype
=
reg_query_value
(
hprinter
,
L"Datatype"
);
info
->
attributes
=
reg_query_dword
(
hprinter
,
L"Attributes"
);
RegCloseKey
(
hprinter
);
if
(
!
info
->
name
||
!
info
->
port
||
!
info
->
print_proc
||
!
info
->
datatype
)
...
...
@@ -3281,6 +3294,7 @@ static DWORD WINAPI fpStartDocPrinter(HANDLE hprinter, DWORD level, BYTE *doc_in
{
printer_t
*
printer
=
(
printer_t
*
)
hprinter
;
DOC_INFO_1W
*
info
=
(
DOC_INFO_1W
*
)
doc_info
;
WCHAR
*
datatype
;
TRACE
(
"(%p %ld %p {pDocName = %s, pOutputFile = %s, pDatatype = %s})
\n
"
,
hprinter
,
level
,
doc_info
,
debugstr_w
(
info
->
pDocName
),
...
...
@@ -3318,6 +3332,21 @@ static DWORD WINAPI fpStartDocPrinter(HANDLE hprinter, DWORD level, BYTE *doc_in
return
0
;
}
if
(
info
->
pDatatype
)
datatype
=
info
->
pDatatype
;
else
if
(
printer
->
datatype
)
datatype
=
printer
->
datatype
;
else
datatype
=
printer
->
info
->
datatype
;
if
(
!
datatype
||
((
printer
->
info
->
attributes
&
PRINTER_ATTRIBUTE_RAW_ONLY
)
&&
wcsicmp
(
datatype
,
L"RAW"
)))
{
TRACE
(
"non RAW datatype specified on RAW-only printer (%s)
\n
"
,
debugstr_w
(
datatype
));
SetLastError
(
ERROR_INVALID_DATATYPE
);
return
0
;
}
printer
->
doc
=
add_job
(
printer
,
info
,
TRUE
);
return
printer
->
doc
?
printer
->
doc
->
id
:
0
;
}
...
...
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