Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
bb6bcaf8
Commit
bb6bcaf8
authored
Nov 01, 2023
by
Alex Henrie
Committed by
Alexandre Julliard
Nov 06, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winmm/tests: Use CRT allocation functions.
parent
0b7eed03
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
37 deletions
+33
-37
capture.c
dlls/winmm/tests/capture.c
+7
-8
midi.c
dlls/winmm/tests/midi.c
+8
-8
mixer.c
dlls/winmm/tests/mixer.c
+4
-6
wave.c
dlls/winmm/tests/wave.c
+14
-15
No files found.
dlls/winmm/tests/capture.c
View file @
bb6bcaf8
...
@@ -192,7 +192,7 @@ static void wave_in_test_deviceIn(int device, WAVEFORMATEX *pwfx, DWORD format,
...
@@ -192,7 +192,7 @@ static void wave_in_test_deviceIn(int device, WAVEFORMATEX *pwfx, DWORD format,
/* Check that the position is 0 at start */
/* Check that the position is 0 at start */
check_position
(
device
,
win
,
0
,
pwfx
);
check_position
(
device
,
win
,
0
,
pwfx
);
frag
.
lpData
=
HeapAlloc
(
GetProcessHeap
(),
0
,
pwfx
->
nAvgBytesPerSec
);
frag
.
lpData
=
malloc
(
pwfx
->
nAvgBytesPerSec
);
frag
.
dwBufferLength
=
pwfx
->
nAvgBytesPerSec
;
frag
.
dwBufferLength
=
pwfx
->
nAvgBytesPerSec
;
frag
.
dwBytesRecorded
=
0
;
frag
.
dwBytesRecorded
=
0
;
frag
.
dwUser
=
0
;
frag
.
dwUser
=
0
;
...
@@ -298,7 +298,7 @@ static void wave_in_test_deviceIn(int device, WAVEFORMATEX *pwfx, DWORD format,
...
@@ -298,7 +298,7 @@ static void wave_in_test_deviceIn(int device, WAVEFORMATEX *pwfx, DWORD format,
trace
(
"Unable to play back the recorded sound
\n
"
);
trace
(
"Unable to play back the recorded sound
\n
"
);
}
}
HeapFree
(
GetProcessHeap
(),
0
,
frag
.
lpData
);
free
(
frag
.
lpData
);
CloseHandle
(
hevent
);
CloseHandle
(
hevent
);
}
}
...
@@ -379,7 +379,7 @@ static void wave_in_test_device(UINT_PTR device)
...
@@ -379,7 +379,7 @@ static void wave_in_test_device(UINT_PTR device)
"waveInMessage(%s): failed to get interface size: rc=%s
\n
"
,
"waveInMessage(%s): failed to get interface size: rc=%s
\n
"
,
dev_name
(
device
),
wave_in_error
(
rc
));
dev_name
(
device
),
wave_in_error
(
rc
));
if
(
rc
==
MMSYSERR_NOERROR
)
{
if
(
rc
==
MMSYSERR_NOERROR
)
{
nameW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
nameW
=
malloc
(
size
);
rc
=
waveInMessage
((
HWAVEIN
)
device
,
DRV_QUERYDEVICEINTERFACE
,
rc
=
waveInMessage
((
HWAVEIN
)
device
,
DRV_QUERYDEVICEINTERFACE
,
(
DWORD_PTR
)
nameW
,
size
);
(
DWORD_PTR
)
nameW
,
size
);
ok
(
rc
==
MMSYSERR_NOERROR
,
"waveInMessage(%s): failed to get interface "
ok
(
rc
==
MMSYSERR_NOERROR
,
"waveInMessage(%s): failed to get interface "
...
@@ -387,14 +387,13 @@ static void wave_in_test_device(UINT_PTR device)
...
@@ -387,14 +387,13 @@ static void wave_in_test_device(UINT_PTR device)
ok
(
lstrlenW
(
nameW
)
+
1
==
size
/
sizeof
(
WCHAR
),
ok
(
lstrlenW
(
nameW
)
+
1
==
size
/
sizeof
(
WCHAR
),
"got an incorrect size %ld
\n
"
,
size
);
"got an incorrect size %ld
\n
"
,
size
);
if
(
rc
==
MMSYSERR_NOERROR
)
{
if
(
rc
==
MMSYSERR_NOERROR
)
{
nameA
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
/
sizeof
(
WCHAR
));
nameA
=
malloc
(
size
/
sizeof
(
WCHAR
));
WideCharToMultiByte
(
CP_ACP
,
0
,
nameW
,
size
/
sizeof
(
WCHAR
),
WideCharToMultiByte
(
CP_ACP
,
0
,
nameW
,
size
/
sizeof
(
WCHAR
),
nameA
,
size
/
sizeof
(
WCHAR
),
NULL
,
NULL
);
nameA
,
size
/
sizeof
(
WCHAR
),
NULL
,
NULL
);
}
}
HeapFree
(
GetProcessHeap
(),
0
,
nameW
);
free
(
nameW
);
}
else
if
(
rc
==
MMSYSERR_NOTSUPPORTED
)
{
}
else
if
(
rc
==
MMSYSERR_NOTSUPPORTED
)
{
nameA
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
"not supported"
));
nameA
=
strdup
(
"not supported"
);
strcpy
(
nameA
,
"not supported"
);
}
}
trace
(
" %s:
\"
%s
\"
(%s) %d.%d (%d:%d)
\n
"
,
dev_name
(
device
),
capsA
.
szPname
,
trace
(
" %s:
\"
%s
\"
(%s) %d.%d (%d:%d)
\n
"
,
dev_name
(
device
),
capsA
.
szPname
,
...
@@ -403,7 +402,7 @@ static void wave_in_test_device(UINT_PTR device)
...
@@ -403,7 +402,7 @@ static void wave_in_test_device(UINT_PTR device)
trace
(
" channels=%d formats=%05lx
\n
"
,
trace
(
" channels=%d formats=%05lx
\n
"
,
capsA
.
wChannels
,
capsA
.
dwFormats
);
capsA
.
wChannels
,
capsA
.
dwFormats
);
HeapFree
(
GetProcessHeap
(),
0
,
nameA
);
free
(
nameA
);
for
(
f
=
0
;
f
<
ARRAY_SIZE
(
win_formats
);
f
++
)
{
for
(
f
=
0
;
f
<
ARRAY_SIZE
(
win_formats
);
f
++
)
{
format
.
wFormatTag
=
WAVE_FORMAT_PCM
;
format
.
wFormatTag
=
WAVE_FORMAT_PCM
;
...
...
dlls/winmm/tests/midi.c
View file @
bb6bcaf8
...
@@ -136,7 +136,7 @@ static void test_midiIn_device(UINT udev, HWND hwnd)
...
@@ -136,7 +136,7 @@ static void test_midiIn_device(UINT udev, HWND hwnd)
mhdr
.
dwUser
=
0x56FA552C
;
mhdr
.
dwUser
=
0x56FA552C
;
mhdr
.
dwBufferLength
=
70000
;
/* > 64KB! */
mhdr
.
dwBufferLength
=
70000
;
/* > 64KB! */
mhdr
.
dwBytesRecorded
=
5
;
mhdr
.
dwBytesRecorded
=
5
;
mhdr
.
lpData
=
HeapAlloc
(
GetProcessHeap
(),
0
,
mhdr
.
dwBufferLength
);
mhdr
.
lpData
=
malloc
(
mhdr
.
dwBufferLength
);
ok
(
mhdr
.
lpData
!=
NULL
,
"No %ld bytes of memory!
\n
"
,
mhdr
.
dwBufferLength
);
ok
(
mhdr
.
lpData
!=
NULL
,
"No %ld bytes of memory!
\n
"
,
mhdr
.
dwBufferLength
);
if
(
mhdr
.
lpData
)
{
if
(
mhdr
.
lpData
)
{
rc
=
midiInPrepareHeader
(
hm
,
&
mhdr
,
offsetof
(
MIDIHDR
,
dwOffset
)
-
1
);
rc
=
midiInPrepareHeader
(
hm
,
&
mhdr
,
offsetof
(
MIDIHDR
,
dwOffset
)
-
1
);
...
@@ -204,7 +204,7 @@ static void test_midiIn_device(UINT udev, HWND hwnd)
...
@@ -204,7 +204,7 @@ static void test_midiIn_device(UINT udev, HWND hwnd)
ok
(
!
rc
,
"midiInClose rc=%s
\n
"
,
mmsys_error
(
rc
));
ok
(
!
rc
,
"midiInClose rc=%s
\n
"
,
mmsys_error
(
rc
));
ok
(
mhdr
.
dwUser
==
0x56FA552C
,
"MIDIHDR.dwUser changed to %Ix
\n
"
,
mhdr
.
dwUser
);
ok
(
mhdr
.
dwUser
==
0x56FA552C
,
"MIDIHDR.dwUser changed to %Ix
\n
"
,
mhdr
.
dwUser
);
HeapFree
(
GetProcessHeap
(),
0
,
mhdr
.
lpData
);
free
(
mhdr
.
lpData
);
test_notification
(
hwnd
,
"midiInClose"
,
MIM_CLOSE
,
0
);
test_notification
(
hwnd
,
"midiInClose"
,
MIM_CLOSE
,
0
);
test_notification
(
hwnd
,
"midiIn over"
,
0
,
WHATEVER
);
test_notification
(
hwnd
,
"midiIn over"
,
0
,
WHATEVER
);
}
}
...
@@ -358,7 +358,7 @@ static void test_midiOut_device(UINT udev, HWND hwnd)
...
@@ -358,7 +358,7 @@ static void test_midiOut_device(UINT udev, HWND hwnd)
mhdr
.
dwUser
=
0x56FA552C
;
mhdr
.
dwUser
=
0x56FA552C
;
mhdr
.
dwOffset
=
0xDEADBEEF
;
mhdr
.
dwOffset
=
0xDEADBEEF
;
mhdr
.
dwBufferLength
=
70000
;
/* > 64KB! */
mhdr
.
dwBufferLength
=
70000
;
/* > 64KB! */
mhdr
.
lpData
=
HeapAlloc
(
GetProcessHeap
(),
0
,
mhdr
.
dwBufferLength
);
mhdr
.
lpData
=
malloc
(
mhdr
.
dwBufferLength
);
ok
(
mhdr
.
lpData
!=
NULL
,
"No %ld bytes of memory!
\n
"
,
mhdr
.
dwBufferLength
);
ok
(
mhdr
.
lpData
!=
NULL
,
"No %ld bytes of memory!
\n
"
,
mhdr
.
dwBufferLength
);
if
(
mhdr
.
lpData
)
{
if
(
mhdr
.
lpData
)
{
rc
=
midiOutLongMsg
(
hm
,
&
mhdr
,
sizeof
(
mhdr
));
rc
=
midiOutLongMsg
(
hm
,
&
mhdr
,
sizeof
(
mhdr
));
...
@@ -399,7 +399,7 @@ static void test_midiOut_device(UINT udev, HWND hwnd)
...
@@ -399,7 +399,7 @@ static void test_midiOut_device(UINT udev, HWND hwnd)
ok
(
!
rc
,
"midiOutUnprepare rc=%s
\n
"
,
mmsys_error
(
rc
));
ok
(
!
rc
,
"midiOutUnprepare rc=%s
\n
"
,
mmsys_error
(
rc
));
ok
(
mhdr
.
dwFlags
==
(
MHDR_INQUEUE
|
MHDR_DONE
),
"dwFlags=%lx
\n
"
,
mhdr
.
dwFlags
);
ok
(
mhdr
.
dwFlags
==
(
MHDR_INQUEUE
|
MHDR_DONE
),
"dwFlags=%lx
\n
"
,
mhdr
.
dwFlags
);
HeapFree
(
GetProcessHeap
(),
0
,
mhdr
.
lpData
);
free
(
mhdr
.
lpData
);
}
}
ok
(
mhdr
.
dwUser
==
0x56FA552C
,
"MIDIHDR.dwUser changed to %Ix
\n
"
,
mhdr
.
dwUser
);
ok
(
mhdr
.
dwUser
==
0x56FA552C
,
"MIDIHDR.dwUser changed to %Ix
\n
"
,
mhdr
.
dwUser
);
ok
(
mhdr
.
dwOffset
==
0xDEADBEEF
,
"MIDIHDR.dwOffset changed to %lx
\n
"
,
mhdr
.
dwOffset
);
ok
(
mhdr
.
dwOffset
==
0xDEADBEEF
,
"MIDIHDR.dwOffset changed to %lx
\n
"
,
mhdr
.
dwOffset
);
...
@@ -810,7 +810,7 @@ static void test_midiStream(UINT udev, HWND hwnd)
...
@@ -810,7 +810,7 @@ static void test_midiStream(UINT udev, HWND hwnd)
ok
(
0
==
strmNops
[
1
].
dwStreamID
,
"dwStreamID[1] set to %lx
\n
"
,
strmNops
[
1
].
dwStreamID
);
ok
(
0
==
strmNops
[
1
].
dwStreamID
,
"dwStreamID[1] set to %lx
\n
"
,
strmNops
[
1
].
dwStreamID
);
mhdr
.
dwBufferLength
=
70000
;
/* > 64KB! */
mhdr
.
dwBufferLength
=
70000
;
/* > 64KB! */
mhdr
.
lpData
=
HeapAlloc
(
GetProcessHeap
(),
0
,
mhdr
.
dwBufferLength
);
mhdr
.
lpData
=
malloc
(
mhdr
.
dwBufferLength
);
ok
(
mhdr
.
lpData
!=
NULL
,
"No %ld bytes of memory!
\n
"
,
mhdr
.
dwBufferLength
);
ok
(
mhdr
.
lpData
!=
NULL
,
"No %ld bytes of memory!
\n
"
,
mhdr
.
dwBufferLength
);
if
(
mhdr
.
lpData
)
{
if
(
mhdr
.
lpData
)
{
mhdr
.
dwFlags
=
0
;
mhdr
.
dwFlags
=
0
;
...
@@ -821,7 +821,7 @@ static void test_midiStream(UINT udev, HWND hwnd)
...
@@ -821,7 +821,7 @@ static void test_midiStream(UINT udev, HWND hwnd)
rc
=
midiOutUnprepareHeader
((
HMIDIOUT
)
hm
,
&
mhdr
,
sizeof
(
mhdr
));
rc
=
midiOutUnprepareHeader
((
HMIDIOUT
)
hm
,
&
mhdr
,
sizeof
(
mhdr
));
ok
(
!
rc
,
"midiOutUnprepare rc=%s
\n
"
,
mmsys_error
(
rc
));
ok
(
!
rc
,
"midiOutUnprepare rc=%s
\n
"
,
mmsys_error
(
rc
));
HeapFree
(
GetProcessHeap
(),
0
,
mhdr
.
lpData
);
free
(
mhdr
.
lpData
);
}
}
rc
=
midiStreamClose
(
hm
);
rc
=
midiStreamClose
(
hm
);
...
@@ -999,7 +999,7 @@ static void test_midiStream(UINT udev, HWND hwnd)
...
@@ -999,7 +999,7 @@ static void test_midiStream(UINT udev, HWND hwnd)
memset
(
&
mhdr
,
0
,
sizeof
(
mhdr
));
memset
(
&
mhdr
,
0
,
sizeof
(
mhdr
));
mhdr
.
dwBufferLength
=
sizeof
(
MIDISHORTEVENT
)
*
5
+
ROUNDUP4
(
sizeof
(
SysEx_reset
))
+
mhdr
.
dwBufferLength
=
sizeof
(
MIDISHORTEVENT
)
*
5
+
ROUNDUP4
(
sizeof
(
SysEx_reset
))
+
ROUNDUP4
(
sizeof
(
SysEx_volume_off
))
+
ROUNDUP4
(
sizeof
(
SysEx_volume_full
));
ROUNDUP4
(
sizeof
(
SysEx_volume_off
))
+
ROUNDUP4
(
sizeof
(
SysEx_volume_full
));
mhdr
.
lpData
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
mhdr
.
dwBufferLength
);
mhdr
.
lpData
=
calloc
(
1
,
mhdr
.
dwBufferLength
);
ok
(
mhdr
.
lpData
!=
NULL
,
"No %ld bytes of memory!
\n
"
,
mhdr
.
dwBufferLength
);
ok
(
mhdr
.
lpData
!=
NULL
,
"No %ld bytes of memory!
\n
"
,
mhdr
.
dwBufferLength
);
if
(
mhdr
.
lpData
)
{
if
(
mhdr
.
lpData
)
{
MIDIEVENT
*
e
;
MIDIEVENT
*
e
;
...
@@ -1042,7 +1042,7 @@ static void test_midiStream(UINT udev, HWND hwnd)
...
@@ -1042,7 +1042,7 @@ static void test_midiStream(UINT udev, HWND hwnd)
rc
=
midiOutUnprepareHeader
((
HMIDIOUT
)
hm
,
&
mhdr
,
sizeof
(
mhdr
));
rc
=
midiOutUnprepareHeader
((
HMIDIOUT
)
hm
,
&
mhdr
,
sizeof
(
mhdr
));
ok
(
!
rc
,
"midiOutUnprepare rc=%s
\n
"
,
mmsys_error
(
rc
));
ok
(
!
rc
,
"midiOutUnprepare rc=%s
\n
"
,
mmsys_error
(
rc
));
HeapFree
(
GetProcessHeap
(),
0
,
mhdr
.
lpData
);
free
(
mhdr
.
lpData
);
}
}
rc
=
midiStreamClose
(
hm
);
rc
=
midiStreamClose
(
hm
);
ok
(
!
rc
,
"midiOutClose rc=%s
\n
"
,
mmsys_error
(
rc
));
ok
(
!
rc
,
"midiOutClose rc=%s
\n
"
,
mmsys_error
(
rc
));
...
...
dlls/winmm/tests/mixer.c
View file @
bb6bcaf8
...
@@ -512,8 +512,7 @@ static void mixer_test_deviceA(int device)
...
@@ -512,8 +512,7 @@ static void mixer_test_deviceA(int device)
mixerlineA
.
Target
.
wMid
,
mixerlineA
.
Target
.
wPid
);
mixerlineA
.
Target
.
wMid
,
mixerlineA
.
Target
.
wPid
);
}
}
if
(
mixerlineA
.
cControls
)
{
if
(
mixerlineA
.
cControls
)
{
array
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
array
=
calloc
(
mixerlineA
.
cControls
,
sizeof
(
MIXERCONTROLA
));
mixerlineA
.
cControls
*
sizeof
(
MIXERCONTROLA
));
if
(
array
)
{
if
(
array
)
{
memset
(
&
controls
,
0
,
sizeof
(
controls
));
memset
(
&
controls
,
0
,
sizeof
(
controls
));
...
@@ -565,7 +564,7 @@ static void mixer_test_deviceA(int device)
...
@@ -565,7 +564,7 @@ static void mixer_test_deviceA(int device)
}
}
}
}
HeapFree
(
GetProcessHeap
(),
0
,
array
);
free
(
array
);
}
}
}
}
}
}
...
@@ -913,8 +912,7 @@ static void mixer_test_deviceW(int device)
...
@@ -913,8 +912,7 @@ static void mixer_test_deviceW(int device)
mixerlineW
.
Target
.
wMid
,
mixerlineW
.
Target
.
wPid
);
mixerlineW
.
Target
.
wMid
,
mixerlineW
.
Target
.
wPid
);
}
}
if
(
mixerlineW
.
cControls
)
{
if
(
mixerlineW
.
cControls
)
{
array
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
array
=
calloc
(
mixerlineW
.
cControls
,
sizeof
(
MIXERCONTROLW
));
mixerlineW
.
cControls
*
sizeof
(
MIXERCONTROLW
));
if
(
array
)
{
if
(
array
)
{
rc
=
mixerGetLineControlsW
(
mix
,
0
,
MIXER_GETLINECONTROLSF_ALL
);
rc
=
mixerGetLineControlsW
(
mix
,
0
,
MIXER_GETLINECONTROLSF_ALL
);
ok
(
rc
==
MMSYSERR_INVALPARAM
,
ok
(
rc
==
MMSYSERR_INVALPARAM
,
...
@@ -967,7 +965,7 @@ static void mixer_test_deviceW(int device)
...
@@ -967,7 +965,7 @@ static void mixer_test_deviceW(int device)
}
}
}
}
HeapFree
(
GetProcessHeap
(),
0
,
array
);
free
(
array
);
}
}
}
}
}
}
...
...
dlls/winmm/tests/wave.c
View file @
bb6bcaf8
...
@@ -98,7 +98,7 @@ static char* wave_generate_la(WAVEFORMATEX* wfx, double duration, DWORD* size)
...
@@ -98,7 +98,7 @@ static char* wave_generate_la(WAVEFORMATEX* wfx, double duration, DWORD* size)
nb_samples
=
(
int
)(
duration
*
wfx
->
nSamplesPerSec
);
nb_samples
=
(
int
)(
duration
*
wfx
->
nSamplesPerSec
);
*
size
=
nb_samples
*
wfx
->
nBlockAlign
;
*
size
=
nb_samples
*
wfx
->
nBlockAlign
;
b
=
buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
*
size
);
b
=
buf
=
malloc
(
*
size
);
for
(
i
=
0
;
i
<
nb_samples
;
i
++
)
{
for
(
i
=
0
;
i
<
nb_samples
;
i
++
)
{
double
y
=
sin
(
440
.
0
*
2
*
PI
*
i
/
wfx
->
nSamplesPerSec
);
double
y
=
sin
(
440
.
0
*
2
*
PI
*
i
/
wfx
->
nSamplesPerSec
);
if
(
wfx
->
wBitsPerSample
==
8
)
{
if
(
wfx
->
wBitsPerSample
==
8
)
{
...
@@ -157,7 +157,7 @@ static char* wave_generate_silence(WAVEFORMATEX* wfx, double duration, DWORD* si
...
@@ -157,7 +157,7 @@ static char* wave_generate_silence(WAVEFORMATEX* wfx, double duration, DWORD* si
nb_samples
=
(
int
)(
duration
*
wfx
->
nSamplesPerSec
);
nb_samples
=
(
int
)(
duration
*
wfx
->
nSamplesPerSec
);
*
size
=
nb_samples
*
wfx
->
nBlockAlign
;
*
size
=
nb_samples
*
wfx
->
nBlockAlign
;
b
=
buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
*
size
);
b
=
buf
=
malloc
(
*
size
);
for
(
i
=
0
;
i
<
nb_samples
;
i
++
)
{
for
(
i
=
0
;
i
<
nb_samples
;
i
++
)
{
if
(
wfx
->
wBitsPerSample
==
8
)
{
if
(
wfx
->
wBitsPerSample
==
8
)
{
for
(
j
=
0
;
j
<
wfx
->
nChannels
;
j
++
)
for
(
j
=
0
;
j
<
wfx
->
nChannels
;
j
++
)
...
@@ -671,7 +671,7 @@ static void wave_out_test_deviceOut(int device, double duration, int headers, in
...
@@ -671,7 +671,7 @@ static void wave_out_test_deviceOut(int device, double duration, int headers, in
pwfx
->
nSamplesPerSec
,
pwfx
->
wBitsPerSample
,
pwfx
->
nSamplesPerSec
,
pwfx
->
wBitsPerSample
,
pwfx
->
nChannels
,
nSamplesPerSec
,
wBitsPerSample
,
nChannels
);
pwfx
->
nChannels
,
nSamplesPerSec
,
wBitsPerSample
,
nChannels
);
frags
=
HeapAlloc
(
GetProcessHeap
(),
0
,
headers
*
sizeof
(
WAVEHDR
));
frags
=
malloc
(
headers
*
sizeof
(
WAVEHDR
));
if
(
sine
)
if
(
sine
)
buffer
=
wave_generate_la
(
pwfx
,
duration
/
(
loops
+
1
),
&
length
);
buffer
=
wave_generate_la
(
pwfx
,
duration
/
(
loops
+
1
),
&
length
);
...
@@ -855,14 +855,14 @@ static void wave_out_test_deviceOut(int device, double duration, int headers, in
...
@@ -855,14 +855,14 @@ static void wave_out_test_deviceOut(int device, double duration, int headers, in
ok
(
rc
==
WAIT_TIMEOUT
,
"Notification from %s rc=%x
\n
"
,
ok
(
rc
==
WAIT_TIMEOUT
,
"Notification from %s rc=%x
\n
"
,
wave_open_flags
(
flags
|
WAVE_FORMAT_QUERY
),
rc
);
wave_open_flags
(
flags
|
WAVE_FORMAT_QUERY
),
rc
);
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
free
(
buffer
);
EXIT:
EXIT:
if
((
flags
&
CALLBACK_TYPEMASK
)
==
CALLBACK_THREAD
)
{
if
((
flags
&
CALLBACK_TYPEMASK
)
==
CALLBACK_THREAD
)
{
PostThreadMessageW
(
thread_id
,
WM_APP
,
0
,
0
);
PostThreadMessageW
(
thread_id
,
WM_APP
,
0
,
0
);
WaitForSingleObject
(
hevent
,
10000
);
WaitForSingleObject
(
hevent
,
10000
);
}
}
CloseHandle
(
hevent
);
CloseHandle
(
hevent
);
HeapFree
(
GetProcessHeap
(),
0
,
frags
);
free
(
frags
);
}
}
static
void
wave_out_test_device
(
UINT_PTR
device
)
static
void
wave_out_test_device
(
UINT_PTR
device
)
...
@@ -948,22 +948,21 @@ static void wave_out_test_device(UINT_PTR device)
...
@@ -948,22 +948,21 @@ static void wave_out_test_device(UINT_PTR device)
"waveOutMessage(%s): failed to get interface size, rc=%s
\n
"
,
"waveOutMessage(%s): failed to get interface size, rc=%s
\n
"
,
dev_name
(
device
),
wave_out_error
(
rc
));
dev_name
(
device
),
wave_out_error
(
rc
));
if
(
rc
==
MMSYSERR_NOERROR
)
{
if
(
rc
==
MMSYSERR_NOERROR
)
{
nameW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
nameW
=
malloc
(
size
);
rc
=
waveOutMessage
((
HWAVEOUT
)
device
,
DRV_QUERYDEVICEINTERFACE
,
rc
=
waveOutMessage
((
HWAVEOUT
)
device
,
DRV_QUERYDEVICEINTERFACE
,
(
DWORD_PTR
)
nameW
,
size
);
(
DWORD_PTR
)
nameW
,
size
);
ok
(
rc
==
MMSYSERR_NOERROR
,
"waveOutMessage(%s): failed to get interface "
ok
(
rc
==
MMSYSERR_NOERROR
,
"waveOutMessage(%s): failed to get interface "
"name, rc=%s
\n
"
,
dev_name
(
device
),
wave_out_error
(
rc
));
"name, rc=%s
\n
"
,
dev_name
(
device
),
wave_out_error
(
rc
));
ok
(
lstrlenW
(
nameW
)
+
1
==
size
/
sizeof
(
WCHAR
),
"got an incorrect size %ld
\n
"
,
size
);
ok
(
lstrlenW
(
nameW
)
+
1
==
size
/
sizeof
(
WCHAR
),
"got an incorrect size %ld
\n
"
,
size
);
if
(
rc
==
MMSYSERR_NOERROR
)
{
if
(
rc
==
MMSYSERR_NOERROR
)
{
nameA
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
/
sizeof
(
WCHAR
));
nameA
=
malloc
(
size
/
sizeof
(
WCHAR
));
WideCharToMultiByte
(
CP_ACP
,
0
,
nameW
,
size
/
sizeof
(
WCHAR
),
nameA
,
WideCharToMultiByte
(
CP_ACP
,
0
,
nameW
,
size
/
sizeof
(
WCHAR
),
nameA
,
size
/
sizeof
(
WCHAR
),
NULL
,
NULL
);
size
/
sizeof
(
WCHAR
),
NULL
,
NULL
);
}
}
HeapFree
(
GetProcessHeap
(),
0
,
nameW
);
free
(
nameW
);
}
}
else
if
(
rc
==
MMSYSERR_NOTSUPPORTED
)
{
else
if
(
rc
==
MMSYSERR_NOTSUPPORTED
)
{
nameA
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
"not supported"
));
nameA
=
strdup
(
"not supported"
);
strcpy
(
nameA
,
"not supported"
);
}
}
rc
=
waveOutGetDevCapsA
(
device
,
&
capsA
,
sizeof
(
capsA
));
rc
=
waveOutGetDevCapsA
(
device
,
&
capsA
,
sizeof
(
capsA
));
...
@@ -972,7 +971,7 @@ static void wave_out_test_device(UINT_PTR device)
...
@@ -972,7 +971,7 @@ static void wave_out_test_device(UINT_PTR device)
dev_name
(
device
),
wave_out_error
(
rc
));
dev_name
(
device
),
wave_out_error
(
rc
));
if
(
rc
!=
MMSYSERR_NOERROR
)
if
(
rc
!=
MMSYSERR_NOERROR
)
{
{
HeapFree
(
GetProcessHeap
(),
0
,
nameA
);
free
(
nameA
);
return
;
return
;
}
}
...
@@ -982,7 +981,7 @@ static void wave_out_test_device(UINT_PTR device)
...
@@ -982,7 +981,7 @@ static void wave_out_test_device(UINT_PTR device)
trace
(
" channels=%d formats=%05lx support=%04lx
\n
"
,
trace
(
" channels=%d formats=%05lx support=%04lx
\n
"
,
capsA
.
wChannels
,
capsA
.
dwFormats
,
capsA
.
dwSupport
);
capsA
.
wChannels
,
capsA
.
dwFormats
,
capsA
.
dwSupport
);
trace
(
" %s
\n
"
,
wave_out_caps
(
capsA
.
dwSupport
));
trace
(
" %s
\n
"
,
wave_out_caps
(
capsA
.
dwSupport
));
HeapFree
(
GetProcessHeap
(),
0
,
nameA
);
free
(
nameA
);
if
(
winetest_interactive
&&
(
device
!=
WAVE_MAPPER
))
if
(
winetest_interactive
&&
(
device
!=
WAVE_MAPPER
))
{
{
...
@@ -1622,7 +1621,7 @@ static void test_fragmentsize(void)
...
@@ -1622,7 +1621,7 @@ static void test_fragmentsize(void)
rc
=
waveOutClose
(
wout
);
rc
=
waveOutClose
(
wout
);
ok
(
rc
==
MMSYSERR_NOERROR
,
"waveOutClose failed: %s
\n
"
,
wave_out_error
(
rc
));
ok
(
rc
==
MMSYSERR_NOERROR
,
"waveOutClose failed: %s
\n
"
,
wave_out_error
(
rc
));
HeapFree
(
GetProcessHeap
(),
0
,
hdr
[
0
].
lpData
);
free
(
hdr
[
0
].
lpData
);
CloseHandle
(
hevent
);
CloseHandle
(
hevent
);
}
}
...
@@ -1723,7 +1722,7 @@ static void test_reentrant_callback(void)
...
@@ -1723,7 +1722,7 @@ static void test_reentrant_callback(void)
rc
=
waveOutClose
(
wout
);
rc
=
waveOutClose
(
wout
);
ok
(
rc
==
MMSYSERR_NOERROR
,
"waveOutClose failed: %s
\n
"
,
wave_out_error
(
rc
));
ok
(
rc
==
MMSYSERR_NOERROR
,
"waveOutClose failed: %s
\n
"
,
wave_out_error
(
rc
));
HeapFree
(
GetProcessHeap
(),
0
,
hdr
[
0
].
lpData
);
free
(
hdr
[
0
].
lpData
);
CloseHandle
(
hevent
);
CloseHandle
(
hevent
);
}
}
...
@@ -1770,7 +1769,7 @@ static void create_wav_file(char *temp_file)
...
@@ -1770,7 +1769,7 @@ static void create_wav_file(char *temp_file)
ok
(
written
==
length
,
"mmioWrite failed, got %ld
\n
"
,
written
);
ok
(
written
==
length
,
"mmioWrite failed, got %ld
\n
"
,
written
);
rc
=
mmioAscend
(
h
,
&
chunk
,
0
);
rc
=
mmioAscend
(
h
,
&
chunk
,
0
);
ok
(
rc
==
MMSYSERR_NOERROR
,
"mmioAscend failed, got %d
\n
"
,
rc
);
ok
(
rc
==
MMSYSERR_NOERROR
,
"mmioAscend failed, got %d
\n
"
,
rc
);
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
free
(
buffer
);
rc
=
mmioAscend
(
h
,
&
riff_chunk
,
0
);
rc
=
mmioAscend
(
h
,
&
riff_chunk
,
0
);
ok
(
rc
==
MMSYSERR_NOERROR
,
"mmioAscend failed, got %d
\n
"
,
rc
);
ok
(
rc
==
MMSYSERR_NOERROR
,
"mmioAscend failed, got %d
\n
"
,
rc
);
...
...
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