Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/ddrawex/tests/ddrawex.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/dlls/ddrawex/tests/ddrawex.c b/dlls/ddrawex/tests/ddrawex.c index 1cff73776fd..59268444ea2 100644 --- a/dlls/ddrawex/tests/ddrawex.c +++ b/dlls/ddrawex/tests/ddrawex.c @@ -37,10 +37,11 @@ static IDirectDraw *createDDraw(void) return SUCCEEDED(hr) ? dd : NULL; }
-static ULONG get_ref(IUnknown *o) +static ULONG get_refcount(void *iface) { - IUnknown_AddRef(o); - return IUnknown_Release(o); + IUnknown *unknown = iface; + IUnknown_AddRef(unknown); + return IUnknown_Release(unknown); }
static void RefCountTest(void) @@ -52,11 +53,11 @@ static void RefCountTest(void) HRESULT hr; ULONG ref;
- ref = get_ref((IUnknown *) dd1); + ref = get_refcount(dd1); ok(ref == 1, "Unexpected refcount %lu.\n", ref);
IDirectDraw_AddRef(dd1); - ref = get_ref((IUnknown *) dd1); + ref = get_refcount(dd1); if (ref == 1) { win_skip("Refcounting is broken\n"); @@ -65,15 +66,15 @@ static void RefCountTest(void) } ok(ref == 2, "Unexpected refcount %lu.\n", ref); IDirectDraw_Release(dd1); - ref = get_ref((IUnknown *) dd1); + ref = get_refcount(dd1); ok(ref == 1, "Unexpected refcount %lu.\n", ref);
IDirectDraw_QueryInterface(dd1, &IID_IDirectDraw2, (void **) &dd2); - ref = get_ref((IUnknown *) dd2); + ref = get_refcount(dd2); ok(ref == 2, "Unexpected refcount %lu.\n", ref);
IDirectDraw_QueryInterface(dd1, &IID_IDirectDraw3, (void **) &dd3); - ref = get_ref((IUnknown *) dd3); + ref = get_refcount(dd3); ok(ref == 3, "Unexpected refcount %lu.\n", ref);
hr = IDirectDraw_QueryInterface(dd1, &IID_IDirectDraw4, (void **) &dd4); @@ -85,14 +86,14 @@ static void RefCountTest(void) IDirectDraw3_Release(dd3); return; } - ref = get_ref((IUnknown *) dd4); + ref = get_refcount(dd4); ok(ref == 4, "Unexpected refcount %lu.\n", ref);
IDirectDraw_Release(dd1); IDirectDraw2_Release(dd2); IDirectDraw3_Release(dd3);
- ref = get_ref((IUnknown *) dd4); + ref = get_refcount(dd4); ok(ref == 1, "Unexpected refcount %lu.\n", ref);
IDirectDraw4_Release(dd4);