Commit 97c51208 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

propsys: Add support for VT_LPWSTR and VT_BSTR to PropVariantToStringAlloc.

parent 09a2547f
...@@ -224,6 +224,7 @@ HRESULT WINAPI PropVariantToStringAlloc(REFPROPVARIANT propvarIn, WCHAR **ret) ...@@ -224,6 +224,7 @@ HRESULT WINAPI PropVariantToStringAlloc(REFPROPVARIANT propvarIn, WCHAR **ret)
res = CoTaskMemAlloc(1*sizeof(WCHAR)); res = CoTaskMemAlloc(1*sizeof(WCHAR));
res[0] = '\0'; res[0] = '\0';
break; break;
case VT_LPSTR: case VT_LPSTR:
if(propvarIn->u.pszVal) if(propvarIn->u.pszVal)
{ {
...@@ -237,6 +238,18 @@ HRESULT WINAPI PropVariantToStringAlloc(REFPROPVARIANT propvarIn, WCHAR **ret) ...@@ -237,6 +238,18 @@ HRESULT WINAPI PropVariantToStringAlloc(REFPROPVARIANT propvarIn, WCHAR **ret)
MultiByteToWideChar(CP_ACP, 0, propvarIn->u.pszVal, -1, res, len); MultiByteToWideChar(CP_ACP, 0, propvarIn->u.pszVal, -1, res, len);
} }
break; break;
case VT_LPWSTR:
case VT_BSTR:
if (propvarIn->u.pwszVal)
{
DWORD size = (lstrlenW(propvarIn->u.pwszVal) + 1) * sizeof(WCHAR);
res = CoTaskMemAlloc(size);
if(!res) return E_OUTOFMEMORY;
memcpy(res, propvarIn->u.pwszVal, size);
}
break;
default: default:
FIXME("Unsupported conversion (%d)\n", propvarIn->vt); FIXME("Unsupported conversion (%d)\n", propvarIn->vt);
hr = E_FAIL; hr = E_FAIL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment