msi: Fix conversion of path to include nul-termination character in MsiProvideQualifiedComponentA.
This commit is contained in:
parent
d2cb9ec567
commit
aea12b4695
|
@ -1617,7 +1617,7 @@ UINT WINAPI MsiProvideQualifiedComponentA( LPCSTR szComponent,
|
||||||
DWORD* pcchPathBuf)
|
DWORD* pcchPathBuf)
|
||||||
{
|
{
|
||||||
LPWSTR szwComponent, szwQualifier, lpwPathBuf;
|
LPWSTR szwComponent, szwQualifier, lpwPathBuf;
|
||||||
DWORD pcchwPathBuf;
|
DWORD cchwPathBuf;
|
||||||
UINT rc;
|
UINT rc;
|
||||||
|
|
||||||
TRACE("%s %s %li %p %p\n",szComponent, szQualifier,
|
TRACE("%s %s %li %p %p\n",szComponent, szQualifier,
|
||||||
|
@ -1628,16 +1628,16 @@ UINT WINAPI MsiProvideQualifiedComponentA( LPCSTR szComponent,
|
||||||
|
|
||||||
lpwPathBuf = msi_alloc(*pcchPathBuf * sizeof(WCHAR));
|
lpwPathBuf = msi_alloc(*pcchPathBuf * sizeof(WCHAR));
|
||||||
|
|
||||||
pcchwPathBuf = *pcchPathBuf;
|
cchwPathBuf = *pcchPathBuf;
|
||||||
|
|
||||||
rc = MsiProvideQualifiedComponentW(szwComponent, szwQualifier,
|
rc = MsiProvideQualifiedComponentW(szwComponent, szwQualifier,
|
||||||
dwInstallMode, lpwPathBuf, &pcchwPathBuf);
|
dwInstallMode, lpwPathBuf, &cchwPathBuf);
|
||||||
|
|
||||||
msi_free(szwComponent);
|
msi_free(szwComponent);
|
||||||
msi_free(szwQualifier);
|
msi_free(szwQualifier);
|
||||||
|
|
||||||
if (rc == ERROR_SUCCESS)
|
if (rc == ERROR_SUCCESS)
|
||||||
*pcchPathBuf = WideCharToMultiByte(CP_ACP, 0, lpwPathBuf, pcchwPathBuf,
|
*pcchPathBuf = WideCharToMultiByte(CP_ACP, 0, lpwPathBuf, cchwPathBuf + 1,
|
||||||
lpPathBuf, *pcchPathBuf, NULL, NULL);
|
lpPathBuf, *pcchPathBuf, NULL, NULL);
|
||||||
|
|
||||||
msi_free(lpwPathBuf);
|
msi_free(lpwPathBuf);
|
||||||
|
|
Loading…
Reference in New Issue