[PATCH 0/1] MR1434: windowscodecs: Use standard C functions for memory allocation in metadataquery.c.
From: Alex Henrie <alexhenrie24(a)gmail.com> --- dlls/windowscodecs/metadataquery.c | 20 ++++++++++---------- dlls/windowscodecs/wincodecs_private.h | 10 ---------- 2 files changed, 10 insertions(+), 20 deletions(-) diff --git a/dlls/windowscodecs/metadataquery.c b/dlls/windowscodecs/metadataquery.c index c4df29a2a01..75da054cd38 100644 --- a/dlls/windowscodecs/metadataquery.c +++ b/dlls/windowscodecs/metadataquery.c @@ -86,8 +86,8 @@ static ULONG WINAPI mqr_Release(IWICMetadataQueryReader *iface) if (!ref) { IWICMetadataBlockReader_Release(This->block); - HeapFree(GetProcessHeap(), 0, This->root); - HeapFree(GetProcessHeap(), 0, This); + free(This->root); + free(This); } return ref; } @@ -461,7 +461,7 @@ static HRESULT WINAPI mqr_GetMetadataByName(IWICMetadataQueryReader *iface, LPCW len = lstrlenW(query) + 1; if (This->root) len += lstrlenW(This->root); - full_query = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + full_query = malloc(len * sizeof(WCHAR)); full_query[0] = 0; if (This->root) lstrcpyW(full_query, This->root); @@ -591,7 +591,7 @@ static HRESULT WINAPI mqr_GetMetadataByName(IWICMetadataQueryReader *iface, LPCW else PropVariantClear(&new_value); - HeapFree(GetProcessHeap(), 0, full_query); + free(full_query); return hr; } @@ -730,7 +730,7 @@ HRESULT MetadataQueryReader_CreateInstance(IWICMetadataBlockReader *mbr, const W { QueryReader *obj; - obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*obj)); + obj = calloc(1, sizeof(*obj)); if (!obj) return E_OUTOFMEMORY; @@ -740,7 +740,7 @@ HRESULT MetadataQueryReader_CreateInstance(IWICMetadataBlockReader *mbr, const W IWICMetadataBlockReader_AddRef(mbr); obj->block = mbr; - obj->root = root ? heap_strdupW(root) : NULL; + obj->root = wcsdup(root); *out = &obj->IWICMetadataQueryReader_iface; @@ -804,8 +804,8 @@ static ULONG WINAPI mqw_Release(IWICMetadataQueryWriter *iface) if (!ref) { IWICMetadataBlockWriter_Release(writer->block); - HeapFree(GetProcessHeap(), 0, writer->root); - HeapFree(GetProcessHeap(), 0, writer); + free(writer->root); + free(writer); } return ref; } @@ -870,7 +870,7 @@ HRESULT MetadataQueryWriter_CreateInstance(IWICMetadataBlockWriter *mbw, const W { QueryWriter *obj; - obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*obj)); + obj = calloc(1, sizeof(*obj)); if (!obj) return E_OUTOFMEMORY; @@ -880,7 +880,7 @@ HRESULT MetadataQueryWriter_CreateInstance(IWICMetadataBlockWriter *mbw, const W IWICMetadataBlockWriter_AddRef(mbw); obj->block = mbw; - obj->root = root ? heap_strdupW(root) : NULL; + obj->root = wcsdup(root); *out = &obj->IWICMetadataQueryWriter_iface; diff --git a/dlls/windowscodecs/wincodecs_private.h b/dlls/windowscodecs/wincodecs_private.h index 72227cf0cd2..6a5c4604cf5 100644 --- a/dlls/windowscodecs/wincodecs_private.h +++ b/dlls/windowscodecs/wincodecs_private.h @@ -229,16 +229,6 @@ extern HRESULT MetadataQueryReader_CreateInstance(IWICMetadataBlockReader *, con extern HRESULT MetadataQueryWriter_CreateInstance(IWICMetadataBlockWriter *, const WCHAR *, IWICMetadataQueryWriter **) DECLSPEC_HIDDEN; extern HRESULT stream_initialize_from_filehandle(IWICStream *iface, HANDLE hfile) DECLSPEC_HIDDEN; -static inline WCHAR *heap_strdupW(const WCHAR *src) -{ - WCHAR *dst; - SIZE_T len; - if (!src) return NULL; - len = (lstrlenW(src) + 1) * sizeof(WCHAR); - if ((dst = HeapAlloc(GetProcessHeap(), 0, len))) memcpy(dst, src, len); - return dst; -} - static inline const char *debug_wic_rect(const WICRect *rect) { if (!rect) return "(null)"; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/1434
Hi, It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated. The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details: The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=126346 Your paranoid android. === debian11 (32 bit report) === d3d8: stateblock: Timeout visual: Timeout d3d9: d3d9ex: Timeout device: Timeout stateblock: Timeout visual: Timeout d3dcompiler_43: asm: Timeout blob: Timeout hlsl_d3d11: Timeout hlsl_d3d9: Timeout reflection: Timeout d3dcompiler_46: asm: Timeout blob: Timeout hlsl_d3d11: Timeout hlsl_d3d9: Timeout reflection: Timeout d3dcompiler_47: asm: Timeout blob: Timeout hlsl_d3d11: Timeout hlsl_d3d9: Timeout reflection: Timeout d3drm: d3drm: Timeout vector: Timeout Report validation errors: d3dx10: Timeout === debian11 (build log) === WineRunWineTest.pl:error: The task timed out
This merge request was approved by Esme Povirk. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/1434
participants (4)
-
Alex Henrie -
Alex Henrie (@alexhenrie) -
Esme Povirk (@madewokherd) -
Marvin