winspool: Implement DeletePortA.

This commit is contained in:
Detlef Riekenberg 2006-11-28 00:47:08 +01:00 committed by Alexandre Julliard
parent c587d1ad0d
commit bcfa90e182
1 changed files with 26 additions and 6 deletions

View File

@ -2147,13 +2147,33 @@ BOOL WINAPI DeleteMonitorW (LPWSTR pName, LPWSTR pEnvironment, LPWSTR pMonitorNa
* See DeletePortW. * See DeletePortW.
* *
*/ */
BOOL WINAPI BOOL WINAPI DeletePortA (LPSTR pName, HWND hWnd, LPSTR pPortName)
DeletePortA (LPSTR pName, HWND hWnd, LPSTR pPortName)
{ {
FIXME("(%s,%p,%s):stub\n",debugstr_a(pName),hWnd, LPWSTR nameW = NULL;
debugstr_a(pPortName)); LPWSTR portW = NULL;
SetLastError(ERROR_CALL_NOT_IMPLEMENTED); INT len;
return FALSE; DWORD res;
TRACE("(%s, %p, %s)\n", debugstr_a(pName), hWnd, debugstr_a(pPortName));
/* convert servername to unicode */
if (pName) {
len = MultiByteToWideChar(CP_ACP, 0, pName, -1, NULL, 0);
nameW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, pName, -1, nameW, len);
}
/* convert portname to unicode */
if (pPortName) {
len = MultiByteToWideChar(CP_ACP, 0, pPortName, -1, NULL, 0);
portW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, pPortName, -1, portW, len);
}
res = DeletePortW(nameW, hWnd, portW);
HeapFree(GetProcessHeap(), 0, nameW);
HeapFree(GetProcessHeap(), 0, portW);
return res;
} }
/****************************************************************** /******************************************************************