On 6 March 2014 16:59, Stefan Dösinger stefan@codeweavers.com wrote:
+static inline HRESULT wined3d_private_store_free_private_data(struct wined3d_private_store *store, const GUID *guid) +{
- struct wined3d_private_data *entry;
- entry = wined3d_private_store_get_private_data(store, guid);
- if (!entry)
return WINED3DERR_NOTFOUND;
- if (entry->flags & WINED3DSPD_IUNKNOWN)
IUnknown_Release(entry->content.object);
- else
HeapFree(GetProcessHeap(), 0, entry->content.data);
- list_remove(&entry->entry);
- HeapFree(GetProcessHeap(), 0, entry);
- return WINED3D_OK;
+}
I think it would make more sense to pass this a struct wined3d_private_data pointer instead of a GUID.
Am 06.03.2014 um 18:58 schrieb Henri Verbeet hverbeet@gmail.com:
On 6 March 2014 16:59, Stefan Dösinger stefan@codeweavers.com wrote:
+static inline HRESULT wined3d_private_store_free_private_data(struct wined3d_private_store *store, const GUID *guid) +{
- struct wined3d_private_data *entry;
- entry = wined3d_private_store_get_private_data(store, guid);
- if (!entry)
return WINED3DERR_NOTFOUND;
- if (entry->flags & WINED3DSPD_IUNKNOWN)
IUnknown_Release(entry->content.object);
- else
HeapFree(GetProcessHeap(), 0, entry->content.data);
- list_remove(&entry->entry);
- HeapFree(GetProcessHeap(), 0, entry);
- return WINED3D_OK;
+}
I think it would make more sense to pass this a struct wined3d_private_data pointer instead of a GUID.
I prefer to keep it this way. The bigger the difference between the original resource API and these helper functions is the bigger the wrapper functions in each client dll become.