windowscodecs: Store an impl pointer instead of an iface pointer.

This commit is contained in:
Vincent Povirk 2011-01-04 14:01:45 -06:00 committed by Alexandre Julliard
parent 11c3150ba9
commit 5fd834fc95
1 changed files with 4 additions and 5 deletions

View File

@ -410,7 +410,7 @@ typedef struct BmpEncoder {
const IWICBitmapEncoderVtbl *lpVtbl;
LONG ref;
IStream *stream;
IWICBitmapFrameEncode *frame;
BmpFrameEncode *frame;
} BmpEncoder;
static HRESULT WINAPI BmpEncoder_QueryInterface(IWICBitmapEncoder *iface, REFIID iid,
@ -456,7 +456,7 @@ static ULONG WINAPI BmpEncoder_Release(IWICBitmapEncoder *iface)
if (ref == 0)
{
if (This->stream) IStream_Release(This->stream);
if (This->frame) IWICBitmapFrameEncode_Release(This->frame);
if (This->frame) IWICBitmapFrameEncode_Release((IWICBitmapFrameEncode*)This->frame);
HeapFree(GetProcessHeap(), 0, This);
}
@ -553,7 +553,7 @@ static HRESULT WINAPI BmpEncoder_CreateNewFrame(IWICBitmapEncoder *iface,
encode->committed = FALSE;
*ppIFrameEncode = (IWICBitmapFrameEncode*)encode;
This->frame = (IWICBitmapFrameEncode*)encode;
This->frame = encode;
return S_OK;
}
@ -561,10 +561,9 @@ static HRESULT WINAPI BmpEncoder_CreateNewFrame(IWICBitmapEncoder *iface,
static HRESULT WINAPI BmpEncoder_Commit(IWICBitmapEncoder *iface)
{
BmpEncoder *This = (BmpEncoder*)iface;
BmpFrameEncode *frame = (BmpFrameEncode*)This->frame;
TRACE("(%p)\n", iface);
if (!frame || !frame->committed) return WINCODEC_ERR_WRONGSTATE;
if (!This->frame || !This->frame->committed) return WINCODEC_ERR_WRONGSTATE;
return S_OK;
}