On Fri, Nov 25, 2016 at 12:49:40AM +0100, Detlef Riekenberg wrote:
- if ((Level > 7) && diA->pszzColorProfiles) {
len = MultiByteToWideChar(CP_ACP, 0, diA->pszzColorProfiles, -1, NULL, 0);
diW.pszzColorProfiles = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, diA->pszzColorProfiles, -1, diW.pszzColorProfiles, len);
- }
This is a 'multi-sz' string, so you need the same handling as 'pDependentFiles' here.
- if ((Level > 7) && diA->pszInfPath) {
len = MultiByteToWideChar(CP_ACP, 0, diA->pszInfPath, -1, NULL, 0);
diW.pszInfPath = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, diA->pszInfPath, -1, diW.pszInfPath, len);
- }
- if ((Level > 7) && diA->pszzCoreDriverDependencies) {
len = MultiByteToWideChar(CP_ACP, 0, diA->pszzCoreDriverDependencies, -1, NULL, 0);
diW.pszzCoreDriverDependencies = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, diA->pszzCoreDriverDependencies, -1, diW.pszzCoreDriverDependencies, len);
- }
The same goes for pszzCoreDriverDependencies.
if (Level > 7) {
FIXME("level %u is incomplete\n", Level);
diW.dwPrinterDriverAttributes = diA->dwPrinterDriverAttributes;
diW.ftMinInboxDriverVerDate = diA->ftMinInboxDriverVerDate;
diW.dwlMinInboxDriverVerVersion = diA->dwlMinInboxDriverVerVersion;
}
res = AddPrinterDriverExW(nameW, Level, (LPBYTE) &diW, dwFileCopyFlags);
@@ -7018,6 +7061,11 @@ BOOL WINAPI AddPrinterDriverExA(LPSTR pName, DWORD Level, LPBYTE pDriverInfo, DW
You're leaking pHelpFile.
HeapFree(GetProcessHeap(), 0, diW.pszOEMUrl); HeapFree(GetProcessHeap(), 0, diW.pszHardwareID); HeapFree(GetProcessHeap(), 0, diW.pszProvider);
HeapFree(GetProcessHeap(), 0, diW.pszPrintProcessor);
HeapFree(GetProcessHeap(), 0, diW.pszVendorSetup);
HeapFree(GetProcessHeap(), 0, diW.pszzColorProfiles);
HeapFree(GetProcessHeap(), 0, diW.pszInfPath);
HeapFree(GetProcessHeap(), 0, diW.pszzCoreDriverDependencies);
TRACE("=> %u with %u\n", res, GetLastError()); return res;