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
6372a61e
Commit
6372a61e
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 unixname port extension.
parent
fca258ef
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
4 deletions
+39
-4
cups.c
dlls/localspl/cups.c
+35
-0
localmon.c
dlls/localspl/localmon.c
+3
-3
provider.c
dlls/localspl/provider.c
+1
-1
No files found.
dlls/localspl/cups.c
View file @
6372a61e
...
...
@@ -52,6 +52,10 @@ typedef struct _doc_t
pid_t
pid
;
int
fd
;
}
pipe
;
struct
{
int
fd
;
}
unixname
;
};
}
doc_t
;
...
...
@@ -131,6 +135,35 @@ static BOOL pipe_start_doc(doc_t *doc, const WCHAR *cmd)
return
TRUE
;
}
static
BOOL
unixname_write_doc
(
doc_t
*
doc
,
const
BYTE
*
buf
,
unsigned
int
size
)
{
return
write
(
doc
->
unixname
.
fd
,
buf
,
size
)
==
size
;
}
static
BOOL
unixname_end_doc
(
doc_t
*
doc
)
{
close
(
doc
->
unixname
.
fd
);
return
TRUE
;
}
static
BOOL
unixname_start_doc
(
doc_t
*
doc
,
const
WCHAR
*
output
)
{
char
*
outputA
;
DWORD
len
;
doc
->
write_doc
=
unixname_write_doc
;
doc
->
end_doc
=
unixname_end_doc
;
len
=
wcslen
(
output
);
outputA
=
malloc
(
len
*
3
+
1
);
ntdll_wcstoumbs
(
output
,
len
+
1
,
outputA
,
len
*
3
+
1
,
FALSE
);
doc
->
unixname
.
fd
=
open
(
outputA
,
O_CREAT
|
O_TRUNC
|
O_WRONLY
,
0666
);
free
(
outputA
);
return
doc
->
unixname
.
fd
!=
-
1
;
}
static
NTSTATUS
start_doc
(
void
*
args
)
{
const
struct
start_doc_params
*
params
=
args
;
...
...
@@ -141,6 +174,8 @@ static NTSTATUS start_doc(void *args)
if
(
params
->
type
==
PORT_IS_PIPE
)
ret
=
pipe_start_doc
(
doc
,
params
->
port
+
1
/* strlen("|") */
);
else
if
(
params
->
type
==
PORT_IS_UNIXNAME
)
ret
=
unixname_start_doc
(
doc
,
params
->
port
);
if
(
ret
)
*
params
->
doc
=
(
size_t
)
doc
;
...
...
dlls/localspl/localmon.c
View file @
6372a61e
...
...
@@ -506,7 +506,7 @@ static BOOL WINAPI localmon_StartDocPort(HANDLE hport, WCHAR *printer_name,
TRACE
(
"(%p %s %ld %ld %p)
\n
"
,
hport
,
debugstr_w
(
printer_name
),
job_id
,
level
,
doc_info
);
if
(
port
->
type
==
PORT_IS_PIPE
)
if
(
port
->
type
==
PORT_IS_PIPE
||
port
->
type
==
PORT_IS_UNIXNAME
)
{
struct
start_doc_params
params
;
...
...
@@ -546,7 +546,7 @@ static BOOL WINAPI localmon_WritePort(HANDLE hport, BYTE *buf, DWORD size,
TRACE
(
"(%p %p %lu %p)
\n
"
,
hport
,
buf
,
size
,
written
);
if
(
port
->
type
==
PORT_IS_PIPE
)
if
(
port
->
type
==
PORT_IS_PIPE
||
port
->
type
==
PORT_IS_UNIXNAME
)
{
struct
write_doc_params
params
;
BOOL
ret
;
...
...
@@ -568,7 +568,7 @@ static BOOL WINAPI localmon_EndDocPort(HANDLE hport)
TRACE
(
"(%p)
\n
"
,
hport
);
if
(
port
->
type
==
PORT_IS_PIPE
)
if
(
port
->
type
==
PORT_IS_PIPE
||
port
->
type
==
PORT_IS_UNIXNAME
)
{
struct
end_doc_params
params
;
...
...
dlls/localspl/provider.c
View file @
6372a61e
...
...
@@ -988,7 +988,7 @@ static monitor_t * monitor_load_by_port(LPCWSTR portname)
TRACE
(
"(%s)
\n
"
,
debugstr_w
(
portname
));
/* wine specific ports */
if
(
portname
[
0
]
==
'|'
)
if
(
portname
[
0
]
==
'|'
||
portname
[
0
]
==
'/'
)
return
monitor_load
(
L"Local Port"
,
NULL
);
/* Try the Local Monitor first */
...
...
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