From: Andrew Eikum Subject: Re: dsound: Avoid casts from COM object to interface. (v2) Message-Id: <20161209153349.GN10481@foghorn.codeweavers.com> Date: Fri, 9 Dec 2016 09:33:49 -0600 In-Reply-To: <20161209151005.GA4004@redhat.com> References: <20161209151005.GA4004@redhat.com> Signed-off-by: Andrew Eikum On Fri, Dec 09, 2016 at 04:10:05PM +0100, Michael Stefaniuc wrote: > Signed-off-by: Michael Stefaniuc > --- > v2: Don't change the order of assigment and AddRef. > > > > dlls/dsound/dsound.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/dlls/dsound/dsound.c b/dlls/dsound/dsound.c > index 43b252d..e8c10a7 100644 > --- a/dlls/dsound/dsound.c > +++ b/dlls/dsound/dsound.c > @@ -452,8 +452,8 @@ static HRESULT DirectSoundDevice_CreateSoundBuffer( > > if (device->primary) { > WARN("Primary Buffer already created\n"); > - IDirectSoundBuffer_AddRef((LPDIRECTSOUNDBUFFER8)(device->primary)); > - *ppdsb = (LPDIRECTSOUNDBUFFER)(device->primary); > + IDirectSoundBuffer8_AddRef(&device->primary->IDirectSoundBuffer8_iface); > + *ppdsb = (IDirectSoundBuffer *)&device->primary->IDirectSoundBuffer8_iface; > } else { > hres = primarybuffer_create(device, &device->primary, dsbd); > if (device->primary) { > -- > 2.7.4 > >