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
6fb51fc0
Commit
6fb51fc0
authored
Jul 23, 2004
by
Robert Reif
Committed by
Alexandre Julliard
Jul 23, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test waveInGetDevCapsW.
parent
f3c85028
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
26 deletions
+43
-26
capture.c
dlls/winmm/tests/capture.c
+43
-26
No files found.
dlls/winmm/tests/capture.c
View file @
6fb51fc0
...
...
@@ -149,13 +149,14 @@ static void wave_in_test_deviceIn(int device, LPWAVEFORMATEX pwfx, DWORD format,
static
void
wave_in_test_device
(
int
device
)
{
WAVEINCAPS
caps
;
WAVEINCAPSA
capsA
;
WAVEINCAPSW
capsW
;
WAVEFORMATEX
format
,
oformat
;
HWAVEIN
win
;
MMRESULT
rc
;
UINT
f
;
WCHAR
*
wname
;
CHAR
*
name
;
WCHAR
*
nameW
;
CHAR
*
name
A
;
DWORD
size
;
DWORD
dwPageSize
;
BYTE
*
twoPages
;
...
...
@@ -166,51 +167,67 @@ static void wave_in_test_device(int device)
GetSystemInfo
(
&
sSysInfo
);
dwPageSize
=
sSysInfo
.
dwPageSize
;
rc
=
waveInGetDevCapsA
(
device
,
&
caps
,
sizeof
(
caps
));
rc
=
waveInGetDevCapsA
(
device
,
&
caps
A
,
sizeof
(
capsA
));
ok
(
rc
==
MMSYSERR_NOERROR
||
rc
==
MMSYSERR_BADDEVICEID
||
rc
==
MMSYSERR_NODRIVER
,
"waveInGetDevCapsA: failed to get capabilities of device %s: rc=%s
\n
"
,
dev_name
(
device
),
wave_in_error
(
rc
));
if
(
rc
==
MMSYSERR_BADDEVICEID
||
rc
==
MMSYSERR_NODRIVER
)
return
;
rc
=
waveInGetDevCapsA
(
device
,
0
,
sizeof
(
caps
));
rc
=
waveInGetDevCapsW
(
device
,
&
capsW
,
sizeof
(
capsW
));
ok
(
rc
==
MMSYSERR_NOERROR
||
rc
==
MMSYSERR_NOTSUPPORTED
,
"waveInGetDevCapsW: MMSYSERR_NOERROR or MMSYSERR_NOTSUPPORTED expected, got %s
\n
"
,
wave_in_error
(
rc
));
rc
=
waveInGetDevCapsA
(
device
,
0
,
sizeof
(
capsA
));
ok
(
rc
==
MMSYSERR_INVALPARAM
,
"waveInGetDevCapsA: MMSYSERR_INVALPARAM expected, got %s
\n
"
,
wave_in_error
(
rc
));
rc
=
waveInGetDevCapsW
(
device
,
0
,
sizeof
(
capsW
));
ok
(
rc
==
MMSYSERR_INVALPARAM
||
rc
==
MMSYSERR_NOTSUPPORTED
,
"waveInGetDevCapsW: MMSYSERR_INVALPARAM or MMSYSERR_NOTSUPPORTED expected, got %s
\n
"
,
wave_in_error
(
rc
));
#if 0 /* FIXME: this works on windows but crashes wine */
rc=waveInGetDevCapsA(device,1,sizeof(caps));
rc=waveInGetDevCapsA(device,1,sizeof(caps
A
));
ok(rc==MMSYSERR_INVALPARAM,
"waveInGetDevCapsA: MMSYSERR_INVALPARAM expected, got %s\n",wave_in_error(rc));
rc=waveInGetDevCapsW(device,1,sizeof(capsW));
ok(rc==MMSYSERR_INVALPARAM || rc==MMSYSERR_NOTSUPPORTED,
"waveInGetDevCapsW: MMSYSERR_INVALPARAM or MMSYSERR_NOTSUPPORTED expected, got %s\n",wave_in_error(rc));
#endif
rc
=
waveInGetDevCapsA
(
device
,
&
caps
,
4
);
rc
=
waveInGetDevCapsA
(
device
,
&
caps
A
,
4
);
ok
(
rc
==
MMSYSERR_NOERROR
,
"waveInGetDevCapsA: MMSYSERR_NOERROR expected, got %s
\n
"
,
wave_in_error
(
rc
));
name
=
NULL
;
rc
=
waveInGetDevCapsW
(
device
,
&
capsW
,
4
);
ok
(
rc
==
MMSYSERR_NOERROR
||
rc
==
MMSYSERR_NOTSUPPORTED
,
"waveInGetDevCapsW: MMSYSERR_NOERROR or MMSYSERR_NOTSUPPORTED expected, got %s
\n
"
,
wave_in_error
(
rc
));
nameA
=
NULL
;
rc
=
waveInMessage
((
HWAVEIN
)
device
,
DRV_QUERYDEVICEINTERFACESIZE
,
(
DWORD_PTR
)
&
size
,
0
);
ok
(
rc
==
MMSYSERR_NOERROR
||
rc
==
MMSYSERR_INVALPARAM
||
rc
==
MMSYSERR_NOTSUPPORTED
,
"waveInMessage: failed to get interface size for device: %s rc=%s
\n
"
,
dev_name
(
device
),
wave_in_error
(
rc
));
if
(
rc
==
MMSYSERR_NOERROR
)
{
wname
=
(
WCHAR
*
)
malloc
(
size
);
rc
=
waveInMessage
((
HWAVEIN
)
device
,
DRV_QUERYDEVICEINTERFACE
,
(
DWORD_PTR
)
wname
,
size
);
nameW
=
(
WCHAR
*
)
malloc
(
size
);
rc
=
waveInMessage
((
HWAVEIN
)
device
,
DRV_QUERYDEVICEINTERFACE
,
(
DWORD_PTR
)
nameW
,
size
);
ok
(
rc
==
MMSYSERR_NOERROR
,
"waveInMessage: failed to get interface name for device: %s rc=%s
\n
"
,
dev_name
(
device
),
wave_in_error
(
rc
));
ok
(
lstrlenW
(
wname
)
+
1
==
size
/
sizeof
(
WCHAR
),
"got an incorrect size: %ld instead of %d
\n
"
,
size
,(
lstrlenW
(
wname
)
+
1
)
*
sizeof
(
WCHAR
));
ok
(
lstrlenW
(
nameW
)
+
1
==
size
/
sizeof
(
WCHAR
),
"got an incorrect size: %ld instead of %d
\n
"
,
size
,(
lstrlenW
(
nameW
)
+
1
)
*
sizeof
(
WCHAR
));
if
(
rc
==
MMSYSERR_NOERROR
)
{
name
=
malloc
(
size
/
sizeof
(
WCHAR
));
WideCharToMultiByte
(
CP_ACP
,
0
,
wname
,
size
/
sizeof
(
WCHAR
),
name
,
size
/
sizeof
(
WCHAR
),
NULL
,
NULL
);
name
A
=
malloc
(
size
/
sizeof
(
WCHAR
));
WideCharToMultiByte
(
CP_ACP
,
0
,
nameW
,
size
/
sizeof
(
WCHAR
),
nameA
,
size
/
sizeof
(
WCHAR
),
NULL
,
NULL
);
}
free
(
wname
);
free
(
nameW
);
}
else
if
(
rc
==
MMSYSERR_NOTSUPPORTED
)
{
name
=
strdup
(
"not supported"
);
name
A
=
strdup
(
"not supported"
);
}
trace
(
" %s:
\"
%s
\"
(%s) %d.%d (%d:%d): channels=%d formats=%05lx
\n
"
,
dev_name
(
device
),
caps
.
szPname
,(
name
?
name
:
"failed"
),
caps
.
vDriverVersion
>>
8
,
caps
.
vDriverVersion
&
0xff
,
caps
.
wMid
,
caps
.
wPid
,
caps
.
wChannels
,
caps
.
dwFormats
);
dev_name
(
device
),
caps
A
.
szPname
,(
nameA
?
nameA
:
"failed"
),
capsA
.
vDriverVersion
>>
8
,
caps
A
.
vDriverVersion
&
0xff
,
caps
A
.
wMid
,
capsA
.
wPid
,
caps
A
.
wChannels
,
capsA
.
dwFormats
);
free
(
name
);
free
(
name
A
);
for
(
f
=
0
;
f
<
NB_WIN_FORMATS
;
f
++
)
{
format
.
wFormatTag
=
WAVE_FORMAT_PCM
;
...
...
@@ -220,10 +237,10 @@ static void wave_in_test_device(int device)
format
.
nBlockAlign
=
format
.
nChannels
*
format
.
wBitsPerSample
/
8
;
format
.
nAvgBytesPerSec
=
format
.
nSamplesPerSec
*
format
.
nBlockAlign
;
format
.
cbSize
=
0
;
wave_in_test_deviceIn
(
device
,
&
format
,
win_formats
[
f
][
0
],
0
,
&
caps
);
wave_in_test_deviceIn
(
device
,
&
format
,
win_formats
[
f
][
0
],
WAVE_FORMAT_DIRECT
,
&
caps
);
wave_in_test_deviceIn
(
device
,
&
format
,
win_formats
[
f
][
0
],
0
,
&
caps
A
);
wave_in_test_deviceIn
(
device
,
&
format
,
win_formats
[
f
][
0
],
WAVE_FORMAT_DIRECT
,
&
caps
A
);
if
(
device
!=
WAVE_MAPPER
)
wave_in_test_deviceIn
(
device
,
&
format
,
win_formats
[
f
][
0
],
WAVE_MAPPED
,
&
caps
);
wave_in_test_deviceIn
(
device
,
&
format
,
win_formats
[
f
][
0
],
WAVE_MAPPED
,
&
caps
A
);
}
/* Try a PCMWAVEFORMAT aligned next to an unaccessable page for bounds checking */
...
...
@@ -240,10 +257,10 @@ static void wave_in_test_device(int device)
pwfx
->
nSamplesPerSec
=
22050
;
pwfx
->
nBlockAlign
=
pwfx
->
nChannels
*
pwfx
->
wBitsPerSample
/
8
;
pwfx
->
nAvgBytesPerSec
=
pwfx
->
nSamplesPerSec
*
pwfx
->
nBlockAlign
;
wave_in_test_deviceIn
(
device
,
pwfx
,
WAVE_FORMAT_2M08
,
0
,
&
caps
);
wave_in_test_deviceIn
(
device
,
pwfx
,
WAVE_FORMAT_2M08
,
WAVE_FORMAT_DIRECT
,
&
caps
);
wave_in_test_deviceIn
(
device
,
pwfx
,
WAVE_FORMAT_2M08
,
0
,
&
caps
A
);
wave_in_test_deviceIn
(
device
,
pwfx
,
WAVE_FORMAT_2M08
,
WAVE_FORMAT_DIRECT
,
&
caps
A
);
if
(
device
!=
WAVE_MAPPER
)
wave_in_test_deviceIn
(
device
,
pwfx
,
WAVE_FORMAT_2M08
,
WAVE_MAPPED
,
&
caps
);
wave_in_test_deviceIn
(
device
,
pwfx
,
WAVE_FORMAT_2M08
,
WAVE_MAPPED
,
&
caps
A
);
}
VirtualFree
(
twoPages
,
2
*
dwPageSize
,
MEM_RELEASE
);
}
...
...
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