Commit a01bfc26 authored by Andrew Talbot's avatar Andrew Talbot Committed by Alexandre Julliard

dmstyle: Assign to structs instead of using memcpy.

parent 6b39f35c
......@@ -284,7 +284,7 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicAuditionTrack (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_DirectMusicAuditionTrack, sizeof (CLSID));
track->pDesc->guidClass = CLSID_DirectMusicAuditionTrack;
track->ref = 0; /* will be inited by QueryInterface */
return IDirectMusicAuditionTrack_IUnknown_QueryInterface ((LPUNKNOWN)&track->UnknownVtbl, lpcGUID, ppobj);
......
......@@ -246,7 +246,7 @@ static ULONG WINAPI IDirectMusicChordTrack_IPersistStream_Release (LPPERSISTSTRE
static HRESULT WINAPI IDirectMusicChordTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
ICOM_THIS_MULTI(IDirectMusicChordTrack, PersistStreamVtbl, iface);
TRACE("(%p, %p)\n", This, pClassID);
memcpy(pClassID, &CLSID_DirectMusicChordTrack, sizeof(CLSID));
*pClassID = CLSID_DirectMusicChordTrack;
return S_OK;
}
......@@ -413,7 +413,7 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicChordTrack (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_DirectMusicChordTrack, sizeof (CLSID));
track->pDesc->guidClass = CLSID_DirectMusicChordTrack;
track->ref = 0; /* will be inited by QueryInterface */
return IDirectMusicChordTrack_IUnknown_QueryInterface ((LPUNKNOWN)&track->UnknownVtbl, lpcGUID, ppobj);
......
......@@ -347,7 +347,7 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicCommandTrack (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_DirectMusicCommandTrack, sizeof (CLSID));
track->pDesc->guidClass = CLSID_DirectMusicCommandTrack;
track->ref = 0; /* will be inited by QueryInterface */
list_init (&track->Commands);
......
......@@ -209,7 +209,7 @@ HRESULT IDirectMusicUtils_IPersistStream_ParseReference (LPPERSISTSTREAM iface,
} while (ListCount[0] < ListSize[0]);
ref_desc.dwValidData |= DMUS_OBJ_CLASS;
memcpy(&ref_desc.guidClass, &ref.guidClassID, sizeof(ref.guidClassID));
ref_desc.guidClass = ref.guidClassID;
TRACE_(dmfile)("** DM Reference Begin of Load ***\n");
TRACE_(dmfile)("With Desc:\n");
......
......@@ -290,7 +290,7 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicMotifTrack (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_DirectMusicMotifTrack, sizeof (CLSID));
track->pDesc->guidClass = CLSID_DirectMusicMotifTrack;
track->ref = 0; /* will be inited by QueryInterface */
return IDirectMusicMotifTrack_IUnknown_QueryInterface ((LPUNKNOWN)&track->UnknownVtbl, lpcGUID, ppobj);
......
......@@ -287,7 +287,7 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicMuteTrack (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_DirectMusicMuteTrack, sizeof (CLSID));
track->pDesc->guidClass = CLSID_DirectMusicMuteTrack;
track->ref = 0; /* will be inited by QueryInterface */
return IDirectMusicMuteTrack_IUnknown_QueryInterface ((LPUNKNOWN)&track->UnknownVtbl, lpcGUID, ppobj);
......
......@@ -231,9 +231,9 @@ static HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicObject_SetDescriptor (L
/* 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)
......@@ -241,9 +241,9 @@ static HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicObject_SetDescriptor (L
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));
......@@ -269,7 +269,7 @@ static HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicObject_ParseDescriptor
/* FIXME: should this be determined from stream? */
pDesc->dwValidData |= DMUS_OBJ_CLASS;
memcpy (&pDesc->guidClass, &CLSID_DirectMusicStyle, sizeof(CLSID));
pDesc->guidClass = CLSID_DirectMusicStyle;
IStream_Read (pStream, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
TRACE_(dmfile)(": %s chunk (size = 0x%04x)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
......@@ -435,7 +435,7 @@ static ULONG WINAPI IDirectMusicStyle8Impl_IPersistStream_Release (LPPERSISTSTRE
static HRESULT WINAPI IDirectMusicStyle8Impl_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
ICOM_THIS_MULTI(IDirectMusicStyle8Impl, PersistStreamVtbl, iface);
TRACE("(%p, %p)\n", This, pClassID);
memcpy(pClassID, &CLSID_DirectMusicStyle, sizeof(CLSID));
*pClassID = CLSID_DirectMusicStyle;
return S_OK;
}
......@@ -1097,7 +1097,7 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicStyleImpl (LPCGUID lpcGUID, LPVOID* ppobj
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_DirectMusicStyle, sizeof (CLSID));
obj->pDesc->guidClass = CLSID_DirectMusicStyle;
obj->ref = 0; /* will be inited by QueryInterface */
list_init (&obj->Bands);
list_init (&obj->Motifs);
......
......@@ -248,7 +248,7 @@ static ULONG WINAPI IDirectMusicStyleTrack_IPersistStream_Release (LPPERSISTSTRE
static HRESULT WINAPI IDirectMusicStyleTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
ICOM_THIS_MULTI(IDirectMusicStyleTrack, PersistStreamVtbl, iface);
TRACE("(%p, %p)\n", This, pClassID);
memcpy(pClassID, &CLSID_DirectMusicStyleTrack, sizeof(CLSID));
*pClassID = CLSID_DirectMusicStyleTrack;
return S_OK;
}
......@@ -476,7 +476,7 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicStyleTrack (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_DirectMusicStyleTrack, sizeof (CLSID));
track->pDesc->guidClass = CLSID_DirectMusicStyleTrack;
track->ref = 0; /* will be inited by QueryInterface */
list_init (&track->Items);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment