dswave: Assign to structs instead of using memcpy.

This commit is contained in:
Andrew Talbot 2008-02-26 20:20:15 +00:00 committed by Alexandre Julliard
parent 20c0c311da
commit a5a11b7889
1 changed files with 13 additions and 13 deletions

View File

@ -347,9 +347,9 @@ static HRESULT WINAPI IDirectMusicWaveImpl_IDirectMusicObject_SetDescriptor (LPD
/* 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)
@ -357,9 +357,9 @@ static HRESULT WINAPI IDirectMusicWaveImpl_IDirectMusicObject_SetDescriptor (LPD
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));
@ -384,7 +384,7 @@ static HRESULT WINAPI IDirectMusicWaveImpl_IDirectMusicObject_ParseDescriptor (L
/* 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);
@ -566,7 +566,7 @@ static HRESULT WINAPI IDirectMusicWaveImpl_IPersistStream_Load (LPPERSISTSTREAM
/* FIXME: should this be determined from stream? */
This->pDesc->dwValidData |= DMUS_OBJ_CLASS;
memcpy (&This->pDesc->guidClass, &CLSID_DirectMusicSegment, sizeof(CLSID));
This->pDesc->guidClass = CLSID_DirectMusicSegment;
IStream_Read (pStm, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
TRACE_(dmfile)(": %s chunk (size = 0x%04x)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
@ -737,7 +737,7 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicWaveImpl (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_DirectMusicSegment, sizeof (CLSID)); /* shown by tests */
obj->pDesc->guidClass = CLSID_DirectMusicSegment; /* shown by tests */
obj->ref = 0; /* will be inited by QueryInterface */
return IDirectMusicWaveImpl_IUnknown_QueryInterface ((LPUNKNOWN)&obj->UnknownVtbl, lpcGUID, ppobj);