Commit 8780853a authored by Stefan Leichter's avatar Stefan Leichter Committed by Alexandre Julliard

Make GetPrinterDriverDirectoryA pass all tests.

parent 88b11064
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment