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
90149034
Commit
90149034
authored
Nov 28, 2022
by
Piotr Caban
Committed by
Alexandre Julliard
Nov 29, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
localspl: Add lpr port extension.
parent
6372a61e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
+22
-3
cups.c
dlls/localspl/cups.c
+16
-0
localmon.c
dlls/localspl/localmon.c
+6
-3
No files found.
dlls/localspl/cups.c
View file @
90149034
...
@@ -164,6 +164,20 @@ static BOOL unixname_start_doc(doc_t *doc, const WCHAR *output)
...
@@ -164,6 +164,20 @@ static BOOL unixname_start_doc(doc_t *doc, const WCHAR *output)
return
doc
->
unixname
.
fd
!=
-
1
;
return
doc
->
unixname
.
fd
!=
-
1
;
}
}
static
BOOL
lpr_start_doc
(
doc_t
*
doc
,
const
WCHAR
*
printer_name
)
{
static
const
WCHAR
lpr
[]
=
{
'l'
,
'p'
,
'r'
,
' '
,
'-'
,
'P'
,
'\''
};
static
const
WCHAR
quote
[]
=
{
'\''
,
0
};
int
printer_len
=
wcslen
(
printer_name
);
WCHAR
*
cmd
;
cmd
=
malloc
(
printer_len
*
sizeof
(
WCHAR
)
+
sizeof
(
lpr
)
+
sizeof
(
quote
));
memcpy
(
cmd
,
lpr
,
sizeof
(
lpr
));
memcpy
(
cmd
+
ARRAY_SIZE
(
lpr
),
printer_name
,
printer_len
*
sizeof
(
WCHAR
));
memcpy
(
cmd
+
ARRAY_SIZE
(
lpr
)
+
printer_len
,
quote
,
sizeof
(
quote
));
return
pipe_start_doc
(
doc
,
cmd
);
}
static
NTSTATUS
start_doc
(
void
*
args
)
static
NTSTATUS
start_doc
(
void
*
args
)
{
{
const
struct
start_doc_params
*
params
=
args
;
const
struct
start_doc_params
*
params
=
args
;
...
@@ -176,6 +190,8 @@ static NTSTATUS start_doc(void *args)
...
@@ -176,6 +190,8 @@ static NTSTATUS start_doc(void *args)
ret
=
pipe_start_doc
(
doc
,
params
->
port
+
1
/* strlen("|") */
);
ret
=
pipe_start_doc
(
doc
,
params
->
port
+
1
/* strlen("|") */
);
else
if
(
params
->
type
==
PORT_IS_UNIXNAME
)
else
if
(
params
->
type
==
PORT_IS_UNIXNAME
)
ret
=
unixname_start_doc
(
doc
,
params
->
port
);
ret
=
unixname_start_doc
(
doc
,
params
->
port
);
else
if
(
params
->
type
==
PORT_IS_LPR
)
ret
=
lpr_start_doc
(
doc
,
params
->
port
+
4
/* strlen("lpr:") */
);
if
(
ret
)
if
(
ret
)
*
params
->
doc
=
(
size_t
)
doc
;
*
params
->
doc
=
(
size_t
)
doc
;
...
...
dlls/localspl/localmon.c
View file @
90149034
...
@@ -506,7 +506,8 @@ static BOOL WINAPI localmon_StartDocPort(HANDLE hport, WCHAR *printer_name,
...
@@ -506,7 +506,8 @@ static BOOL WINAPI localmon_StartDocPort(HANDLE hport, WCHAR *printer_name,
TRACE
(
"(%p %s %ld %ld %p)
\n
"
,
hport
,
debugstr_w
(
printer_name
),
TRACE
(
"(%p %s %ld %ld %p)
\n
"
,
hport
,
debugstr_w
(
printer_name
),
job_id
,
level
,
doc_info
);
job_id
,
level
,
doc_info
);
if
(
port
->
type
==
PORT_IS_PIPE
||
port
->
type
==
PORT_IS_UNIXNAME
)
if
(
port
->
type
==
PORT_IS_PIPE
||
port
->
type
==
PORT_IS_UNIXNAME
||
port
->
type
==
PORT_IS_LPR
)
{
{
struct
start_doc_params
params
;
struct
start_doc_params
params
;
...
@@ -546,7 +547,8 @@ static BOOL WINAPI localmon_WritePort(HANDLE hport, BYTE *buf, DWORD size,
...
@@ -546,7 +547,8 @@ static BOOL WINAPI localmon_WritePort(HANDLE hport, BYTE *buf, DWORD size,
TRACE
(
"(%p %p %lu %p)
\n
"
,
hport
,
buf
,
size
,
written
);
TRACE
(
"(%p %p %lu %p)
\n
"
,
hport
,
buf
,
size
,
written
);
if
(
port
->
type
==
PORT_IS_PIPE
||
port
->
type
==
PORT_IS_UNIXNAME
)
if
(
port
->
type
==
PORT_IS_PIPE
||
port
->
type
==
PORT_IS_UNIXNAME
||
port
->
type
==
PORT_IS_LPR
)
{
{
struct
write_doc_params
params
;
struct
write_doc_params
params
;
BOOL
ret
;
BOOL
ret
;
...
@@ -568,7 +570,8 @@ static BOOL WINAPI localmon_EndDocPort(HANDLE hport)
...
@@ -568,7 +570,8 @@ static BOOL WINAPI localmon_EndDocPort(HANDLE hport)
TRACE
(
"(%p)
\n
"
,
hport
);
TRACE
(
"(%p)
\n
"
,
hport
);
if
(
port
->
type
==
PORT_IS_PIPE
||
port
->
type
==
PORT_IS_UNIXNAME
)
if
(
port
->
type
==
PORT_IS_PIPE
||
port
->
type
==
PORT_IS_UNIXNAME
||
port
->
type
==
PORT_IS_LPR
)
{
{
struct
end_doc_params
params
;
struct
end_doc_params
params
;
...
...
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