Andrew Talbot : dsound: Assign to structs instead of using CopyMemory.

Alexandre Julliard julliard at winehq.org
Mon Mar 31 09:15:22 CDT 2008


Module: wine
Branch: master
Commit: e8aebfcb4ba39b168a9494e226a65b150e8c1e1d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e8aebfcb4ba39b168a9494e226a65b150e8c1e1d

Author: Andrew Talbot <andrew.talbot at talbotville.com>
Date:   Sat Mar 29 11:37:12 2008 +0000

dsound: Assign to structs instead of using CopyMemory.

---

 dlls/dsound/capture.c     |    2 +-
 dlls/dsound/dsound_main.c |    6 +++---
 dlls/dsound/primary.c     |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

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-cvs mailing list