static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL dolock) { TRACE("(%d)\n", dolock); if (dolock) DMSYNTH_LockModule(); else DMSYNTH_UnlockModule(); return S_OK; }
static ULONG WINAPI IDirectMusicSynth8Impl_Release (LPDIRECTMUSICSYNTH8 iface) { IDirectMusicSynth8Impl *This = (IDirectMusicSynth8Impl *)iface; ULONG refCount = InterlockedDecrement(&This->ref); TRACE("(%p)->(ref before=%lu)\n", This, refCount + 1); if (!refCount) { HeapFree(GetProcessHeap(), 0, This); } DMSYNTH_UnlockModule(); return refCount; }
static ULONG WINAPI IDirectMusicSynthSinkImpl_Release(LPDIRECTMUSICSYNTHSINK iface) { IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface); ULONG ref = InterlockedDecrement(&This->ref); TRACE("(%p)->(): new ref = %u\n", This, ref); if (!ref) { if (This->latency_clock) IReferenceClock_Release(This->latency_clock); HeapFree(GetProcessHeap(), 0, This); DMSYNTH_UnlockModule(); } return ref; }
static ULONG WINAPI ClassFactory_Release(IClassFactory *iface) { DMSYNTH_UnlockModule(); return 1; /* non-heap based object */ }