Make GetPrinterDriverDirectoryA pass all tests.

This commit is contained in:
Stefan Leichter 2003-01-15 00:51:16 +00:00 committed by Alexandre Julliard
parent 88b1106492
commit 8780853ab7
1 changed files with 4 additions and 3 deletions

View File

@ -2505,11 +2505,12 @@ BOOL WINAPI GetPrinterDriverDirectoryA(LPSTR pName, LPSTR pEnvironment,
ret = GetPrinterDriverDirectoryW( nameW.Buffer, environmentW.Buffer, Level,
(LPBYTE)driverDirectoryW, len, &pcbNeededW );
if (ret) {
ret = WideCharToMultiByte( CP_ACP, 0, driverDirectoryW, -1,
DWORD needed;
needed = 1 + WideCharToMultiByte( CP_ACP, 0, driverDirectoryW, -1,
pDriverDirectory, cbBuf, NULL, NULL);
if(pcbNeeded)
*pcbNeeded = WideCharToMultiByte( CP_ACP, 0, driverDirectoryW, -1,
NULL, 0, NULL, NULL);
*pcbNeeded = needed;
ret = (needed <= cbBuf) ? TRUE : FALSE;
} else
if(pcbNeeded) *pcbNeeded = pcbNeededW * sizeof(CHAR)/sizeof(WCHAR);