dmstyle: Assign to structs instead of using memcpy.

This commit is contained in:
Andrew Talbot 2008-02-25 19:48:26 +00:00 committed by Alexandre Julliard
parent 6b39f35cf5
commit a01bfc26fe
8 changed files with 26 additions and 26 deletions

View File

@ -284,8 +284,8 @@ 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);
}

View File

@ -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,8 +413,8 @@ 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);
}

View File

@ -347,9 +347,9 @@ 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);
return IDirectMusicCommandTrack_IUnknown_QueryInterface ((LPUNKNOWN)&track->UnknownVtbl, lpcGUID, ppobj);
}

View File

@ -207,9 +207,9 @@ HRESULT IDirectMusicUtils_IPersistStream_ParseReference (LPPERSISTSTREAM iface,
}
TRACE_(dmfile)(": ListCount[0] = %d < ListSize[0] = %d\n", ListCount[0], ListSize[0]);
} 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");

View File

@ -290,8 +290,8 @@ 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);
}

View File

@ -287,8 +287,8 @@ 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);
}

View File

@ -228,12 +228,12 @@ static HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicObject_GetDescriptor (L
static HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc) {
ICOM_THIS_MULTI(IDirectMusicStyle8Impl, 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)
@ -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));
@ -266,11 +266,11 @@ static HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicObject_ParseDescriptor
LARGE_INTEGER liMove; /* used when skipping chunks */
TRACE("(%p, %p, %p)\n", This, pStream, pDesc);
/* 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);
switch (Chunk.fccID) {
@ -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);

View File

@ -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,9 +476,9 @@ 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);
return IDirectMusicStyleTrack_IUnknown_QueryInterface ((LPUNKNOWN)&track->UnknownVtbl, lpcGUID, ppobj);
}