mirror of
https://github.com/reactos/wine.git
synced 2024-11-25 12:49:45 +00:00
dmcompos: Assign to structs instead of using memcpy.
This commit is contained in:
parent
e7d91129d9
commit
1cfdeb0e0a
@ -145,12 +145,12 @@ static HRESULT WINAPI IDirectMusicChordMapImpl_IDirectMusicObject_GetDescriptor
|
||||
static HRESULT WINAPI IDirectMusicChordMapImpl_IDirectMusicObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc) {
|
||||
ICOM_THIS_MULTI(IDirectMusicChordMapImpl, ObjectVtbl, iface);
|
||||
TRACE("(%p, %p): setting descriptor:\n%s\n", This, pDesc, debugstr_DMUS_OBJECTDESC (pDesc));
|
||||
|
||||
|
||||
/* 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)
|
||||
@ -158,11 +158,11 @@ static HRESULT WINAPI IDirectMusicChordMapImpl_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));
|
||||
This->pDesc->llMemLength = pDesc->llMemLength;
|
||||
memcpy (This->pDesc->pbMemData, pDesc->pbMemData, sizeof (pDesc->pbMemData));
|
||||
}
|
||||
if (pDesc->dwValidData & DMUS_OBJ_STREAM) {
|
||||
@ -182,11 +182,11 @@ static HRESULT WINAPI IDirectMusicChordMapImpl_IDirectMusicObject_ParseDescripto
|
||||
LARGE_INTEGER liMove; /* used when skipping chunks */
|
||||
|
||||
TRACE("(%p, %p)\n", pStream, pDesc);
|
||||
|
||||
|
||||
/* FIXME: should this be determined from stream? */
|
||||
pDesc->dwValidData |= DMUS_OBJ_CLASS;
|
||||
memcpy (&pDesc->guidClass, &CLSID_DirectMusicChordMap, sizeof(CLSID));
|
||||
|
||||
pDesc->guidClass = CLSID_DirectMusicChordMap;
|
||||
|
||||
IStream_Read (pStream, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
|
||||
TRACE_(dmfile)(": %s chunk (size = 0x%04x)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
|
||||
switch (Chunk.fccID) {
|
||||
@ -539,8 +539,8 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicChordMapImpl (LPCGUID lpcGUID, LPVOID* pp
|
||||
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_DirectMusicChordMap, sizeof (CLSID));
|
||||
obj->pDesc->guidClass = CLSID_DirectMusicChordMap;
|
||||
obj->ref = 0; /* will be inited by QueryInterface */
|
||||
|
||||
|
||||
return IDirectMusicChordMapImpl_IUnknown_QueryInterface ((LPUNKNOWN)&obj->UnknownVtbl, lpcGUID, ppobj);
|
||||
}
|
||||
|
@ -283,8 +283,8 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicChordMapTrack (LPCGUID lpcGUID, LPVOID *p
|
||||
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_DirectMusicChordMapTrack, sizeof (CLSID));
|
||||
track->pDesc->guidClass = CLSID_DirectMusicChordMapTrack;
|
||||
track->ref = 0; /* will be inited by QueryInterface */
|
||||
|
||||
|
||||
return IDirectMusicChordMapTrack_IUnknown_QueryInterface ((LPUNKNOWN)&track->UnknownVtbl, lpcGUID, ppobj);
|
||||
}
|
||||
|
@ -281,8 +281,8 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicSignPostTrack (LPCGUID lpcGUID, LPVOID *p
|
||||
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_DirectMusicSignPostTrack, sizeof (CLSID));
|
||||
track->pDesc->guidClass = CLSID_DirectMusicSignPostTrack;
|
||||
track->ref = 0; /* will be inited by QueryInterface */
|
||||
|
||||
|
||||
return IDirectMusicSignPostTrack_IUnknown_QueryInterface ((LPUNKNOWN)&track->UnknownVtbl, lpcGUID, ppobj);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user