diff --git a/dlls/dmloader/container.c b/dlls/dmloader/container.c index 7356bc80478..2e15a716cbe 100644 --- a/dlls/dmloader/container.c +++ b/dlls/dmloader/container.c @@ -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, diff --git a/dlls/dmloader/dmobject.c b/dlls/dmloader/dmobject.c index 4afd5b923a2..cabb6f74db9 100644 --- a/dlls/dmloader/dmobject.c +++ b/dlls/dmloader/dmobject.c @@ -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) { diff --git a/dlls/dmloader/dmobject.h b/dlls/dmloader/dmobject.h index 35749395a7a..ad6bf6d14c6 100644 --- a/dlls/dmloader/dmobject.h +++ b/dlls/dmloader/dmobject.h @@ -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, diff --git a/dlls/dmloader/tests/loader.c b/dlls/dmloader/tests/loader.c index b2ba8fec400..4b141f3a0d4 100644 --- a/dlls/dmloader/tests/loader.c +++ b/dlls/dmloader/tests/loader.c @@ -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), diff --git a/dlls/dmusic/dmobject.c b/dlls/dmusic/dmobject.c index 4afd5b923a2..cabb6f74db9 100644 --- a/dlls/dmusic/dmobject.c +++ b/dlls/dmusic/dmobject.c @@ -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) { diff --git a/dlls/dmusic/dmobject.h b/dlls/dmusic/dmobject.h index 35749395a7a..ad6bf6d14c6 100644 --- a/dlls/dmusic/dmobject.h +++ b/dlls/dmusic/dmobject.h @@ -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,