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
f9a18b8f
Commit
f9a18b8f
authored
Jul 10, 2008
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Jul 11, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winspool: Move DeleteMonitorW to the backend.
parent
ee1cca51
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
34 deletions
+64
-34
localspl_main.c
dlls/localspl/localspl_main.c
+60
-1
info.c
dlls/winspool.drv/info.c
+4
-33
No files found.
dlls/localspl/localspl_main.c
View file @
f9a18b8f
...
...
@@ -696,6 +696,65 @@ static BOOL WINAPI fpAddPrinterDriverEx(LPWSTR pName, DWORD level, LPBYTE pDrive
return
myAddPrinterDriverEx
(
level
,
pDriverInfo
,
dwFileCopyFlags
,
TRUE
);
}
/******************************************************************
* fpDeleteMonitor [exported through PRINTPROVIDOR]
*
* Delete a specific Printmonitor from a Printing-Environment
*
* PARAMS
* pName [I] Servername or NULL (local Computer)
* pEnvironment [I] Printing-Environment of the Monitor or NULL (Default)
* pMonitorName [I] Name of the Monitor, that should be deleted
*
* RETURNS
* Success: TRUE
* Failure: FALSE
*
* NOTES
* pEnvironment is ignored in Windows for the local Computer.
*
*/
BOOL
WINAPI
fpDeleteMonitor
(
LPWSTR
pName
,
LPWSTR
pEnvironment
,
LPWSTR
pMonitorName
)
{
HKEY
hroot
=
NULL
;
LONG
lres
;
TRACE
(
"(%s, %s, %s)
\n
"
,
debugstr_w
(
pName
),
debugstr_w
(
pEnvironment
),
debugstr_w
(
pMonitorName
));
lres
=
copy_servername_from_name
(
pName
,
NULL
);
if
(
lres
)
{
FIXME
(
"server %s not supported
\n
"
,
debugstr_w
(
pName
));
SetLastError
(
ERROR_INVALID_NAME
);
return
FALSE
;
}
/* pEnvironment is ignored in Windows for the local Computer */
if
(
!
pMonitorName
||
!
pMonitorName
[
0
])
{
TRACE
(
"pMonitorName %s is invalid
\n
"
,
debugstr_w
(
pMonitorName
));
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
(
RegCreateKeyW
(
HKEY_LOCAL_MACHINE
,
monitorsW
,
&
hroot
)
!=
ERROR_SUCCESS
)
{
ERR
(
"unable to create key %s
\n
"
,
debugstr_w
(
monitorsW
));
return
FALSE
;
}
if
(
RegDeleteTreeW
(
hroot
,
pMonitorName
)
==
ERROR_SUCCESS
)
{
TRACE
(
"%s deleted
\n
"
,
debugstr_w
(
pMonitorName
));
RegCloseKey
(
hroot
);
return
TRUE
;
}
TRACE
(
"%s does not exist
\n
"
,
debugstr_w
(
pMonitorName
));
RegCloseKey
(
hroot
);
/* NT: ERROR_UNKNOWN_PRINT_MONITOR (3000), 9x: ERROR_INVALID_PARAMETER (87) */
SetLastError
(
ERROR_UNKNOWN_PRINT_MONITOR
);
return
FALSE
;
}
/*****************************************************************************
* fpEnumMonitors [exported through PRINTPROVIDOR]
...
...
@@ -821,7 +880,7 @@ static const PRINTPROVIDOR * get_backend(void)
NULL
,
/* fpDeletePrinterConnection */
NULL
,
/* fpPrinterMessageBox */
NULL
,
/* fpAddMonitor */
NULL
,
/* fpDeleteMonitor */
fpDeleteMonitor
,
NULL
,
/* fpResetPrinter */
NULL
,
/* fpGetPrinterDriverEx */
NULL
,
/* fpFindFirstPrinterChangeNotification */
...
...
dlls/winspool.drv/info.c
View file @
f9a18b8f
...
...
@@ -2441,47 +2441,18 @@ BOOL WINAPI DeleteMonitorA (LPSTR pName, LPSTR pEnvironment, LPSTR pMonitorName)
* pEnvironment is ignored in Windows for the local Computer.
*
*/
BOOL
WINAPI
DeleteMonitorW
(
LPWSTR
pName
,
LPWSTR
pEnvironment
,
LPWSTR
pMonitorName
)
BOOL
WINAPI
DeleteMonitorW
(
LPWSTR
pName
,
LPWSTR
pEnvironment
,
LPWSTR
pMonitorName
)
{
HKEY
hroot
=
NULL
;
TRACE
(
"(%s, %s, %s)
\n
"
,
debugstr_w
(
pName
),
debugstr_w
(
pEnvironment
),
debugstr_w
(
pMonitorName
));
if
(
pName
&&
(
pName
[
0
]))
{
FIXME
(
"for server %s not implemented
\n
"
,
debugstr_w
(
pName
));
SetLastError
(
ERROR_ACCESS_DENIED
);
return
FALSE
;
}
/* pEnvironment is ignored in Windows for the local Computer */
if
(
!
pMonitorName
||
!
pMonitorName
[
0
])
{
WARN
(
"pMonitorName %s is invalid
\n
"
,
debugstr_w
(
pMonitorName
));
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
(
RegCreateKeyW
(
HKEY_LOCAL_MACHINE
,
MonitorsW
,
&
hroot
)
!=
ERROR_SUCCESS
)
{
ERR
(
"unable to create key %s
\n
"
,
debugstr_w
(
MonitorsW
));
return
FALSE
;
}
if
(
RegDeleteTreeW
(
hroot
,
pMonitorName
)
==
ERROR_SUCCESS
)
{
TRACE
(
"monitor %s deleted
\n
"
,
debugstr_w
(
pMonitorName
));
RegCloseKey
(
hroot
);
return
TRUE
;
}
WARN
(
"monitor %s does not exist
\n
"
,
debugstr_w
(
pMonitorName
));
RegCloseKey
(
hroot
);
if
((
backend
==
NULL
)
&&
!
load_backend
())
return
FALSE
;
/* NT: ERROR_UNKNOWN_PRINT_MONITOR (3000), 9x: ERROR_INVALID_PARAMETER (87) */
SetLastError
(
ERROR_UNKNOWN_PRINT_MONITOR
);
return
(
FALSE
);
return
backend
->
fpDeleteMonitor
(
pName
,
pEnvironment
,
pMonitorName
);
}
/******************************************************************
* DeletePortA [WINSPOOL.@]
*
...
...
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