Properly implement DllCanUnloadNow ref counting.
This commit is contained in:
parent
7a03fd6763
commit
f238cd88e8
|
@ -55,6 +55,9 @@ HRESULT WINAPI IDirectMusicChordMapImpl_IUnknown_QueryInterface (LPUNKNOWN iface
|
||||||
ULONG WINAPI IDirectMusicChordMapImpl_IUnknown_AddRef (LPUNKNOWN iface) {
|
ULONG WINAPI IDirectMusicChordMapImpl_IUnknown_AddRef (LPUNKNOWN iface) {
|
||||||
ICOM_THIS_MULTI(IDirectMusicChordMapImpl, UnknownVtbl, iface);
|
ICOM_THIS_MULTI(IDirectMusicChordMapImpl, UnknownVtbl, iface);
|
||||||
TRACE("(%p): AddRef from %ld\n", This, This->ref);
|
TRACE("(%p): AddRef from %ld\n", This, This->ref);
|
||||||
|
|
||||||
|
DMCOMPOS_LockModule();
|
||||||
|
|
||||||
return ++(This->ref);
|
return ++(This->ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,9 +65,13 @@ ULONG WINAPI IDirectMusicChordMapImpl_IUnknown_Release (LPUNKNOWN iface) {
|
||||||
ICOM_THIS_MULTI(IDirectMusicChordMapImpl, UnknownVtbl, iface);
|
ICOM_THIS_MULTI(IDirectMusicChordMapImpl, UnknownVtbl, iface);
|
||||||
ULONG ref = --This->ref;
|
ULONG ref = --This->ref;
|
||||||
TRACE("(%p): ReleaseRef to %ld\n", This, This->ref);
|
TRACE("(%p): ReleaseRef to %ld\n", This, This->ref);
|
||||||
|
|
||||||
if (ref == 0) {
|
if (ref == 0) {
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DMCOMPOS_UnlockModule();
|
||||||
|
|
||||||
return ref;
|
return ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,9 @@ HRESULT WINAPI IDirectMusicChordMapTrack_IUnknown_QueryInterface (LPUNKNOWN ifac
|
||||||
ULONG WINAPI IDirectMusicChordMapTrack_IUnknown_AddRef (LPUNKNOWN iface) {
|
ULONG WINAPI IDirectMusicChordMapTrack_IUnknown_AddRef (LPUNKNOWN iface) {
|
||||||
ICOM_THIS_MULTI(IDirectMusicChordMapTrack, UnknownVtbl, iface);
|
ICOM_THIS_MULTI(IDirectMusicChordMapTrack, UnknownVtbl, iface);
|
||||||
TRACE("(%p): AddRef from %ld\n", This, This->ref);
|
TRACE("(%p): AddRef from %ld\n", This, This->ref);
|
||||||
|
|
||||||
|
DMCOMPOS_LockModule();
|
||||||
|
|
||||||
return ++(This->ref);
|
return ++(This->ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,9 +62,13 @@ ULONG WINAPI IDirectMusicChordMapTrack_IUnknown_Release (LPUNKNOWN iface) {
|
||||||
ICOM_THIS_MULTI(IDirectMusicChordMapTrack, UnknownVtbl, iface);
|
ICOM_THIS_MULTI(IDirectMusicChordMapTrack, UnknownVtbl, iface);
|
||||||
ULONG ref = --This->ref;
|
ULONG ref = --This->ref;
|
||||||
TRACE("(%p): ReleaseRef to %ld\n", This, This->ref);
|
TRACE("(%p): ReleaseRef to %ld\n", This, This->ref);
|
||||||
|
|
||||||
if (ref == 0) {
|
if (ref == 0) {
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DMCOMPOS_UnlockModule();
|
||||||
|
|
||||||
return ref;
|
return ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,9 @@ HRESULT WINAPI IDirectMusicComposerImpl_QueryInterface (LPDIRECTMUSICCOMPOSER if
|
||||||
ULONG WINAPI IDirectMusicComposerImpl_AddRef (LPDIRECTMUSICCOMPOSER iface) {
|
ULONG WINAPI IDirectMusicComposerImpl_AddRef (LPDIRECTMUSICCOMPOSER iface) {
|
||||||
IDirectMusicComposerImpl *This = (IDirectMusicComposerImpl *)iface;
|
IDirectMusicComposerImpl *This = (IDirectMusicComposerImpl *)iface;
|
||||||
TRACE("(%p): AddRef from %ld\n", This, This->ref);
|
TRACE("(%p): AddRef from %ld\n", This, This->ref);
|
||||||
|
|
||||||
|
DMCOMPOS_LockModule();
|
||||||
|
|
||||||
return ++(This->ref);
|
return ++(This->ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,9 +49,13 @@ ULONG WINAPI IDirectMusicComposerImpl_Release (LPDIRECTMUSICCOMPOSER iface) {
|
||||||
IDirectMusicComposerImpl *This = (IDirectMusicComposerImpl *)iface;
|
IDirectMusicComposerImpl *This = (IDirectMusicComposerImpl *)iface;
|
||||||
ULONG ref = --This->ref;
|
ULONG ref = --This->ref;
|
||||||
TRACE("(%p): ReleaseRef to %ld\n", This, This->ref);
|
TRACE("(%p): ReleaseRef to %ld\n", This, This->ref);
|
||||||
|
|
||||||
if (ref == 0) {
|
if (ref == 0) {
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DMCOMPOS_UnlockModule();
|
||||||
|
|
||||||
return ref;
|
return ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,41 +21,49 @@
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(dmcompos);
|
WINE_DEFAULT_DEBUG_CHANNEL(dmcompos);
|
||||||
|
|
||||||
|
LONG DMCOMPOS_refCount = 0;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/* IUnknown fields */
|
|
||||||
IClassFactoryVtbl *lpVtbl;
|
IClassFactoryVtbl *lpVtbl;
|
||||||
DWORD ref;
|
|
||||||
} IClassFactoryImpl;
|
} IClassFactoryImpl;
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
* DirectMusicChordMap ClassFactory
|
* DirectMusicChordMap ClassFactory
|
||||||
*/
|
*/
|
||||||
static HRESULT WINAPI ChordMapCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
|
static HRESULT WINAPI ChordMapCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
|
||||||
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
|
||||||
FIXME("(%p, %s, %p): stub\n", This, debugstr_dmguid(riid), ppobj);
|
|
||||||
|
if (ppobj == NULL) return E_POINTER;
|
||||||
|
|
||||||
return E_NOINTERFACE;
|
return E_NOINTERFACE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ULONG WINAPI ChordMapCF_AddRef(LPCLASSFACTORY iface) {
|
static ULONG WINAPI ChordMapCF_AddRef(LPCLASSFACTORY iface) {
|
||||||
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
DMCOMPOS_LockModule();
|
||||||
return ++(This->ref);
|
|
||||||
|
return 2; /* non-heap based object */
|
||||||
}
|
}
|
||||||
|
|
||||||
static ULONG WINAPI ChordMapCF_Release(LPCLASSFACTORY iface) {
|
static ULONG WINAPI ChordMapCF_Release(LPCLASSFACTORY iface) {
|
||||||
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
DMCOMPOS_UnlockModule();
|
||||||
/* static class, won't be freed */
|
|
||||||
return --(This->ref);
|
return 1; /* non-heap based object */
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI ChordMapCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
|
static HRESULT WINAPI ChordMapCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
|
||||||
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
|
||||||
TRACE ("(%p, %p, %s, %p)\n", This, pOuter, debugstr_dmguid(riid), ppobj);
|
|
||||||
return DMUSIC_CreateDirectMusicChordMapImpl (riid, ppobj, pOuter);
|
return DMUSIC_CreateDirectMusicChordMapImpl (riid, ppobj, pOuter);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI ChordMapCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
|
static HRESULT WINAPI ChordMapCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
|
||||||
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
TRACE("(%d)\n", dolock);
|
||||||
FIXME("(%p, %d): stub\n", This, dolock);
|
|
||||||
|
if (dolock)
|
||||||
|
DMCOMPOS_LockModule();
|
||||||
|
else
|
||||||
|
DMCOMPOS_UnlockModule();
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,37 +75,45 @@ static IClassFactoryVtbl ChordMapCF_Vtbl = {
|
||||||
ChordMapCF_LockServer
|
ChordMapCF_LockServer
|
||||||
};
|
};
|
||||||
|
|
||||||
static IClassFactoryImpl ChordMap_CF = {&ChordMapCF_Vtbl, 1 };
|
static IClassFactoryImpl ChordMap_CF = {&ChordMapCF_Vtbl};
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
* DirectMusicComposer ClassFactory
|
* DirectMusicComposer ClassFactory
|
||||||
*/
|
*/
|
||||||
static HRESULT WINAPI ComposerCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
|
static HRESULT WINAPI ComposerCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
|
||||||
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
|
||||||
FIXME("(%p, %s, %p): stub\n",This,debugstr_dmguid(riid),ppobj);
|
|
||||||
|
if (ppobj == NULL) return E_POINTER;
|
||||||
|
|
||||||
return E_NOINTERFACE;
|
return E_NOINTERFACE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ULONG WINAPI ComposerCF_AddRef(LPCLASSFACTORY iface) {
|
static ULONG WINAPI ComposerCF_AddRef(LPCLASSFACTORY iface) {
|
||||||
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
DMCOMPOS_LockModule();
|
||||||
return ++(This->ref);
|
|
||||||
|
return 2; /* non-heap based object */
|
||||||
}
|
}
|
||||||
|
|
||||||
static ULONG WINAPI ComposerCF_Release(LPCLASSFACTORY iface) {
|
static ULONG WINAPI ComposerCF_Release(LPCLASSFACTORY iface) {
|
||||||
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
DMCOMPOS_UnlockModule();
|
||||||
/* static class, won't be freed */
|
|
||||||
return --(This->ref);
|
return 1; /* non-heap based object */
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI ComposerCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
|
static HRESULT WINAPI ComposerCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
|
||||||
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
|
||||||
TRACE ("(%p, %p, %s, %p)\n", This, pOuter, debugstr_dmguid(riid), ppobj);
|
|
||||||
return DMUSIC_CreateDirectMusicComposerImpl (riid, ppobj, pOuter);
|
return DMUSIC_CreateDirectMusicComposerImpl (riid, ppobj, pOuter);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI ComposerCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
|
static HRESULT WINAPI ComposerCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
|
||||||
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
TRACE("(%d)\n", dolock);
|
||||||
FIXME("(%p, %d): stub\n", This, dolock);
|
|
||||||
|
if (dolock)
|
||||||
|
DMCOMPOS_LockModule();
|
||||||
|
else
|
||||||
|
DMCOMPOS_UnlockModule();
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,37 +125,45 @@ static IClassFactoryVtbl ComposerCF_Vtbl = {
|
||||||
ComposerCF_LockServer
|
ComposerCF_LockServer
|
||||||
};
|
};
|
||||||
|
|
||||||
static IClassFactoryImpl Composer_CF = {&ComposerCF_Vtbl, 1 };
|
static IClassFactoryImpl Composer_CF = {&ComposerCF_Vtbl};
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
* DirectMusicChordMapTrack ClassFactory
|
* DirectMusicChordMapTrack ClassFactory
|
||||||
*/
|
*/
|
||||||
static HRESULT WINAPI ChordMapTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
|
static HRESULT WINAPI ChordMapTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
|
||||||
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
|
||||||
FIXME("(%p, %s, %p): stub\n",This,debugstr_dmguid(riid),ppobj);
|
|
||||||
|
if (ppobj == NULL) return E_POINTER;
|
||||||
|
|
||||||
return E_NOINTERFACE;
|
return E_NOINTERFACE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ULONG WINAPI ChordMapTrackCF_AddRef(LPCLASSFACTORY iface) {
|
static ULONG WINAPI ChordMapTrackCF_AddRef(LPCLASSFACTORY iface) {
|
||||||
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
DMCOMPOS_LockModule();
|
||||||
return ++(This->ref);
|
|
||||||
|
return 2; /* non-heap based object */
|
||||||
}
|
}
|
||||||
|
|
||||||
static ULONG WINAPI ChordMapTrackCF_Release(LPCLASSFACTORY iface) {
|
static ULONG WINAPI ChordMapTrackCF_Release(LPCLASSFACTORY iface) {
|
||||||
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
DMCOMPOS_UnlockModule();
|
||||||
/* static class, won't be freed */
|
|
||||||
return --(This->ref);
|
return 1; /* non-heap based object */
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI ChordMapTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
|
static HRESULT WINAPI ChordMapTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
|
||||||
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
|
||||||
TRACE ("(%p, %p, %s, %p)\n", This, pOuter, debugstr_dmguid(riid), ppobj);
|
|
||||||
return DMUSIC_CreateDirectMusicChordMapTrack (riid, ppobj, pOuter);
|
return DMUSIC_CreateDirectMusicChordMapTrack (riid, ppobj, pOuter);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI ChordMapTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
|
static HRESULT WINAPI ChordMapTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
|
||||||
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
TRACE("(%d)\n", dolock);
|
||||||
FIXME("(%p, %d): stub\n", This, dolock);
|
|
||||||
|
if (dolock)
|
||||||
|
DMCOMPOS_LockModule();
|
||||||
|
else
|
||||||
|
DMCOMPOS_UnlockModule();
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,39 +175,47 @@ static IClassFactoryVtbl ChordMapTrackCF_Vtbl = {
|
||||||
ChordMapTrackCF_LockServer
|
ChordMapTrackCF_LockServer
|
||||||
};
|
};
|
||||||
|
|
||||||
static IClassFactoryImpl ChordMapTrack_CF = {&ChordMapTrackCF_Vtbl, 1 };
|
static IClassFactoryImpl ChordMapTrack_CF = {&ChordMapTrackCF_Vtbl};
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
* DirectMusicTemplate ClassFactory
|
* DirectMusicTemplate ClassFactory
|
||||||
*/
|
*/
|
||||||
static HRESULT WINAPI TemplateCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
|
static HRESULT WINAPI TemplateCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
|
||||||
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
|
||||||
FIXME("(%p, %s, %p): stub\n", This, debugstr_dmguid(riid), ppobj);
|
|
||||||
|
if (ppobj == NULL) return E_POINTER;
|
||||||
|
|
||||||
return E_NOINTERFACE;
|
return E_NOINTERFACE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ULONG WINAPI TemplateCF_AddRef(LPCLASSFACTORY iface) {
|
static ULONG WINAPI TemplateCF_AddRef(LPCLASSFACTORY iface) {
|
||||||
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
DMCOMPOS_LockModule();
|
||||||
return ++(This->ref);
|
|
||||||
|
return 2; /* non-heap based object */
|
||||||
}
|
}
|
||||||
|
|
||||||
static ULONG WINAPI TemplateCF_Release(LPCLASSFACTORY iface) {
|
static ULONG WINAPI TemplateCF_Release(LPCLASSFACTORY iface) {
|
||||||
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
DMCOMPOS_UnlockModule();
|
||||||
/* static class, won't be freed */
|
|
||||||
return --(This->ref);
|
return 1; /* non-heap based object */
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI TemplateCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
|
static HRESULT WINAPI TemplateCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
|
||||||
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
|
||||||
TRACE ("(%p, %p, %s, %p)\n", This, pOuter, debugstr_dmguid(riid), ppobj);
|
|
||||||
/* nothing yet */
|
/* nothing yet */
|
||||||
WARN("(%p, %s,%p): not found\n", This, debugstr_dmguid(riid), ppobj);
|
WARN("(%s,%p): not found\n", debugstr_dmguid(riid), ppobj);
|
||||||
|
|
||||||
return E_NOINTERFACE;
|
return E_NOINTERFACE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI TemplateCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
|
static HRESULT WINAPI TemplateCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
|
||||||
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
TRACE("(%d)\n", dolock);
|
||||||
FIXME("(%p, %d): stub\n", This, dolock);
|
|
||||||
|
if (dolock)
|
||||||
|
DMCOMPOS_LockModule();
|
||||||
|
else
|
||||||
|
DMCOMPOS_UnlockModule();
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,37 +227,45 @@ static IClassFactoryVtbl TemplateCF_Vtbl = {
|
||||||
TemplateCF_LockServer
|
TemplateCF_LockServer
|
||||||
};
|
};
|
||||||
|
|
||||||
static IClassFactoryImpl Template_CF = {&TemplateCF_Vtbl, 1 };
|
static IClassFactoryImpl Template_CF = {&TemplateCF_Vtbl};
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
* DirectMusicSignPostTrack ClassFactory
|
* DirectMusicSignPostTrack ClassFactory
|
||||||
*/
|
*/
|
||||||
static HRESULT WINAPI SignPostTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
|
static HRESULT WINAPI SignPostTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
|
||||||
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
|
||||||
FIXME("(%p, %s, %p): stub\n",This,debugstr_dmguid(riid),ppobj);
|
|
||||||
|
if (ppobj == NULL) return E_POINTER;
|
||||||
|
|
||||||
return E_NOINTERFACE;
|
return E_NOINTERFACE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ULONG WINAPI SignPostTrackCF_AddRef(LPCLASSFACTORY iface) {
|
static ULONG WINAPI SignPostTrackCF_AddRef(LPCLASSFACTORY iface) {
|
||||||
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
DMCOMPOS_LockModule();
|
||||||
return ++(This->ref);
|
|
||||||
|
return 2; /* non-heap based object */
|
||||||
}
|
}
|
||||||
|
|
||||||
static ULONG WINAPI SignPostTrackCF_Release(LPCLASSFACTORY iface) {
|
static ULONG WINAPI SignPostTrackCF_Release(LPCLASSFACTORY iface) {
|
||||||
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
DMCOMPOS_UnlockModule();
|
||||||
/* static class, won't be freed */
|
|
||||||
return --(This->ref);
|
return 1; /* non-heap based object */
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI SignPostTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
|
static HRESULT WINAPI SignPostTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
|
||||||
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
|
||||||
TRACE ("(%p, %p, %s, %p)\n", This, pOuter, debugstr_dmguid(riid), ppobj);
|
|
||||||
return DMUSIC_CreateDirectMusicSignPostTrack (riid, ppobj, pOuter);
|
return DMUSIC_CreateDirectMusicSignPostTrack (riid, ppobj, pOuter);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI SignPostTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
|
static HRESULT WINAPI SignPostTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
|
||||||
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
TRACE("(%d)\n", dolock);
|
||||||
FIXME("(%p, %d): stub\n", This, dolock);
|
|
||||||
|
if (dolock)
|
||||||
|
DMCOMPOS_LockModule();
|
||||||
|
else
|
||||||
|
DMCOMPOS_UnlockModule();
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -237,7 +277,7 @@ static IClassFactoryVtbl SignPostTrackCF_Vtbl = {
|
||||||
SignPostTrackCF_LockServer
|
SignPostTrackCF_LockServer
|
||||||
};
|
};
|
||||||
|
|
||||||
static IClassFactoryImpl SignPostTrack_CF = {&SignPostTrackCF_Vtbl, 1 };
|
static IClassFactoryImpl SignPostTrack_CF = {&SignPostTrackCF_Vtbl};
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
* DllMain
|
* DllMain
|
||||||
|
@ -263,8 +303,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI DMCOMPOS_DllCanUnloadNow(void) {
|
HRESULT WINAPI DMCOMPOS_DllCanUnloadNow(void) {
|
||||||
FIXME("(void): stub\n");
|
return DMCOMPOS_refCount != 0 ? S_FALSE : S_OK;
|
||||||
return S_FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -237,6 +237,12 @@ extern HRESULT WINAPI IDirectMusicSignPostTrack_IPersistStream_Load (LPPERSISTST
|
||||||
extern HRESULT WINAPI IDirectMusicSignPostTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty);
|
extern HRESULT WINAPI IDirectMusicSignPostTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty);
|
||||||
extern HRESULT WINAPI IDirectMusicSignPostTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize);
|
extern HRESULT WINAPI IDirectMusicSignPostTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize);
|
||||||
|
|
||||||
|
/**********************************************************************
|
||||||
|
* Dll lifetime tracking declaration for dmcompos.dll
|
||||||
|
*/
|
||||||
|
extern LONG DMCOMPOS_refCount;
|
||||||
|
static inline void DMCOMPOS_LockModule() { InterlockedIncrement( &DMCOMPOS_refCount ); }
|
||||||
|
static inline void DMCOMPOS_UnlockModule() { InterlockedDecrement( &DMCOMPOS_refCount ); }
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Misc.
|
* Misc.
|
||||||
|
|
|
@ -52,6 +52,9 @@ HRESULT WINAPI IDirectMusicSignPostTrack_IUnknown_QueryInterface (LPUNKNOWN ifac
|
||||||
ULONG WINAPI IDirectMusicSignPostTrack_IUnknown_AddRef (LPUNKNOWN iface) {
|
ULONG WINAPI IDirectMusicSignPostTrack_IUnknown_AddRef (LPUNKNOWN iface) {
|
||||||
ICOM_THIS_MULTI(IDirectMusicSignPostTrack, UnknownVtbl, iface);
|
ICOM_THIS_MULTI(IDirectMusicSignPostTrack, UnknownVtbl, iface);
|
||||||
TRACE("(%p): AddRef from %ld\n", This, This->ref);
|
TRACE("(%p): AddRef from %ld\n", This, This->ref);
|
||||||
|
|
||||||
|
DMCOMPOS_LockModule();
|
||||||
|
|
||||||
return ++(This->ref);
|
return ++(This->ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,9 +62,13 @@ ULONG WINAPI IDirectMusicSignPostTrack_IUnknown_Release (LPUNKNOWN iface) {
|
||||||
ICOM_THIS_MULTI(IDirectMusicSignPostTrack, UnknownVtbl, iface);
|
ICOM_THIS_MULTI(IDirectMusicSignPostTrack, UnknownVtbl, iface);
|
||||||
ULONG ref = --This->ref;
|
ULONG ref = --This->ref;
|
||||||
TRACE("(%p): ReleaseRef to %ld\n", This, This->ref);
|
TRACE("(%p): ReleaseRef to %ld\n", This, This->ref);
|
||||||
|
|
||||||
if (ref == 0) {
|
if (ref == 0) {
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DMCOMPOS_UnlockModule();
|
||||||
|
|
||||||
return ref;
|
return ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue