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
698a8a0b
Commit
698a8a0b
authored
Jun 16, 2006
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Jun 19, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winspool: AddMonitor: Test the driver entry before return an error.
parent
685e7007
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
info.c
dlls/winspool.drv/info.c
+17
-4
No files found.
dlls/winspool.drv/info.c
View file @
698a8a0b
...
...
@@ -1480,10 +1480,23 @@ BOOL WINAPI AddMonitorW(LPWSTR pName, DWORD Level, LPBYTE pMonitors)
return
FALSE
;
}
if
(
RegCreateKeyExW
(
hroot
,
mi2w
->
pName
,
0
,
NULL
,
REG_OPTION_NON_VOLATILE
,
KEY_WRITE
,
NULL
,
&
hentry
,
&
disposition
)
==
ERROR_SUCCESS
)
{
if
(
disposition
==
REG_OPENED_EXISTING_KEY
)
{
if
(
RegCreateKeyExW
(
hroot
,
mi2w
->
pName
,
0
,
NULL
,
REG_OPTION_NON_VOLATILE
,
KEY_WRITE
|
KEY_QUERY_VALUE
,
NULL
,
&
hentry
,
&
disposition
)
==
ERROR_SUCCESS
)
{
/* Some installers set options for the port before calling AddMonitor.
We query the "Driver" entry to verify that the monitor is installed,
before we return an error.
When a user installs two print monitors at the same time with the
same name but with a different driver DLL and a task switch comes
between RegQueryValueExW and RegSetValueExW, a race condition
is possible but silently ignored. */
DWORD
namesize
=
0
;
if
((
disposition
==
REG_OPENED_EXISTING_KEY
)
&&
(
RegQueryValueExW
(
hentry
,
DriverW
,
NULL
,
NULL
,
NULL
,
&
namesize
)
==
ERROR_SUCCESS
))
{
TRACE
(
"monitor %s already exists
\n
"
,
debugstr_w
(
mi2w
->
pName
));
/* NT: ERROR_PRINT_MONITOR_ALREADY_INSTALLED (3006)
9x: ERROR_ALREADY_EXISTS (183) */
...
...
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