winspool: Implement AddPortA.

This commit is contained in:
Detlef Riekenberg 2006-11-28 00:49:54 +01:00 committed by Alexandre Julliard
parent 03daa6088c
commit 1f3c289a30
1 changed files with 22 additions and 2 deletions

View File

@ -5754,8 +5754,28 @@ BOOL WINAPI AbortPrinter( HANDLE hPrinter )
*/
BOOL WINAPI AddPortA(LPSTR pName, HWND hWnd, LPSTR pMonitorName)
{
FIXME("(%s, %p, %s), stub!\n",debugstr_a(pName),hWnd,debugstr_a(pMonitorName));
return FALSE;
LPWSTR nameW = NULL;
LPWSTR monitorW = NULL;
DWORD len;
BOOL res;
TRACE("(%s, %p, %s)\n",debugstr_a(pName), hWnd, debugstr_a(pMonitorName));
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);
}
if (pMonitorName) {
len = MultiByteToWideChar(CP_ACP, 0, pMonitorName, -1, NULL, 0);
monitorW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, pMonitorName, -1, monitorW, len);
}
res = AddPortW(nameW, hWnd, monitorW);
HeapFree(GetProcessHeap(), 0, nameW);
HeapFree(GetProcessHeap(), 0, monitorW);
return res;
}
/******************************************************************************