dmime: Assign to structs instead of using memcpy.
This commit is contained in:
parent
13afbc02b6
commit
be2f48cdd4
|
@ -544,9 +544,9 @@ static HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicObject_SetDescriptor
|
|||
|
||||
/* According to MSDN, we should copy only given values, not whole struct */
|
||||
if (pDesc->dwValidData & DMUS_OBJ_OBJECT)
|
||||
memcpy (&This->pDesc->guidObject, &pDesc->guidObject, sizeof (pDesc->guidObject));
|
||||
This->pDesc->guidObject = pDesc->guidObject;
|
||||
if (pDesc->dwValidData & DMUS_OBJ_CLASS)
|
||||
memcpy (&This->pDesc->guidClass, &pDesc->guidClass, sizeof (pDesc->guidClass));
|
||||
This->pDesc->guidClass = pDesc->guidClass;
|
||||
if (pDesc->dwValidData & DMUS_OBJ_NAME)
|
||||
lstrcpynW (This->pDesc->wszName, pDesc->wszName, DMUS_MAX_NAME);
|
||||
if (pDesc->dwValidData & DMUS_OBJ_CATEGORY)
|
||||
|
@ -554,9 +554,9 @@ static HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicObject_SetDescriptor
|
|||
if (pDesc->dwValidData & DMUS_OBJ_FILENAME)
|
||||
lstrcpynW (This->pDesc->wszFileName, pDesc->wszFileName, DMUS_MAX_FILENAME);
|
||||
if (pDesc->dwValidData & DMUS_OBJ_VERSION)
|
||||
memcpy (&This->pDesc->vVersion, &pDesc->vVersion, sizeof (pDesc->vVersion));
|
||||
This->pDesc->vVersion = pDesc->vVersion;
|
||||
if (pDesc->dwValidData & DMUS_OBJ_DATE)
|
||||
memcpy (&This->pDesc->ftDate, &pDesc->ftDate, sizeof (pDesc->ftDate));
|
||||
This->pDesc->ftDate = pDesc->ftDate;
|
||||
if (pDesc->dwValidData & DMUS_OBJ_MEMORY) {
|
||||
memcpy (&This->pDesc->llMemLength, &pDesc->llMemLength, sizeof (pDesc->llMemLength));
|
||||
memcpy (This->pDesc->pbMemData, pDesc->pbMemData, sizeof (pDesc->pbMemData));
|
||||
|
@ -582,7 +582,7 @@ static HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicObject_ParseDescripto
|
|||
|
||||
/* FIXME: should this be determined from stream? */
|
||||
pDesc->dwValidData |= DMUS_OBJ_CLASS;
|
||||
memcpy (&pDesc->guidClass, &CLSID_DirectMusicSegment, sizeof(CLSID));
|
||||
pDesc->guidClass = CLSID_DirectMusicSegment;
|
||||
|
||||
IStream_Read (pStream, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
|
||||
TRACE_(dmfile)(": %s chunk (size = 0x%04x)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
|
||||
|
@ -771,7 +771,7 @@ static ULONG WINAPI IDirectMusicSegment8Impl_IPersistStream_Release (LPPERSISTST
|
|||
static HRESULT WINAPI IDirectMusicSegment8Impl_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
|
||||
ICOM_THIS_MULTI(IDirectMusicSegment8Impl, PersistStreamVtbl, iface);
|
||||
TRACE("(%p, %p)\n", This, pClassID);
|
||||
memcpy(pClassID, &CLSID_DirectMusicSegment, sizeof(CLSID));
|
||||
*pClassID = CLSID_DirectMusicSegment;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
@ -1302,7 +1302,7 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicSegmentImpl (LPCGUID lpcGUID, LPVOID* ppo
|
|||
obj->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));
|
||||
DM_STRUCT_INIT(obj->pDesc);
|
||||
obj->pDesc->dwValidData |= DMUS_OBJ_CLASS;
|
||||
memcpy (&obj->pDesc->guidClass, &CLSID_DirectMusicSegment, sizeof (CLSID));
|
||||
obj->pDesc->guidClass = CLSID_DirectMusicSegment;
|
||||
obj->ref = 0; /* will be inited by QueryInterface */
|
||||
list_init (&obj->Tracks);
|
||||
|
||||
|
|
|
@ -237,7 +237,7 @@ static ULONG WINAPI IDirectMusicSegTriggerTrack_IPersistStream_Release (LPPERSIS
|
|||
static HRESULT WINAPI IDirectMusicSegTriggerTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
|
||||
ICOM_THIS_MULTI(IDirectMusicSegment8Impl, PersistStreamVtbl, iface);
|
||||
TRACE("(%p, %p)\n", This, pClassID);
|
||||
memcpy(pClassID, &CLSID_DirectMusicSegTriggerTrack, sizeof(CLSID));
|
||||
*pClassID = CLSID_DirectMusicSegTriggerTrack;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
@ -527,7 +527,7 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicSegTriggerTrack (LPCGUID lpcGUID, LPVOID
|
|||
track->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));
|
||||
DM_STRUCT_INIT(track->pDesc);
|
||||
track->pDesc->dwValidData |= DMUS_OBJ_CLASS;
|
||||
memcpy (&track->pDesc->guidClass, &CLSID_DirectMusicSegTriggerTrack, sizeof (CLSID));
|
||||
track->pDesc->guidClass = CLSID_DirectMusicSegTriggerTrack;
|
||||
track->ref = 0; /* will be inited by QueryInterface */
|
||||
list_init (&track->Items);
|
||||
|
||||
|
|
|
@ -279,7 +279,7 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicSeqTrack (LPCGUID lpcGUID, LPVOID *ppobj,
|
|||
track->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));
|
||||
DM_STRUCT_INIT(track->pDesc);
|
||||
track->pDesc->dwValidData |= DMUS_OBJ_CLASS;
|
||||
memcpy (&track->pDesc->guidClass, &CLSID_DirectMusicSeqTrack, sizeof (CLSID));
|
||||
track->pDesc->guidClass = CLSID_DirectMusicSeqTrack;
|
||||
track->ref = 0; /* will be inited by QueryInterface */
|
||||
|
||||
return IDirectMusicSeqTrack_IUnknown_QueryInterface ((LPUNKNOWN)&track->UnknownVtbl, lpcGUID, ppobj);
|
||||
|
|
|
@ -279,7 +279,7 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicSysExTrack (LPCGUID lpcGUID, LPVOID *ppob
|
|||
track->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));
|
||||
DM_STRUCT_INIT(track->pDesc);
|
||||
track->pDesc->dwValidData |= DMUS_OBJ_CLASS;
|
||||
memcpy (&track->pDesc->guidClass, &CLSID_DirectMusicSysExTrack, sizeof (CLSID));
|
||||
track->pDesc->guidClass = CLSID_DirectMusicSysExTrack;
|
||||
track->ref = 0; /* will be inited by QueryInterface */
|
||||
|
||||
return IDirectMusicSysExTrack_IUnknown_QueryInterface ((LPUNKNOWN)&track->UnknownVtbl, lpcGUID, ppobj);
|
||||
|
|
|
@ -310,7 +310,7 @@ static ULONG WINAPI IDirectMusicTempoTrack_IPersistStream_Release (LPPERSISTSTRE
|
|||
static HRESULT WINAPI IDirectMusicTempoTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
|
||||
ICOM_THIS_MULTI(IDirectMusicSegment8Impl, PersistStreamVtbl, iface);
|
||||
TRACE("(%p, %p)\n", This, pClassID);
|
||||
memcpy(pClassID, &CLSID_DirectMusicTempoTrack, sizeof(CLSID));
|
||||
*pClassID = CLSID_DirectMusicTempoTrack;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
@ -352,7 +352,7 @@ static HRESULT WINAPI IDirectMusicTempoTrack_IPersistStream_Load (LPPERSISTSTREA
|
|||
ERR(": no more memory\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
memcpy(&pNewItem->item, &item, sizeof(DMUS_IO_TEMPO_ITEM));
|
||||
pNewItem->item = item;
|
||||
list_add_tail (&This->Items, &pNewItem->entry);
|
||||
pNewItem = NULL;
|
||||
StreamCount += sizeof(item);
|
||||
|
@ -414,7 +414,7 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicTempoTrack (LPCGUID lpcGUID, LPVOID *ppob
|
|||
track->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));
|
||||
DM_STRUCT_INIT(track->pDesc);
|
||||
track->pDesc->dwValidData |= DMUS_OBJ_CLASS;
|
||||
memcpy (&track->pDesc->guidClass, &CLSID_DirectMusicTempoTrack, sizeof (CLSID));
|
||||
track->pDesc->guidClass = CLSID_DirectMusicTempoTrack;
|
||||
track->ref = 0; /* will be inited by QueryInterface */
|
||||
track->enabled = TRUE;
|
||||
list_init (&track->Items);
|
||||
|
|
|
@ -284,7 +284,7 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicTimeSigTrack (LPCGUID lpcGUID, LPVOID *pp
|
|||
track->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));
|
||||
DM_STRUCT_INIT(track->pDesc);
|
||||
track->pDesc->dwValidData |= DMUS_OBJ_CLASS;
|
||||
memcpy (&track->pDesc->guidClass, &CLSID_DirectMusicTimeSigTrack, sizeof (CLSID));
|
||||
track->pDesc->guidClass = CLSID_DirectMusicTimeSigTrack;
|
||||
track->ref = 0; /* will be inited by QueryInterface */
|
||||
|
||||
return IDirectMusicTimeSigTrack_IUnknown_QueryInterface ((LPUNKNOWN)&track->UnknownVtbl, lpcGUID, ppobj);
|
||||
|
|
|
@ -285,7 +285,7 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicWaveTrack (LPCGUID lpcGUID, LPVOID *ppobj
|
|||
track->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));
|
||||
DM_STRUCT_INIT(track->pDesc);
|
||||
track->pDesc->dwValidData |= DMUS_OBJ_CLASS;
|
||||
memcpy (&track->pDesc->guidClass, &CLSID_DirectMusicWaveTrack, sizeof (CLSID));
|
||||
track->pDesc->guidClass = CLSID_DirectMusicWaveTrack;
|
||||
track->ref = 0; /* will be inited by QueryInterface */
|
||||
|
||||
return IDirectMusicWaveTrack_IUnknown_QueryInterface ((LPUNKNOWN)&track->UnknownVtbl, lpcGUID, ppobj);
|
||||
|
|
Loading…
Reference in New Issue