mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 05:21:08 +00:00
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;
|
||||
}
|
||||
|
||||
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:
|
||||
FIXME("Unhandled dest type: %d\n", vt);
|
||||
return E_FAIL;
|
||||
|
|
Loading…
Reference in a new issue