On 18.07.2015 19:26, Jonas Kümmerlin wrote:
+HRESULT WINAPI StgDeserializePropVariant(const SERIALIZEDPROPERTYVALUE *pprop, + ULONG cbMax, + PROPVARIANT *pvar) +{ + PMemoryAllocator allocator; + struct _PMemoryAllocator_vtable vtbl; + + TRACE("(%p, %lu, %p)\n", pprop, (unsigned long)cbMax, pvar);
I don't think you need that cast.
+ + allocator.vt = &vtbl; + setup_allocator_vtable(&vtbl); + + if (!pprop || !pvar) + return E_INVALIDARG; + + __TRY + { + StgConvertPropertyToVariant(pprop, CP_UNICODE, pvar, &allocator); + } + __EXCEPT_ALL
Another question is if you need this allocator complexity at all, it's possible that ole32 call will use CoTaskMem* functions for NULL allocator pointer, I don't see any tests in ole32/tests for that.