On 18.11.2014 20:59, Mark Harmstone wrote:
- if (SUCCEEDED(hr))
- {
MMDevice_SetPropValue(id, flow, prop, &pv);
if (pv.vt == VT_LPWSTR)
HeapFree(GetProcessHeap(), 0, pv.u.pwszVal);
- }
out->vt = VT_LPWSTR;
out->u.pwszVal = HeapAlloc(GetProcessHeap(), 0, 256 * sizeof(WCHAR));
This is a wrong way dealing with PROPVARIANT, you need to use PropVariantClear() and InitPropVariantFromString() - PROPVARIANT implies CoTaskMemAlloc/CoTaskMemFree memory management.