dsound: Assign to structs instead of using CopyMemory
Andrew Talbot
andrew.talbot at talbotville.com
Sat Mar 29 06:37:12 CDT 2008
Changelog:
dsound: Assign to structs instead of using CopyMemory.
diff --git a/dlls/dsound/capture.c b/dlls/dsound/capture.c
index 05ab805..a7977d6 100644
--- a/dlls/dsound/capture.c
+++ b/dlls/dsound/capture.c
@@ -1366,7 +1366,7 @@ HRESULT IDirectSoundCaptureBufferImpl_Create(
if (wfex->wFormatTag == WAVE_FORMAT_PCM) {
device->pwfx = HeapAlloc(GetProcessHeap(),0,sizeof(WAVEFORMATEX));
- CopyMemory(device->pwfx, wfex, sizeof(WAVEFORMATEX));
+ *device->pwfx = *wfex;
device->pwfx->cbSize = 0;
} else {
device->pwfx = HeapAlloc(GetProcessHeap(),0,sizeof(WAVEFORMATEX)+wfex->cbSize);
diff --git a/dlls/dsound/dsound_main.c b/dlls/dsound/dsound_main.c
index 2a1d1ca..d7c50b8 100644
--- a/dlls/dsound/dsound_main.c
+++ b/dlls/dsound/dsound_main.c
@@ -254,19 +254,19 @@ HRESULT WINAPI GetDeviceID(LPCGUID pGuidSrc, LPGUID pGuidDest)
if ( IsEqualGUID( &DSDEVID_DefaultPlayback, pGuidSrc ) ||
IsEqualGUID( &DSDEVID_DefaultVoicePlayback, pGuidSrc ) ) {
- CopyMemory(pGuidDest, &DSOUND_renderer_guids[ds_default_playback], sizeof(GUID));
+ *pGuidDest = DSOUND_renderer_guids[ds_default_playback];
TRACE("returns %s\n", get_device_id(pGuidDest));
return DS_OK;
}
if ( IsEqualGUID( &DSDEVID_DefaultCapture, pGuidSrc ) ||
IsEqualGUID( &DSDEVID_DefaultVoiceCapture, pGuidSrc ) ) {
- CopyMemory(pGuidDest, &DSOUND_capture_guids[ds_default_capture], sizeof(GUID));
+ *pGuidDest = DSOUND_capture_guids[ds_default_capture];
TRACE("returns %s\n", get_device_id(pGuidDest));
return DS_OK;
}
- CopyMemory(pGuidDest, pGuidSrc, sizeof(GUID));
+ *pGuidDest = *pGuidSrc;
TRACE("returns %s\n", get_device_id(pGuidDest));
return DS_OK;
diff --git a/dlls/dsound/primary.c b/dlls/dsound/primary.c
index e5d31c6..112bb39 100644
--- a/dlls/dsound/primary.c
+++ b/dlls/dsound/primary.c
@@ -1173,7 +1173,7 @@ HRESULT PrimaryBufferImpl_Create(
dsb->device = device;
dsb->lpVtbl = &dspbvt;
- CopyMemory(&device->dsbd, dsbd, sizeof(*dsbd));
+ device->dsbd = *dsbd;
TRACE("Created primary buffer at %p\n", dsb);
TRACE("(formattag=0x%04x,chans=%d,samplerate=%d,"
More information about the wine-patches
mailing list