dmloader: Add and use a generic IPersistStream_GetClassID.

This commit is contained in:
Michael Stefaniuc 2015-04-28 00:13:38 +02:00 committed by Alexandre Julliard
parent d9e0c9fb82
commit 8c6c7f6b49
6 changed files with 37 additions and 14 deletions

View File

@ -368,19 +368,6 @@ static inline IDirectMusicContainerImpl *impl_from_IPersistStream(IPersistStream
return CONTAINING_RECORD(iface, IDirectMusicContainerImpl, dmobj.IPersistStream_iface);
}
static HRESULT WINAPI IDirectMusicContainerImpl_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
IDirectMusicContainerImpl *This = impl_from_IPersistStream(iface);
TRACE("(%p, %p)\n", This, pClassID);
if (IsBadWritePtr (pClassID, sizeof(CLSID))) {
ERR(": pClassID bad write pointer\n");
return E_POINTER;
}
*pClassID = CLSID_DirectMusicContainer;
return S_OK;
}
static HRESULT WINAPI IDirectMusicContainerImpl_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) {
IDirectMusicContainerImpl *This = impl_from_IPersistStream(iface);
WINE_CHUNK Chunk;
@ -803,7 +790,7 @@ static const IPersistStreamVtbl persiststream_vtbl = {
dmobj_IPersistStream_QueryInterface,
dmobj_IPersistStream_AddRef,
dmobj_IPersistStream_Release,
IDirectMusicContainerImpl_IPersistStream_GetClassID,
dmobj_IPersistStream_GetClassID,
unimpl_IPersistStream_IsDirty,
IDirectMusicContainerImpl_IPersistStream_Load,
unimpl_IPersistStream_Save,

View File

@ -1,5 +1,6 @@
/*
* Base IDirectMusicObject Implementation
* Keep in sync with the master in dlls/dmusic/dmobject.c
*
* Copyright (C) 2003-2004 Rok Mandeljc
* Copyright (C) 2014 Michael Stefaniuc
@ -134,6 +135,20 @@ ULONG WINAPI dmobj_IPersistStream_Release(IPersistStream *iface)
return IUnknown_Release(This->outer_unk);
}
HRESULT WINAPI dmobj_IPersistStream_GetClassID(IPersistStream *iface, CLSID *class)
{
struct dmobject *This = impl_from_IPersistStream(iface);
TRACE("(%p, %p)\n", This, class);
if (!class)
return E_POINTER;
*class = This->desc.guidClass;
return S_OK;
}
/* IPersistStream methods not implemented in native */
HRESULT WINAPI unimpl_IPersistStream_GetClassID(IPersistStream *iface, CLSID *class)
{

View File

@ -1,5 +1,6 @@
/*
* Base IDirectMusicObject Implementation
* Keep in sync with the master in dlls/dmusic/dmobject.h
*
* Copyright (C) 2014 Michael Stefaniuc
*
@ -42,6 +43,7 @@ HRESULT WINAPI dmobj_IPersistStream_QueryInterface(IPersistStream *iface, REFIID
void **ret_iface) DECLSPEC_HIDDEN;
ULONG WINAPI dmobj_IPersistStream_AddRef(IPersistStream *iface) DECLSPEC_HIDDEN;
ULONG WINAPI dmobj_IPersistStream_Release(IPersistStream *iface) DECLSPEC_HIDDEN;
HRESULT WINAPI dmobj_IPersistStream_GetClassID(IPersistStream *iface, CLSID *class) DECLSPEC_HIDDEN;
/* IPersistStream methods not implemented in native */
HRESULT WINAPI unimpl_IPersistStream_GetClassID(IPersistStream *iface,

View File

@ -267,6 +267,8 @@ static void test_container(void)
/* IPersistStream */
hr = IDirectMusicContainer_QueryInterface(dmc, &IID_IPersistStream, (void**)&ps);
ok(hr == S_OK, "QueryInterface for IID_IPersistStream failed: %08x\n", hr);
hr = IPersistStream_GetClassID(ps, NULL);
ok(hr == E_POINTER, "IPersistStream_GetClassID failed: %08x\n", hr);
hr = IPersistStream_GetClassID(ps, &class);
ok(hr == S_OK, "IPersistStream_GetClassID failed: %08x\n", hr);
ok(IsEqualGUID(&class, &CLSID_DirectMusicContainer),

View File

@ -1,5 +1,6 @@
/*
* Base IDirectMusicObject Implementation
* Keep in sync with the master in dlls/dmusic/dmobject.c
*
* Copyright (C) 2003-2004 Rok Mandeljc
* Copyright (C) 2014 Michael Stefaniuc
@ -134,6 +135,20 @@ ULONG WINAPI dmobj_IPersistStream_Release(IPersistStream *iface)
return IUnknown_Release(This->outer_unk);
}
HRESULT WINAPI dmobj_IPersistStream_GetClassID(IPersistStream *iface, CLSID *class)
{
struct dmobject *This = impl_from_IPersistStream(iface);
TRACE("(%p, %p)\n", This, class);
if (!class)
return E_POINTER;
*class = This->desc.guidClass;
return S_OK;
}
/* IPersistStream methods not implemented in native */
HRESULT WINAPI unimpl_IPersistStream_GetClassID(IPersistStream *iface, CLSID *class)
{

View File

@ -1,5 +1,6 @@
/*
* Base IDirectMusicObject Implementation
* Keep in sync with the master in dlls/dmusic/dmobject.h
*
* Copyright (C) 2014 Michael Stefaniuc
*
@ -42,6 +43,7 @@ HRESULT WINAPI dmobj_IPersistStream_QueryInterface(IPersistStream *iface, REFIID
void **ret_iface) DECLSPEC_HIDDEN;
ULONG WINAPI dmobj_IPersistStream_AddRef(IPersistStream *iface) DECLSPEC_HIDDEN;
ULONG WINAPI dmobj_IPersistStream_Release(IPersistStream *iface) DECLSPEC_HIDDEN;
HRESULT WINAPI dmobj_IPersistStream_GetClassID(IPersistStream *iface, CLSID *class) DECLSPEC_HIDDEN;
/* IPersistStream methods not implemented in native */
HRESULT WINAPI unimpl_IPersistStream_GetClassID(IPersistStream *iface,