Detlef Riekenberg : winspool: Support xcv in DeletePortW.
Alexandre Julliard
julliard at wine.codeweavers.com
Tue Jan 16 05:22:20 CST 2007
Module: wine
Branch: master
Commit: 917b0eed550c75b0436db988437d50142e4c25b9
URL: http://source.winehq.org/git/wine.git/?a=commit;h=917b0eed550c75b0436db988437d50142e4c25b9
Author: Detlef Riekenberg <wine.dev at web.de>
Date: Mon Jan 15 05:37:20 2007 +0100
winspool: Support xcv in DeletePortW.
---
dlls/winspool.drv/info.c | 47 ++++++++++++++++++++++++++++++---------------
1 files changed, 31 insertions(+), 16 deletions(-)
diff --git a/dlls/winspool.drv/info.c b/dlls/winspool.drv/info.c
index 40a7dd5..934565c 100644
--- a/dlls/winspool.drv/info.c
+++ b/dlls/winspool.drv/info.c
@@ -2380,7 +2380,8 @@ BOOL WINAPI DeletePortA (LPSTR pName, HW
BOOL WINAPI DeletePortW (LPWSTR pName, HWND hWnd, LPWSTR pPortName)
{
monitor_t * pm;
- DWORD res = ROUTER_UNKNOWN;
+ monitor_t * pui;
+ DWORD res;
TRACE("(%s, %p, %s)\n", debugstr_w(pName), hWnd, debugstr_w(pPortName));
@@ -2395,29 +2396,43 @@ BOOL WINAPI DeletePortW (LPWSTR pName, H
}
/* an empty Portname is Invalid */
- if (!pPortName[0]) goto cleanup;
+ if (!pPortName[0]) {
+ SetLastError(ERROR_NOT_SUPPORTED);
+ return FALSE;
+ }
pm = monitor_load_by_port(pPortName);
- if (pm && pm->monitor) {
- if (pm->monitor->pfnDeletePort != NULL) {
- TRACE("Using %s for %s:\n", debugstr_w(pm->name), debugstr_w(pPortName));
- res = pm->monitor->pfnDeletePort(pName, hWnd, pPortName);
- TRACE("got %d with %d\n", res, GetLastError());
+ if (pm && pm->monitor && pm->monitor->pfnDeletePort) {
+ TRACE("Using %s for %s (%p: %s)\n", debugstr_w(pm->name), debugstr_w(pPortName), pm, debugstr_w(pm->dllname));
+ res = pm->monitor->pfnDeletePort(pName, hWnd, pPortName);
+ TRACE("got %d with %u\n", res, GetLastError());
+ }
+ else
+ {
+ pui = monitor_loadui(pm);
+ if (pui && pui->monitorUI && pui->monitorUI->pfnDeletePortUI) {
+ TRACE("use %s for %s (%p: %s)\n", debugstr_w(pui->name), debugstr_w(pPortName), pui, debugstr_w(pui->dllname));
+ res = pui->monitorUI->pfnDeletePortUI(pName, hWnd, pPortName);
+ TRACE("got %d with %u\n", res, GetLastError());
}
- else if (pm->monitor->pfnXcvOpenPort)
+ else
{
- FIXME("XcvOpenPort not implemented (dwMonitorSize: %d)\n", pm->dwMonitorSize);
+ FIXME("not implemented for %s (%p: %s => %p: %s)\n", debugstr_w(pPortName),
+ pm, pm ? debugstr_w(pm->dllname) : NULL, pui, pui ? debugstr_w(pui->dllname) : NULL);
+
+ /* XP: ERROR_NOT_SUPPORTED, NT351,9x: ERROR_INVALID_PARAMETER */
+ SetLastError(ERROR_NOT_SUPPORTED);
+ res = FALSE;
}
- /* invalidate cached PORT_INFO_2W */
- if (res == ROUTER_SUCCESS) monitor_flush(pm);
+ monitor_unload(pui);
}
+ /* always invalidate cached PORT_INFO_2W */
+ monitor_flush(pm);
+
monitor_unload(pm);
-cleanup:
- /* XP: ERROR_NOT_SUPPORTED, NT351,9x: ERROR_INVALID_PARAMETER */
- if (res == ROUTER_UNKNOWN) SetLastError(ERROR_NOT_SUPPORTED);
- TRACE("returning %d with %d\n", (res == ROUTER_SUCCESS), GetLastError());
- return (res == ROUTER_SUCCESS);
+ TRACE("returning %d with %u\n", res, GetLastError());
+ return res;
}
/******************************************************************************
More information about the wine-cvs
mailing list