comctl32/tests: Standardize COM in imagelist.c.

This commit is contained in:
Michael Stefaniuc 2011-09-27 10:21:55 +02:00 committed by Alexandre Julliard
parent a1f5029e06
commit af27b03967
1 changed files with 31 additions and 57 deletions

View File

@ -574,39 +574,37 @@ static void test_merge(void)
struct my_IStream struct my_IStream
{ {
IStream is; IStream IStream_iface;
char *iml_data; /* written imagelist data */ char *iml_data; /* written imagelist data */
ULONG iml_data_size; ULONG iml_data_size;
}; };
static HRESULT STDMETHODCALLTYPE Test_Stream_QueryInterface( struct my_IStream *impl_from_IStream(IStream *iface)
IStream* This, {
REFIID riid, return CONTAINING_RECORD(iface, struct my_IStream, IStream_iface);
void** ppvObject) }
static HRESULT STDMETHODCALLTYPE Test_Stream_QueryInterface(IStream *iface, REFIID riid,
void **ppvObject)
{ {
assert(0); assert(0);
return E_NOTIMPL; return E_NOTIMPL;
} }
static ULONG STDMETHODCALLTYPE Test_Stream_AddRef( static ULONG STDMETHODCALLTYPE Test_Stream_AddRef(IStream *iface)
IStream* This)
{ {
assert(0); assert(0);
return 2; return 2;
} }
static ULONG STDMETHODCALLTYPE Test_Stream_Release( static ULONG STDMETHODCALLTYPE Test_Stream_Release(IStream *iface)
IStream* This)
{ {
assert(0); assert(0);
return 1; return 1;
} }
static HRESULT STDMETHODCALLTYPE Test_Stream_Read( static HRESULT STDMETHODCALLTYPE Test_Stream_Read(IStream *iface, void *pv, ULONG cb,
IStream* This, ULONG *pcbRead)
void* pv,
ULONG cb,
ULONG* pcbRead)
{ {
assert(0); assert(0);
return E_NOTIMPL; return E_NOTIMPL;
@ -624,13 +622,10 @@ static BOOL allocate_storage(struct my_IStream *my_is, ULONG add)
return my_is->iml_data ? TRUE : FALSE; return my_is->iml_data ? TRUE : FALSE;
} }
static HRESULT STDMETHODCALLTYPE Test_Stream_Write( static HRESULT STDMETHODCALLTYPE Test_Stream_Write(IStream *iface, const void *pv, ULONG cb,
IStream* This, ULONG *pcbWritten)
const void* pv,
ULONG cb,
ULONG* pcbWritten)
{ {
struct my_IStream *my_is = (struct my_IStream *)This; struct my_IStream *my_is = impl_from_IStream(iface);
ULONG current_iml_data_size = my_is->iml_data_size; ULONG current_iml_data_size = my_is->iml_data_size;
if (!allocate_storage(my_is, cb)) return E_FAIL; if (!allocate_storage(my_is, cb)) return E_FAIL;
@ -641,82 +636,61 @@ static HRESULT STDMETHODCALLTYPE Test_Stream_Write(
return S_OK; return S_OK;
} }
static HRESULT STDMETHODCALLTYPE Test_Stream_Seek( static HRESULT STDMETHODCALLTYPE Test_Stream_Seek(IStream *iface, LARGE_INTEGER dlibMove,
IStream* This, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
LARGE_INTEGER dlibMove,
DWORD dwOrigin,
ULARGE_INTEGER* plibNewPosition)
{ {
assert(0); assert(0);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT STDMETHODCALLTYPE Test_Stream_SetSize( static HRESULT STDMETHODCALLTYPE Test_Stream_SetSize(IStream *iface, ULARGE_INTEGER libNewSize)
IStream* This,
ULARGE_INTEGER libNewSize)
{ {
assert(0); assert(0);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT STDMETHODCALLTYPE Test_Stream_CopyTo( static HRESULT STDMETHODCALLTYPE Test_Stream_CopyTo(IStream *iface, IStream *pstm,
IStream* This, ULARGE_INTEGER cb, ULARGE_INTEGER *pcbRead,
IStream* pstm, ULARGE_INTEGER *pcbWritten)
ULARGE_INTEGER cb,
ULARGE_INTEGER* pcbRead,
ULARGE_INTEGER* pcbWritten)
{ {
assert(0); assert(0);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT STDMETHODCALLTYPE Test_Stream_Commit( static HRESULT STDMETHODCALLTYPE Test_Stream_Commit(IStream *iface, DWORD grfCommitFlags)
IStream* This,
DWORD grfCommitFlags)
{ {
assert(0); assert(0);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT STDMETHODCALLTYPE Test_Stream_Revert( static HRESULT STDMETHODCALLTYPE Test_Stream_Revert(IStream *iface)
IStream* This)
{ {
assert(0); assert(0);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT STDMETHODCALLTYPE Test_Stream_LockRegion( static HRESULT STDMETHODCALLTYPE Test_Stream_LockRegion(IStream *iface, ULARGE_INTEGER libOffset,
IStream* This, ULARGE_INTEGER cb, DWORD dwLockType)
ULARGE_INTEGER libOffset,
ULARGE_INTEGER cb,
DWORD dwLockType)
{ {
assert(0); assert(0);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT STDMETHODCALLTYPE Test_Stream_UnlockRegion( static HRESULT STDMETHODCALLTYPE Test_Stream_UnlockRegion(IStream *iface, ULARGE_INTEGER libOffset,
IStream* This, ULARGE_INTEGER cb, DWORD dwLockType)
ULARGE_INTEGER libOffset,
ULARGE_INTEGER cb,
DWORD dwLockType)
{ {
assert(0); assert(0);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT STDMETHODCALLTYPE Test_Stream_Stat( static HRESULT STDMETHODCALLTYPE Test_Stream_Stat(IStream *iface, STATSTG *pstatstg,
IStream* This,
STATSTG* pstatstg,
DWORD grfStatFlag) DWORD grfStatFlag)
{ {
assert(0); assert(0);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT STDMETHODCALLTYPE Test_Stream_Clone( static HRESULT STDMETHODCALLTYPE Test_Stream_Clone(IStream *iface, IStream **ppstm)
IStream* This,
IStream** ppstm)
{ {
assert(0); assert(0);
return E_NOTIMPL; return E_NOTIMPL;
@ -866,7 +840,7 @@ static void check_iml_data(HIMAGELIST himl, INT cx, INT cy, INT cur, INT max, IN
ok(cyy == cy, "wrong cy %d (expected %d)\n", cyy, cy); ok(cyy == cy, "wrong cy %d (expected %d)\n", cyy, cy);
iml_clear_stream_data(); iml_clear_stream_data();
ret = ImageList_Write(himl, &Test_Stream.is); ret = ImageList_Write(himl, &Test_Stream.IStream_iface);
ok(ret, "ImageList_Write failed\n"); ok(ret, "ImageList_Write failed\n");
ok(Test_Stream.iml_data != 0, "ImageList_Write didn't write any data\n"); ok(Test_Stream.iml_data != 0, "ImageList_Write didn't write any data\n");