Esempio n. 1
0
/* for ClassFactory */
HRESULT WINAPI create_dmstyle(REFIID lpcGUID, void **ppobj)
{
  IDirectMusicStyle8Impl* obj;
  HRESULT hr;

  obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicStyle8Impl));
  if (NULL == obj) {
    *ppobj = NULL;
    return E_OUTOFMEMORY;
  }
  obj->IDirectMusicStyle8_iface.lpVtbl = &dmstyle8_vtbl;
  obj->ObjectVtbl = &DirectMusicStyle8_Object_Vtbl;
  obj->PersistStreamVtbl = &DirectMusicStyle8_PersistStream_Vtbl;
  obj->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));
  DM_STRUCT_INIT(obj->pDesc);
  obj->pDesc->dwValidData |= DMUS_OBJ_CLASS;
  obj->pDesc->guidClass = CLSID_DirectMusicStyle;
  obj->ref = 1;
  list_init (&obj->Bands);
  list_init (&obj->Motifs);

  DMSTYLE_LockModule();
  hr = IDirectMusicStyle8_QueryInterface(&obj->IDirectMusicStyle8_iface, lpcGUID, ppobj);
  IDirectMusicStyle8_Release(&obj->IDirectMusicStyle8_iface);

  return hr;
}
Esempio n. 2
0
static ULONG WINAPI IDirectMusicChordTrack_IUnknown_AddRef (LPUNKNOWN iface) {
	ICOM_THIS_MULTI(IDirectMusicChordTrack, UnknownVtbl, iface);
        ULONG ref = InterlockedIncrement(&This->ref);

	TRACE("(%p): AddRef from %d\n", This, ref - 1);

	DMSTYLE_LockModule();

	return ref;
}
Esempio n. 3
0
static HRESULT WINAPI SectionCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
	TRACE("(%d)\n", dolock);

	if (dolock)
		DMSTYLE_LockModule();
	else
		DMSTYLE_UnlockModule();

	return S_OK;
}
Esempio n. 4
0
static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL dolock)
{
        TRACE("(%d)\n", dolock);

        if (dolock)
                DMSTYLE_LockModule();
        else
                DMSTYLE_UnlockModule();

        return S_OK;
}
Esempio n. 5
0
/* for ClassFactory */
HRESULT WINAPI create_dmmutetrack(REFIID lpcGUID, void **ppobj)
{
    IDirectMusicMuteTrack *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_DirectMusicMuteTrack,
                  (IUnknown *)&track->IDirectMusicTrack8_iface);
    track->dmobj.IPersistStream_iface.lpVtbl = &persiststream_vtbl;

    DMSTYLE_LockModule();
    hr = IDirectMusicTrack8_QueryInterface(&track->IDirectMusicTrack8_iface, lpcGUID, ppobj);
    IDirectMusicTrack8_Release(&track->IDirectMusicTrack8_iface);

    return hr;
}
Esempio n. 6
0
static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
{
        DMSTYLE_LockModule();

        return 2; /* non-heap based object */
}
Esempio n. 7
0
static ULONG WINAPI StyleCF_AddRef(LPCLASSFACTORY iface) {
	DMSTYLE_LockModule();

	return 2; /* non-heap based object */
}