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
efe693e6
Commit
efe693e6
authored
Oct 25, 2022
by
Piotr Caban
Committed by
Alexandre Julliard
Dec 05, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winspool: Implement print processor validation in AddPrinter.
parent
74be22b7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
1 deletion
+32
-1
info.c
dlls/winspool.drv/info.c
+32
-1
No files found.
dlls/winspool.drv/info.c
View file @
efe693e6
...
...
@@ -2568,6 +2568,37 @@ static void set_devices_and_printerports(PRINTER_INFO_2W *pi)
}
}
static
BOOL
validate_print_proc
(
WCHAR
*
server
,
const
WCHAR
*
name
)
{
PRINTPROCESSOR_INFO_1W
*
ppi
;
DWORD
size
,
i
,
no
;
if
(
!
EnumPrintProcessorsW
(
server
,
NULL
,
1
,
NULL
,
0
,
&
size
,
&
no
)
&&
GetLastError
()
!=
ERROR_INSUFFICIENT_BUFFER
)
{
return
FALSE
;
}
ppi
=
malloc
(
size
);
if
(
!
ppi
)
{
SetLastError
(
ERROR_OUTOFMEMORY
);
return
FALSE
;
}
if
(
!
EnumPrintProcessorsW
(
server
,
NULL
,
1
,
(
BYTE
*
)
ppi
,
size
,
&
size
,
&
no
))
{
free
(
ppi
);
return
FALSE
;
}
for
(
i
=
0
;
i
<
no
;
i
++
)
{
if
(
!
wcsicmp
(
ppi
[
i
].
pName
,
name
))
break
;
}
free
(
ppi
);
return
i
!=
no
;
}
/*****************************************************************************
* AddPrinterW [WINSPOOL.@]
*/
...
...
@@ -2628,7 +2659,7 @@ HANDLE WINAPI AddPrinterW(LPWSTR pName, DWORD Level, LPBYTE pPrinter)
RegCloseKey
(
hkeyDriver
);
RegCloseKey
(
hkeyDrivers
);
if
(
wcsicmp
(
pi
->
pPrintProcessor
,
L"WinPrint"
))
if
(
!
validate_print_proc
(
pName
,
pi
->
pPrintProcessor
))
{
FIXME
(
"Can't find processor %s
\n
"
,
debugstr_w
(
pi
->
pPrintProcessor
));
SetLastError
(
ERROR_UNKNOWN_PRINTPROCESSOR
);
...
...
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