Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
ef847a03
Commit
ef847a03
authored
Jan 24, 2005
by
Robert Reif
Committed by
Alexandre Julliard
Jan 24, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Windows memory functions.
parent
8ed49598
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
34 additions
and
34 deletions
+34
-34
buffer.c
dlls/dsound/buffer.c
+4
-4
capture.c
dlls/dsound/capture.c
+7
-7
dsound.c
dlls/dsound/dsound.c
+2
-2
dsound_main.c
dlls/dsound/dsound_main.c
+3
-3
mixer.c
dlls/dsound/mixer.c
+10
-10
primary.c
dlls/dsound/primary.c
+4
-4
propset.c
dlls/dsound/propset.c
+4
-4
No files found.
dlls/dsound/buffer.c
View file @
ef847a03
...
...
@@ -129,7 +129,7 @@ static HRESULT WINAPI IDirectSoundNotifyImpl_SetNotificationPositions(
WARN
(
"out of memory
\n
"
);
return
DSERR_OUTOFMEMORY
;
}
memcp
y
(
This
->
dsb
->
notifies
,
notify
,
howmuch
*
sizeof
(
DSBPOSITIONNOTIFY
));
CopyMemor
y
(
This
->
dsb
->
notifies
,
notify
,
howmuch
*
sizeof
(
DSBPOSITIONNOTIFY
));
This
->
dsb
->
nrofnotifies
=
howmuch
;
}
else
{
HeapFree
(
GetProcessHeap
(),
0
,
This
->
dsb
->
notifies
);
...
...
@@ -568,7 +568,7 @@ static HRESULT WINAPI IDirectSoundBufferImpl_GetFormat(
if
(
lpwf
)
{
/* NULL is valid */
if
(
wfsize
>=
size
)
{
memcp
y
(
lpwf
,
This
->
pwfx
,
size
);
CopyMemor
y
(
lpwf
,
This
->
pwfx
,
size
);
if
(
wfwritten
)
*
wfwritten
=
size
;
}
else
{
...
...
@@ -1059,7 +1059,7 @@ HRESULT WINAPI IDirectSoundBufferImpl_Create(
dsb
->
iks
=
NULL
;
/* size depends on version */
memcp
y
(
&
dsb
->
dsbd
,
dsbd
,
dsbd
->
dwSize
);
CopyMemor
y
(
&
dsb
->
dsbd
,
dsbd
,
dsbd
->
dwSize
);
/* variable sized struct so calculate size based on format */
if
(
wfex
->
wFormatTag
==
WAVE_FORMAT_PCM
)
{
...
...
@@ -1076,7 +1076,7 @@ HRESULT WINAPI IDirectSoundBufferImpl_Create(
return
DSERR_OUTOFMEMORY
;
}
memcp
y
(
dsb
->
pwfx
,
wfex
,
cp_size
);
CopyMemor
y
(
dsb
->
pwfx
,
wfex
,
cp_size
);
dsb
->
buflen
=
dsbd
->
dwBufferBytes
;
dsb
->
freq
=
dsbd
->
lpwfxFormat
->
nSamplesPerSec
;
...
...
dlls/dsound/capture.c
View file @
ef847a03
...
...
@@ -657,11 +657,11 @@ DSOUND_CreateDirectSoundCaptureBuffer(
if
(
wfex
->
wFormatTag
==
WAVE_FORMAT_PCM
)
{
ipDSC
->
pwfx
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WAVEFORMATEX
));
memcp
y
(
ipDSC
->
pwfx
,
wfex
,
sizeof
(
WAVEFORMATEX
));
CopyMemor
y
(
ipDSC
->
pwfx
,
wfex
,
sizeof
(
WAVEFORMATEX
));
ipDSC
->
pwfx
->
cbSize
=
0
;
}
else
{
ipDSC
->
pwfx
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WAVEFORMATEX
)
+
wfex
->
cbSize
);
memcp
y
(
ipDSC
->
pwfx
,
wfex
,
sizeof
(
WAVEFORMATEX
)
+
wfex
->
cbSize
);
CopyMemor
y
(
ipDSC
->
pwfx
,
wfex
,
sizeof
(
WAVEFORMATEX
)
+
wfex
->
cbSize
);
}
}
else
{
WARN
(
"lpcDSCBufferDesc->lpwfxFormat == 0
\n
"
);
...
...
@@ -692,7 +692,7 @@ DSOUND_CreateDirectSoundCaptureBuffer(
This
->
pdscbd
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
lpcDSCBufferDesc
->
dwSize
);
if
(
This
->
pdscbd
)
memcp
y
(
This
->
pdscbd
,
lpcDSCBufferDesc
,
lpcDSCBufferDesc
->
dwSize
);
CopyMemor
y
(
This
->
pdscbd
,
lpcDSCBufferDesc
,
lpcDSCBufferDesc
->
dwSize
);
else
{
WARN
(
"no memory
\n
"
);
This
->
dsound
->
capture_buffer
=
0
;
...
...
@@ -862,7 +862,7 @@ static HRESULT WINAPI IDirectSoundCaptureNotifyImpl_SetNotificationPositions(
WARN
(
"out of memory
\n
"
);
return
DSERR_OUTOFMEMORY
;
}
memcp
y
(
This
->
dscb
->
notifies
,
notify
,
howmuch
*
sizeof
(
DSBPOSITIONNOTIFY
));
CopyMemor
y
(
This
->
dscb
->
notifies
,
notify
,
howmuch
*
sizeof
(
DSBPOSITIONNOTIFY
));
This
->
dscb
->
nrofnotifies
=
howmuch
;
}
else
{
HeapFree
(
GetProcessHeap
(),
0
,
This
->
dscb
->
notifies
);
...
...
@@ -1132,7 +1132,7 @@ IDirectSoundCaptureBufferImpl_GetFormat(
dwSizeAllocated
=
sizeof
(
WAVEFORMATEX
)
+
This
->
dsound
->
pwfx
->
cbSize
;
if
(
lpwfxFormat
)
{
/* NULL is valid (just want size) */
memcp
y
(
lpwfxFormat
,
This
->
dsound
->
pwfx
,
dwSizeAllocated
);
CopyMemor
y
(
lpwfxFormat
,
This
->
dsound
->
pwfx
,
dwSizeAllocated
);
if
(
lpdwSizeWritten
)
*
lpdwSizeWritten
=
dwSizeAllocated
;
}
else
{
...
...
@@ -1376,8 +1376,8 @@ IDirectSoundCaptureBufferImpl_Start(
}
}
memset
(
ipDSC
->
buffer
,
(
ipDSC
->
pwfx
->
wBitsPerSample
==
8
)
?
128
:
0
,
ipDSC
->
buflen
);
FillMemory
(
ipDSC
->
buffer
,
ipDSC
->
buflen
,
(
ipDSC
->
pwfx
->
wBitsPerSample
==
8
)
?
128
:
0
);
}
else
{
TRACE
(
"no notifiers specified
\n
"
);
/* no notifiers specified so just create a single default header */
...
...
dlls/dsound/dsound.c
View file @
ef847a03
...
...
@@ -539,7 +539,7 @@ static HRESULT WINAPI IDirectSoundImpl_DuplicateSoundBuffer(
return
DSERR_OUTOFMEMORY
;
}
memcp
y
(
dsb
,
pdsb
,
sizeof
(
IDirectSoundBufferImpl
));
CopyMemor
y
(
dsb
,
pdsb
,
sizeof
(
IDirectSoundBufferImpl
));
if
(
pdsb
->
hwbuf
)
{
TRACE
(
"duplicating hardware buffer
\n
"
);
...
...
@@ -597,7 +597,7 @@ static HRESULT WINAPI IDirectSoundImpl_DuplicateSoundBuffer(
return
DSERR_OUTOFMEMORY
;
}
memcp
y
(
dsb
->
pwfx
,
pdsb
->
pwfx
,
size
);
CopyMemor
y
(
dsb
->
pwfx
,
pdsb
->
pwfx
,
size
);
InitializeCriticalSection
(
&
(
dsb
->
lock
));
dsb
->
lock
.
DebugInfo
->
Spare
[
1
]
=
(
DWORD
)
"DSOUNDBUFFER_lock"
;
...
...
dlls/dsound/dsound_main.c
View file @
ef847a03
...
...
@@ -287,19 +287,19 @@ HRESULT WINAPI GetDeviceID(LPCGUID pGuidSrc, LPGUID pGuidDest)
if
(
IsEqualGUID
(
&
DSDEVID_DefaultPlayback
,
pGuidSrc
)
||
IsEqualGUID
(
&
DSDEVID_DefaultVoicePlayback
,
pGuidSrc
)
)
{
memcp
y
(
pGuidDest
,
&
renderer_guids
[
ds_default_playback
],
sizeof
(
GUID
));
CopyMemor
y
(
pGuidDest
,
&
renderer_guids
[
ds_default_playback
],
sizeof
(
GUID
));
TRACE
(
"returns %s
\n
"
,
get_device_id
(
pGuidDest
));
return
DS_OK
;
}
if
(
IsEqualGUID
(
&
DSDEVID_DefaultCapture
,
pGuidSrc
)
||
IsEqualGUID
(
&
DSDEVID_DefaultVoiceCapture
,
pGuidSrc
)
)
{
memcp
y
(
pGuidDest
,
&
capture_guids
[
ds_default_capture
],
sizeof
(
GUID
));
CopyMemor
y
(
pGuidDest
,
&
capture_guids
[
ds_default_capture
],
sizeof
(
GUID
));
TRACE
(
"returns %s
\n
"
,
get_device_id
(
pGuidDest
));
return
DS_OK
;
}
memcp
y
(
pGuidDest
,
pGuidSrc
,
sizeof
(
GUID
));
CopyMemor
y
(
pGuidDest
,
pGuidSrc
,
sizeof
(
GUID
));
TRACE
(
"returns %s
\n
"
,
get_device_id
(
pGuidDest
));
return
DS_OK
;
...
...
dlls/dsound/mixer.c
View file @
ef847a03
...
...
@@ -240,10 +240,10 @@ static INT DSOUND_MixerNorm(IDirectSoundBufferImpl *dsb, BYTE *buf, INT len)
DWORD
bytesleft
=
dsb
->
buflen
-
dsb
->
buf_mixpos
;
TRACE
(
"(%p) Best case
\n
"
,
dsb
);
if
(
len
<=
bytesleft
)
memcp
y
(
obp
,
ibp
,
len
);
CopyMemor
y
(
obp
,
ibp
,
len
);
else
{
/* wrap */
memcpy
(
obp
,
ibp
,
bytesleft
);
memcp
y
(
obp
+
bytesleft
,
dsb
->
buffer
->
memory
,
len
-
bytesleft
);
CopyMemory
(
obp
,
ibp
,
bytesleft
);
CopyMemor
y
(
obp
+
bytesleft
,
dsb
->
buffer
->
memory
,
len
-
bytesleft
);
}
return
len
;
}
...
...
@@ -903,10 +903,10 @@ static void DSOUND_MixReset(IDirectSoundImpl *dsound, DWORD writepos)
/* wipe out premixed data */
if
(
dsound
->
mixpos
<
writepos
)
{
memset
(
dsound
->
buffer
+
writepos
,
nfiller
,
dsound
->
buflen
-
writepos
);
memset
(
dsound
->
buffer
,
nfiller
,
dsound
->
mixpos
);
FillMemory
(
dsound
->
buffer
+
writepos
,
dsound
->
buflen
-
writepos
,
nfiller
);
FillMemory
(
dsound
->
buffer
,
dsound
->
mixpos
,
nfiller
);
}
else
{
memset
(
dsound
->
buffer
+
writepos
,
nfiller
,
dsound
->
mixpos
-
writepos
);
FillMemory
(
dsound
->
buffer
+
writepos
,
dsound
->
mixpos
-
writepos
,
nfiller
);
}
/* reset primary mix position */
...
...
@@ -992,10 +992,10 @@ void DSOUND_PerformMix(IDirectSoundImpl *dsound)
assert
(
dsound
->
playpos
<
dsound
->
buflen
);
/* wipe out just-played sound data */
if
(
playpos
<
dsound
->
playpos
)
{
memset
(
dsound
->
buffer
+
dsound
->
playpos
,
nfiller
,
dsound
->
buflen
-
dsound
->
playpos
);
memset
(
dsound
->
buffer
,
nfiller
,
playpos
);
FillMemory
(
dsound
->
buffer
+
dsound
->
playpos
,
dsound
->
buflen
-
dsound
->
playpos
,
nfiller
);
FillMemory
(
dsound
->
buffer
,
playpos
,
nfiller
);
}
else
{
memset
(
dsound
->
buffer
+
dsound
->
playpos
,
nfiller
,
playpos
-
dsound
->
playpos
);
FillMemory
(
dsound
->
buffer
+
dsound
->
playpos
,
playpos
-
dsound
->
playpos
,
nfiller
);
}
dsound
->
playpos
=
playpos
;
...
...
@@ -1067,7 +1067,7 @@ void DSOUND_PerformMix(IDirectSoundImpl *dsound)
inq
=
0
;
maxq
=
dsound
->
buflen
;
if
(
maxq
>
frag
)
maxq
=
frag
;
memset
(
dsound
->
buffer
,
nfiller
,
dsound
->
buflen
);
FillMemory
(
dsound
->
buffer
,
dsound
->
buflen
,
nfiller
);
paused
=
TRUE
;
}
...
...
dlls/dsound/primary.c
View file @
ef847a03
...
...
@@ -127,7 +127,7 @@ static HRESULT DSOUND_PrimaryOpen(IDirectSoundImpl *This)
This
->
pwqueue
=
0
;
This
->
playpos
=
0
;
This
->
mixpos
=
0
;
memset
(
This
->
buffer
,
(
This
->
pwfx
->
wBitsPerSample
==
16
)
?
0
:
128
,
This
->
buflen
);
FillMemory
(
This
->
buffer
,
This
->
buflen
,
(
This
->
pwfx
->
wBitsPerSample
==
16
)
?
0
:
128
);
TRACE
(
"fraglen=%ld
\n
"
,
This
->
fraglen
);
DSOUND_WaveQueue
(
This
,
(
DWORD
)
-
1
);
}
...
...
@@ -371,7 +371,7 @@ static HRESULT WINAPI PrimaryBufferImpl_SetFormat(
nSamplesPerSec
=
dsound
->
pwfx
->
nSamplesPerSec
;
memcp
y
(
dsound
->
pwfx
,
wfex
,
cp_size
);
CopyMemor
y
(
dsound
->
pwfx
,
wfex
,
cp_size
);
if
(
dsound
->
drvdesc
.
dwFlags
&
DSDDESC_DOMMSYSTEMSETFORMAT
)
{
DWORD
flags
=
CALLBACK_FUNCTION
;
...
...
@@ -656,7 +656,7 @@ static HRESULT WINAPI PrimaryBufferImpl_GetFormat(
if
(
lpwf
)
{
/* NULL is valid */
if
(
wfsize
>=
size
)
{
memcp
y
(
lpwf
,
This
->
dsound
->
pwfx
,
size
);
CopyMemor
y
(
lpwf
,
This
->
dsound
->
pwfx
,
size
);
if
(
wfwritten
)
*
wfwritten
=
size
;
}
else
{
...
...
@@ -1089,7 +1089,7 @@ HRESULT WINAPI PrimaryBufferImpl_Create(
dsb
->
dsound
=
ds
;
dsb
->
lpVtbl
=
&
dspbvt
;
memcp
y
(
&
ds
->
dsbd
,
dsbd
,
sizeof
(
*
dsbd
));
CopyMemor
y
(
&
ds
->
dsbd
,
dsbd
,
sizeof
(
*
dsbd
));
TRACE
(
"Created primary buffer at %p
\n
"
,
dsb
);
TRACE
(
"(formattag=0x%04x,chans=%d,samplerate=%ld,"
...
...
dlls/dsound/propset.c
View file @
ef847a03
...
...
@@ -859,7 +859,7 @@ static HRESULT WINAPI DSPROPERTY_EnumerateA(
err
=
mmErr
(
waveOutMessage
((
HWAVEOUT
)
wod
,
DRV_QUERYDSOUNDDESC
,(
DWORD
)
&
desc
,
0
));
if
(
err
==
DS_OK
)
{
DWORD
size
;
memset
(
&
data
,
0
,
sizeof
(
data
));
ZeroMemory
(
&
data
,
sizeof
(
data
));
data
.
DataFlow
=
DIRECTSOUNDDEVICE_DATAFLOW_RENDER
;
data
.
WaveDeviceId
=
wod
;
data
.
DeviceId
=
renderer_guids
[
wod
];
...
...
@@ -889,7 +889,7 @@ static HRESULT WINAPI DSPROPERTY_EnumerateA(
err
=
mmErr
(
waveInMessage
((
HWAVEIN
)
wid
,
DRV_QUERYDSOUNDDESC
,(
DWORD
)
&
desc
,
0
));
if
(
err
==
DS_OK
)
{
DWORD
size
;
memset
(
&
data
,
0
,
sizeof
(
data
));
ZeroMemory
(
&
data
,
sizeof
(
data
));
data
.
DataFlow
=
DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE
;
data
.
WaveDeviceId
=
wid
;
data
.
DeviceId
=
capture_guids
[
wid
];
...
...
@@ -959,7 +959,7 @@ static HRESULT WINAPI DSPROPERTY_EnumerateW(
WCHAR
*
wInterface
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
err
=
mmErr
(
waveOutMessage
((
HWAVEOUT
)
wod
,
DRV_QUERYDEVICEINTERFACE
,
(
DWORD_PTR
)
wInterface
,
size
));
if
(
err
==
DS_OK
)
{
memset
(
&
data
,
0
,
sizeof
(
data
));
ZeroMemory
(
&
data
,
sizeof
(
data
));
data
.
DataFlow
=
DIRECTSOUNDDEVICE_DATAFLOW_RENDER
;
data
.
WaveDeviceId
=
wod
;
data
.
DeviceId
=
renderer_guids
[
wod
];
...
...
@@ -993,7 +993,7 @@ static HRESULT WINAPI DSPROPERTY_EnumerateW(
WCHAR
*
wInterface
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
err
=
mmErr
(
waveInMessage
((
HWAVEIN
)
wod
,
DRV_QUERYDEVICEINTERFACE
,
(
DWORD_PTR
)
wInterface
,
size
));
if
(
err
==
DS_OK
)
{
memset
(
&
data
,
0
,
sizeof
(
data
));
ZeroMemory
(
&
data
,
sizeof
(
data
));
data
.
DataFlow
=
DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE
;
data
.
WaveDeviceId
=
wid
;
data
.
DeviceId
=
capture_guids
[
wid
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment