From 448986f1c4f89d0bb089f8d76e2aadbbba95a1fb Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Tue, 3 Apr 2012 00:22:12 +0200 Subject: [PATCH] devenum: COM cleanup for IParseDisplayName. --- dlls/devenum/devenum_private.h | 2 +- dlls/devenum/parsedisplayname.c | 36 ++++++++++++--------------------- 2 files changed, 14 insertions(+), 24 deletions(-) diff --git a/dlls/devenum/devenum_private.h b/dlls/devenum/devenum_private.h index fe3c5d235dc..45736a5146a 100644 --- a/dlls/devenum/devenum_private.h +++ b/dlls/devenum/devenum_private.h @@ -67,7 +67,7 @@ typedef struct typedef struct { - const IParseDisplayNameVtbl *lpVtbl; + IParseDisplayName IParseDisplayName_iface; } ParseDisplayNameImpl; typedef struct diff --git a/dlls/devenum/parsedisplayname.c b/dlls/devenum/parsedisplayname.c index b36b3edf97a..40850b29fd8 100644 --- a/dlls/devenum/parsedisplayname.c +++ b/dlls/devenum/parsedisplayname.c @@ -27,31 +27,28 @@ WINE_DEFAULT_DEBUG_CHANNEL(devenum); -static HRESULT WINAPI DEVENUM_IParseDisplayName_QueryInterface( - LPPARSEDISPLAYNAME iface, - REFIID riid, - LPVOID *ppvObj) +static HRESULT WINAPI DEVENUM_IParseDisplayName_QueryInterface(IParseDisplayName *iface, + REFIID riid, void **ppv) { TRACE("\n\tIID:\t%s\n",debugstr_guid(riid)); - if (ppvObj == NULL) return E_POINTER; + if (!ppv) + return E_POINTER; if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IParseDisplayName)) { - *ppvObj = iface; - IParseDisplayName_AddRef(iface); - return S_OK; + *ppv = iface; + IParseDisplayName_AddRef(iface); + return S_OK; } FIXME("- no interface IID: %s\n", debugstr_guid(riid)); + *ppv = NULL; return E_NOINTERFACE; } -/********************************************************************** - * DEVENUM_IParseDisplayName_AddRef (also IUnknown) - */ -static ULONG WINAPI DEVENUM_IParseDisplayName_AddRef(LPPARSEDISPLAYNAME iface) +static ULONG WINAPI DEVENUM_IParseDisplayName_AddRef(IParseDisplayName *iface) { TRACE("\n"); @@ -60,10 +57,7 @@ static ULONG WINAPI DEVENUM_IParseDisplayName_AddRef(LPPARSEDISPLAYNAME iface) return 2; /* non-heap based object */ } -/********************************************************************** - * DEVENUM_IParseDisplayName_Release (also IUnknown) - */ -static ULONG WINAPI DEVENUM_IParseDisplayName_Release(LPPARSEDISPLAYNAME iface) +static ULONG WINAPI DEVENUM_IParseDisplayName_Release(IParseDisplayName *iface) { TRACE("\n"); @@ -81,12 +75,8 @@ static ULONG WINAPI DEVENUM_IParseDisplayName_Release(LPPARSEDISPLAYNAME iface) * Might not handle more complicated strings properly (ie anything * not in "@device:sw:{CLSID1}\" format */ -static HRESULT WINAPI DEVENUM_IParseDisplayName_ParseDisplayName( - LPPARSEDISPLAYNAME iface, - IBindCtx *pbc, - LPOLESTR pszDisplayName, - ULONG *pchEaten, - IMoniker **ppmkOut) +static HRESULT WINAPI DEVENUM_IParseDisplayName_ParseDisplayName(IParseDisplayName *iface, + IBindCtx *pbc, LPOLESTR pszDisplayName, ULONG *pchEaten, IMoniker **ppmkOut) { LPOLESTR pszBetween = NULL; LPOLESTR pszClass = NULL; @@ -163,4 +153,4 @@ static const IParseDisplayNameVtbl IParseDisplayName_Vtbl = }; /* The one instance of this class */ -ParseDisplayNameImpl DEVENUM_ParseDisplayName = { &IParseDisplayName_Vtbl }; +ParseDisplayNameImpl DEVENUM_ParseDisplayName = { { &IParseDisplayName_Vtbl } };