propsys: Add support for VT_LPSTR to PropVariantChangeType.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
3a7fb75751
commit
db7e816c9c
|
@ -385,6 +385,31 @@ HRESULT WINAPI PropVariantChangeType(PROPVARIANT *ppropvarDest, REFPROPVARIANT p
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case VT_LPSTR:
|
||||||
|
{
|
||||||
|
WCHAR *resW;
|
||||||
|
hr = PropVariantToStringAlloc(propvarSrc, &resW);
|
||||||
|
if (SUCCEEDED(hr))
|
||||||
|
{
|
||||||
|
char *res;
|
||||||
|
DWORD len;
|
||||||
|
|
||||||
|
len = WideCharToMultiByte(CP_ACP, 0, resW, -1, NULL, 0, NULL, NULL);
|
||||||
|
res = CoTaskMemAlloc(len);
|
||||||
|
if (res)
|
||||||
|
{
|
||||||
|
WideCharToMultiByte(CP_ACP, 0, resW, -1, res, len, NULL, NULL);
|
||||||
|
ppropvarDest->vt = VT_LPSTR;
|
||||||
|
ppropvarDest->u.pszVal = res;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
hr = E_OUTOFMEMORY;
|
||||||
|
|
||||||
|
CoTaskMemFree(resW);
|
||||||
|
}
|
||||||
|
return hr;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
FIXME("Unhandled dest type: %d\n", vt);
|
FIXME("Unhandled dest type: %d\n", vt);
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
|
Loading…
Reference in New Issue