winspool: Implement AddPortW.
This commit is contained in:
parent
df4d29312f
commit
03daa6088c
|
@ -5772,16 +5772,49 @@ BOOL WINAPI AddPortA(LPSTR pName, HWND hWnd, LPSTR pMonitorName)
|
||||||
* Success: TRUE
|
* Success: TRUE
|
||||||
* Failure: FALSE
|
* Failure: FALSE
|
||||||
*
|
*
|
||||||
* BUGS
|
|
||||||
* only a Stub
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI AddPortW(LPWSTR pName, HWND hWnd, LPWSTR pMonitorName)
|
BOOL WINAPI AddPortW(LPWSTR pName, HWND hWnd, LPWSTR pMonitorName)
|
||||||
{
|
{
|
||||||
FIXME("(%s, %p, %s), stub!\n",debugstr_w(pName),hWnd,debugstr_w(pMonitorName));
|
monitor_t * pm;
|
||||||
|
DWORD res = ROUTER_UNKNOWN;
|
||||||
|
|
||||||
|
TRACE("(%s, %p, %s)\n", debugstr_w(pName), hWnd, debugstr_w(pMonitorName));
|
||||||
|
|
||||||
|
if (pName && pName[0]) {
|
||||||
|
SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!pMonitorName) {
|
||||||
|
SetLastError(RPC_X_NULL_REF_POINTER);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* an empty Monitorname is Invalid */
|
||||||
|
if (!pMonitorName[0]) goto cleanup;
|
||||||
|
|
||||||
|
pm = monitor_load(pMonitorName, NULL);
|
||||||
|
if (pm && pm->monitor) {
|
||||||
|
if (pm->monitor->pfnAddPort != NULL) {
|
||||||
|
res = pm->monitor->pfnAddPort(pName, hWnd, pMonitorName);
|
||||||
|
TRACE("got %d with %d\n", res, GetLastError());
|
||||||
|
}
|
||||||
|
else if (pm->monitor->pfnXcvOpenPort != NULL)
|
||||||
|
{
|
||||||
|
FIXME("XcvOpenPort not implemented (dwMonitorSize: %d)\n", pm->dwMonitorSize);
|
||||||
|
}
|
||||||
|
/* invalidate cached PORT_INFO_2W */
|
||||||
|
if (res == ROUTER_SUCCESS) 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);
|
||||||
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* AddPortExA (WINSPOOL.@)
|
* AddPortExA (WINSPOOL.@)
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue