Zebediah Figura : quartz/tests: Use CRT memory allocators.

Alexandre Julliard julliard at winehq.org
Mon May 17 15:45:29 CDT 2021


Module: wine
Branch: master
Commit: 226897bec73768f78c9ea2137c34d0df87c54fe2
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=226897bec73768f78c9ea2137c34d0df87c54fe2

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Sun May 16 16:37:27 2021 -0500

quartz/tests: Use CRT memory allocators.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/quartz/tests/filtergraph.c   | 11 ++---------
 dlls/quartz/tests/videorenderer.c |  5 ++---
 dlls/quartz/tests/vmr7.c          |  5 ++---
 dlls/quartz/tests/vmr9.c          |  5 ++---
 4 files changed, 8 insertions(+), 18 deletions(-)

diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c
index b2d5b4e26e8..c663b5d8a99 100644
--- a/dlls/quartz/tests/filtergraph.c
+++ b/dlls/quartz/tests/filtergraph.c
@@ -23,7 +23,6 @@
 #define CONST_VTABLE
 
 #include "dshow.h"
-#include "wine/heap.h"
 #include "wine/test.h"
 
 static const GUID testguid = {0xabbccdde};
@@ -1486,14 +1485,8 @@ static HRESULT WINAPI testfilter_JoinFilterGraph(IBaseFilter *iface, IFilterGrap
     if (winetest_debug > 1) trace("%p->JoinFilterGraph(%p, %s)\n", filter, graph, wine_dbgstr_w(name));
 
     filter->graph = graph;
-    heap_free(filter->name);
-    if (name)
-    {
-        filter->name = heap_alloc((wcslen(name) + 1) * sizeof(WCHAR));
-        wcscpy(filter->name, name);
-    }
-    else
-        filter->name = NULL;
+    free(filter->name);
+    filter->name = name ? wcsdup(name) : NULL;
     return S_OK;
 }
 
diff --git a/dlls/quartz/tests/videorenderer.c b/dlls/quartz/tests/videorenderer.c
index ffe370acf43..f4d9660316c 100644
--- a/dlls/quartz/tests/videorenderer.c
+++ b/dlls/quartz/tests/videorenderer.c
@@ -20,7 +20,6 @@
 
 #define COBJMACROS
 #include "dshow.h"
-#include "wine/heap.h"
 #include "wine/strmbase.h"
 #include "wine/test.h"
 
@@ -765,13 +764,13 @@ static DWORD WINAPI frame_thread(void *arg)
     hr = IMemInputPin_Receive(params->sink, params->sample);
     if (winetest_debug > 1) trace("%04x: Returned %#x.\n", GetCurrentThreadId(), hr);
     IMediaSample_Release(params->sample);
-    heap_free(params);
+    free(params);
     return hr;
 }
 
 static HANDLE send_frame_time(IMemInputPin *sink, REFERENCE_TIME start_time, unsigned char color)
 {
-    struct frame_thread_params *params = heap_alloc(sizeof(*params));
+    struct frame_thread_params *params = malloc(sizeof(*params));
     IMemAllocator *allocator;
     REFERENCE_TIME end_time;
     IMediaSample *sample;
diff --git a/dlls/quartz/tests/vmr7.c b/dlls/quartz/tests/vmr7.c
index ba2a98cb69d..212ce213e89 100644
--- a/dlls/quartz/tests/vmr7.c
+++ b/dlls/quartz/tests/vmr7.c
@@ -23,7 +23,6 @@
 #include "dshow.h"
 #include "d3d9.h"
 #include "vmr9.h"
-#include "wine/heap.h"
 #include "wine/strmbase.h"
 #include "wine/test.h"
 
@@ -969,13 +968,13 @@ static DWORD WINAPI frame_thread(void *arg)
     hr = IMemInputPin_Receive(params->sink, params->sample);
     if (winetest_debug > 1) trace("%04x: Returned %#x.\n", GetCurrentThreadId(), hr);
     IMediaSample_Release(params->sample);
-    heap_free(params);
+    free(params);
     return hr;
 }
 
 static HANDLE send_frame(IMemInputPin *sink)
 {
-    struct frame_thread_params *params = heap_alloc(sizeof(*params));
+    struct frame_thread_params *params = malloc(sizeof(*params));
     REFERENCE_TIME start_time, end_time;
     IMemAllocator *allocator;
     IMediaSample *sample;
diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c
index 8b46e4706a5..44b9a453305 100644
--- a/dlls/quartz/tests/vmr9.c
+++ b/dlls/quartz/tests/vmr9.c
@@ -28,7 +28,6 @@
 #include "d3d9.h"
 #include "vmr9.h"
 #include "wmcodecdsp.h"
-#include "wine/heap.h"
 #include "wine/strmbase.h"
 #include "wine/test.h"
 
@@ -976,13 +975,13 @@ static DWORD WINAPI frame_thread(void *arg)
     hr = IMemInputPin_Receive(params->sink, params->sample);
     if (winetest_debug > 1) trace("%04x: Returned %#x.\n", GetCurrentThreadId(), hr);
     IMediaSample_Release(params->sample);
-    heap_free(params);
+    free(params);
     return hr;
 }
 
 static HANDLE send_frame_time(IMemInputPin *sink, REFERENCE_TIME start_time, DWORD color)
 {
-    struct frame_thread_params *params = heap_alloc(sizeof(*params));
+    struct frame_thread_params *params = malloc(sizeof(*params));
     IMemAllocator *allocator;
     REFERENCE_TIME end_time;
     IMediaSample *sample;




More information about the wine-cvs mailing list