static ULONG WINAPI IDirectMusicChordMapImpl_IUnknown_AddRef (LPUNKNOWN iface) { ICOM_THIS_MULTI(IDirectMusicChordMapImpl, UnknownVtbl, iface); ULONG ref = InterlockedIncrement(&This->ref); TRACE("(%p): AddRef from %ld\n", This, ref - 1); DMCOMPOS_LockModule(); return ref; }
static ULONG WINAPI IDirectMusicComposerImpl_AddRef (LPDIRECTMUSICCOMPOSER iface) { IDirectMusicComposerImpl *This = (IDirectMusicComposerImpl *)iface; ULONG ref = InterlockedIncrement(&This->ref); TRACE("(%p): AddRef from %d\n", This, ref - 1); DMCOMPOS_LockModule(); return ref; }
/* for ClassFactory */ HRESULT WINAPI create_dmcomposer(REFIID riid, void **ret_iface) { IDirectMusicComposerImpl *obj; HRESULT hr; obj = HeapAlloc(GetProcessHeap(), 0, sizeof(*obj)); if (!obj) { *ret_iface = NULL; return E_OUTOFMEMORY; } obj->IDirectMusicComposer_iface.lpVtbl = &dmcomposer_vtbl; obj->ref = 1; DMCOMPOS_LockModule(); hr = IDirectMusicComposer_QueryInterface(&obj->IDirectMusicComposer_iface, riid, ret_iface); IDirectMusicComposer_Release(&obj->IDirectMusicComposer_iface); return hr; }
/* for ClassFactory */ HRESULT WINAPI create_dmchordmaptrack(REFIID lpcGUID, void **ppobj) { IDirectMusicChordMapTrack* track; HRESULT hr; track = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*track)); if (!track) { *ppobj = NULL; return E_OUTOFMEMORY; } track->IDirectMusicTrack8_iface.lpVtbl = &dmtrack8_vtbl; track->ref = 1; dmobject_init(&track->dmobj, &CLSID_DirectMusicChordMapTrack, (IUnknown *)&track->IDirectMusicTrack8_iface); track->dmobj.IPersistStream_iface.lpVtbl = &persiststream_vtbl; DMCOMPOS_LockModule(); hr = IDirectMusicTrack8_QueryInterface(&track->IDirectMusicTrack8_iface, lpcGUID, ppobj); IDirectMusicTrack8_Release(&track->IDirectMusicTrack8_iface); return hr; }