msi: Fix conversion of path to include nul-termination character in MsiProvideQualifiedComponentA.

This commit is contained in:
Robert Shearman 2006-07-17 20:19:19 +01:00 committed by Alexandre Julliard
parent d2cb9ec567
commit aea12b4695
1 changed files with 4 additions and 4 deletions

View File

@ -1617,7 +1617,7 @@ UINT WINAPI MsiProvideQualifiedComponentA( LPCSTR szComponent,
DWORD* pcchPathBuf)
{
LPWSTR szwComponent, szwQualifier, lpwPathBuf;
DWORD pcchwPathBuf;
DWORD cchwPathBuf;
UINT rc;
TRACE("%s %s %li %p %p\n",szComponent, szQualifier,
@ -1628,16 +1628,16 @@ UINT WINAPI MsiProvideQualifiedComponentA( LPCSTR szComponent,
lpwPathBuf = msi_alloc(*pcchPathBuf * sizeof(WCHAR));
pcchwPathBuf = *pcchPathBuf;
cchwPathBuf = *pcchPathBuf;
rc = MsiProvideQualifiedComponentW(szwComponent, szwQualifier,
dwInstallMode, lpwPathBuf, &pcchwPathBuf);
dwInstallMode, lpwPathBuf, &cchwPathBuf);
msi_free(szwComponent);
msi_free(szwQualifier);
if (rc == ERROR_SUCCESS)
*pcchPathBuf = WideCharToMultiByte(CP_ACP, 0, lpwPathBuf, pcchwPathBuf,
*pcchPathBuf = WideCharToMultiByte(CP_ACP, 0, lpwPathBuf, cchwPathBuf + 1,
lpPathBuf, *pcchPathBuf, NULL, NULL);
msi_free(lpwPathBuf);