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
2f3d13a4
Commit
2f3d13a4
authored
Sep 14, 2012
by
Huw Davies
Committed by
Alexandre Julliard
Sep 14, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winspool: Skip scanner-only devices.
parent
556076dc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
1 deletion
+24
-1
info.c
dlls/winspool.drv/info.c
+24
-1
No files found.
dlls/winspool.drv/info.c
View file @
2f3d13a4
...
...
@@ -857,6 +857,20 @@ static WCHAR *get_cups_option( const char *name, int num_options, cups_option_t
return
ret
;
}
static
cups_ptype_t
get_cups_printer_type
(
const
cups_dest_t
*
dest
)
{
WCHAR
*
type
=
get_cups_option
(
"printer-type"
,
dest
->
num_options
,
dest
->
options
),
*
end
;
cups_ptype_t
ret
=
0
;
if
(
type
&&
*
type
)
{
ret
=
(
cups_ptype_t
)
strtoulW
(
type
,
&
end
,
10
);
if
(
*
end
)
ret
=
0
;
}
HeapFree
(
GetProcessHeap
(),
0
,
type
);
return
ret
;
}
static
BOOL
CUPS_LoadPrinters
(
void
)
{
int
i
,
nrofdests
;
...
...
@@ -868,6 +882,7 @@ static BOOL CUPS_LoadPrinters(void)
char
loaderror
[
256
];
WCHAR
nameW
[
MAX_PATH
];
HANDLE
added_printer
;
cups_ptype_t
printer_type
;
cupshandle
=
wine_dlopen
(
SONAME_LIBCUPS
,
RTLD_NOW
,
loaderror
,
sizeof
(
loaderror
));
if
(
!
cupshandle
)
{
...
...
@@ -893,12 +908,20 @@ static BOOL CUPS_LoadPrinters(void)
TRACE
(
"Found %d CUPS %s:
\n
"
,
nrofdests
,
(
nrofdests
==
1
)
?
"printer"
:
"printers"
);
for
(
i
=
0
;
i
<
nrofdests
;
i
++
)
{
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
dests
[
i
].
name
,
-
1
,
nameW
,
sizeof
(
nameW
)
/
sizeof
(
WCHAR
));
printer_type
=
get_cups_printer_type
(
dests
+
i
);
TRACE
(
"Printer %d: %s. printer_type %x
\n
"
,
i
,
debugstr_w
(
nameW
),
printer_type
);
if
(
printer_type
&
0x2000000
/* CUPS_PRINTER_SCANNER */
)
{
TRACE
(
"skipping scanner-only device
\n
"
);
continue
;
}
port
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
CUPS_Port
)
+
lstrlenW
(
nameW
)
*
sizeof
(
WCHAR
));
lstrcpyW
(
port
,
CUPS_Port
);
lstrcatW
(
port
,
nameW
);
TRACE
(
"Printer %d: %s
\n
"
,
i
,
debugstr_w
(
nameW
));
if
(
RegOpenKeyW
(
hkeyPrinters
,
nameW
,
&
hkeyPrinter
)
==
ERROR_SUCCESS
)
{
DWORD
status
=
get_dword_from_reg
(
hkeyPrinter
,
StatusW
);
/* Printer already in registry, delete the tag added in WINSPOOL_LoadSystemPrinters
...
...
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