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
6d0ffa50
Commit
6d0ffa50
authored
Sep 18, 2008
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Sep 19, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winspool: Use the backend for AddMonitor.
parent
ab32b35b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
75 deletions
+3
-75
info.c
dlls/winspool.drv/info.c
+3
-75
No files found.
dlls/winspool.drv/info.c
View file @
6d0ffa50
...
...
@@ -2271,12 +2271,7 @@ BOOL WINAPI AddMonitorA(LPSTR pName, DWORD Level, LPBYTE pMonitors)
*/
BOOL
WINAPI
AddMonitorW
(
LPWSTR
pName
,
DWORD
Level
,
LPBYTE
pMonitors
)
{
monitor_t
*
pm
=
NULL
;
LPMONITOR_INFO_2W
mi2w
;
HKEY
hroot
=
NULL
;
HKEY
hentry
=
NULL
;
DWORD
disposition
;
BOOL
res
=
FALSE
;
mi2w
=
(
LPMONITOR_INFO_2W
)
pMonitors
;
TRACE
(
"(%s, %d, %p) : %s %s %s
\n
"
,
debugstr_w
(
pName
),
Level
,
pMonitors
,
...
...
@@ -2284,6 +2279,8 @@ BOOL WINAPI AddMonitorW(LPWSTR pName, DWORD Level, LPBYTE pMonitors)
debugstr_w
(
mi2w
?
mi2w
->
pEnvironment
:
NULL
),
debugstr_w
(
mi2w
?
mi2w
->
pDLLName
:
NULL
));
if
((
backend
==
NULL
)
&&
!
load_backend
())
return
FALSE
;
if
(
Level
!=
2
)
{
SetLastError
(
ERROR_INVALID_LEVEL
);
return
FALSE
;
...
...
@@ -2294,76 +2291,7 @@ BOOL WINAPI AddMonitorW(LPWSTR pName, DWORD Level, LPBYTE pMonitors)
return
FALSE
;
}
if
(
pName
&&
(
pName
[
0
]))
{
FIXME
(
"for server %s not implemented
\n
"
,
debugstr_w
(
pName
));
SetLastError
(
ERROR_ACCESS_DENIED
);
return
FALSE
;
}
if
(
!
mi2w
->
pName
||
(
!
mi2w
->
pName
[
0
]))
{
WARN
(
"pName not valid : %s
\n
"
,
debugstr_w
(
mi2w
->
pName
));
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
(
!
mi2w
->
pEnvironment
||
lstrcmpW
(
mi2w
->
pEnvironment
,
envname_x86W
))
{
WARN
(
"Environment %s requested (we support only %s)
\n
"
,
debugstr_w
(
mi2w
->
pEnvironment
),
debugstr_w
(
envname_x86W
));
SetLastError
(
ERROR_INVALID_ENVIRONMENT
);
return
FALSE
;
}
if
(
!
mi2w
->
pDLLName
||
(
!
mi2w
->
pDLLName
[
0
]))
{
WARN
(
"pDLLName not valid : %s
\n
"
,
debugstr_w
(
mi2w
->
pDLLName
));
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
/* Load and initialize the monitor. SetLastError() is called on failure */
if
((
pm
=
monitor_load
(
mi2w
->
pName
,
mi2w
->
pDLLName
))
==
NULL
)
{
return
FALSE
;
}
monitor_unload
(
pm
);
if
(
RegCreateKeyW
(
HKEY_LOCAL_MACHINE
,
MonitorsW
,
&
hroot
)
!=
ERROR_SUCCESS
)
{
ERR
(
"unable to create key %s
\n
"
,
debugstr_w
(
MonitorsW
));
return
FALSE
;
}
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) */
SetLastError
(
ERROR_PRINT_MONITOR_ALREADY_INSTALLED
);
}
else
{
INT
len
;
len
=
(
lstrlenW
(
mi2w
->
pDLLName
)
+
1
)
*
sizeof
(
WCHAR
);
res
=
(
RegSetValueExW
(
hentry
,
DriverW
,
0
,
REG_SZ
,
(
LPBYTE
)
mi2w
->
pDLLName
,
len
)
==
ERROR_SUCCESS
);
}
RegCloseKey
(
hentry
);
}
RegCloseKey
(
hroot
);
return
(
res
);
return
backend
->
fpAddMonitor
(
pName
,
Level
,
pMonitors
);
}
/******************************************************************
...
...
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