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
f3f49a29
Commit
f3f49a29
authored
Nov 29, 2016
by
Bruno Jesus
Committed by
Alexandre Julliard
Nov 29, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msacm32/tests: Beginnings of a custom driver test.
Signed-off-by:
Bruno Jesus
<
00cpxxx@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1289a860
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
168 additions
and
1 deletion
+168
-1
Makefile.in
dlls/msacm32/tests/Makefile.in
+1
-1
msacm.c
dlls/msacm32/tests/msacm.c
+166
-0
msacmdrv.h
include/msacmdrv.h
+1
-0
No files found.
dlls/msacm32/tests/Makefile.in
View file @
f3f49a29
TESTDLL
=
msacm32.dll
IMPORTS
=
msacm32
IMPORTS
=
msacm32
winmm
C_SRCS
=
\
msacm.c
dlls/msacm32/tests/msacm.c
View file @
f3f49a29
...
...
@@ -31,6 +31,7 @@
#define NOBITMAP
#include "mmreg.h"
#include "msacm.h"
#include "msacmdrv.h"
static
BOOL
CALLBACK
FormatTagEnumProc
(
HACMDRIVERID
hadid
,
PACMFORMATTAGDETAILSA
paftd
,
...
...
@@ -829,9 +830,174 @@ todo_wine
ok
(
rc
==
MMSYSERR_INVALPARAM
,
"failed with error 0x%x
\n
"
,
rc
);
}
static
struct
{
struct
{
int
load
,
free
,
open
,
close
,
enable
,
disable
,
install
,
remove
,
details
,
notify
,
querycfg
,
about
;
}
driver
;
struct
{
int
tag_details
,
details
,
suggest
;
}
format
;
struct
{
int
open
,
close
,
size
,
convert
,
prepare
,
unprepare
,
reset
;
}
stream
;
int
other
;
}
driver_calls
;
LRESULT
CALLBACK
acm_driver_func
(
DWORD_PTR
id
,
HDRVR
handle
,
UINT
msg
,
LPARAM
param1
,
LPARAM
param2
)
{
switch
(
msg
)
{
/* Driver messages */
case
DRV_LOAD
:
driver_calls
.
driver
.
load
++
;
return
1
;
case
DRV_FREE
:
driver_calls
.
driver
.
free
++
;
return
1
;
case
DRV_OPEN
:
driver_calls
.
driver
.
open
++
;
return
1
;
case
DRV_CLOSE
:
driver_calls
.
driver
.
close
++
;
return
1
;
case
DRV_ENABLE
:
driver_calls
.
driver
.
enable
++
;
return
1
;
case
DRV_DISABLE
:
driver_calls
.
driver
.
disable
++
;
return
1
;
case
DRV_QUERYCONFIGURE
:
driver_calls
.
driver
.
querycfg
++
;
return
1
;
case
DRV_INSTALL
:
driver_calls
.
driver
.
install
++
;
return
DRVCNF_RESTART
;
case
DRV_REMOVE
:
driver_calls
.
driver
.
remove
++
;
return
DRVCNF_RESTART
;
case
ACMDM_DRIVER_ABOUT
:
driver_calls
.
driver
.
about
++
;
return
MMSYSERR_NOTSUPPORTED
;
case
ACMDM_DRIVER_DETAILS
:
{
ACMDRIVERDETAILSA
*
ptr
=
(
ACMDRIVERDETAILSA
*
)
param1
;
/* copied from pcmconverter.c */
ptr
->
fccType
=
ACMDRIVERDETAILS_FCCTYPE_AUDIOCODEC
;
ptr
->
fccComp
=
ACMDRIVERDETAILS_FCCCOMP_UNDEFINED
;
ptr
->
wMid
=
MM_MICROSOFT
;
ptr
->
wPid
=
MM_MSFT_ACM_PCM
;
ptr
->
vdwACM
=
0x01000000
;
ptr
->
vdwDriver
=
0x01000000
;
ptr
->
fdwSupport
=
ACMDRIVERDETAILS_SUPPORTF_CONVERTER
;
ptr
->
cFormatTags
=
1
;
ptr
->
cFilterTags
=
0
;
ptr
->
hicon
=
NULL
;
strcpy
(
ptr
->
szShortName
,
"TEST-CODEC"
);
strcpy
(
ptr
->
szLongName
,
"Wine Test Codec"
);
strcpy
(
ptr
->
szCopyright
,
"Brought to you by the Wine team..."
);
strcpy
(
ptr
->
szLicensing
,
"Refer to LICENSE file"
);
ptr
->
szFeatures
[
0
]
=
0
;
driver_calls
.
driver
.
details
++
;
break
;
}
case
ACMDM_DRIVER_NOTIFY
:
driver_calls
.
driver
.
notify
++
;
return
MMSYSERR_NOTSUPPORTED
;
/* Format messages */
case
ACMDM_FORMATTAG_DETAILS
:
driver_calls
.
format
.
tag_details
++
;
break
;
case
ACMDM_FORMAT_DETAILS
:
driver_calls
.
format
.
details
++
;
break
;
case
ACMDM_FORMAT_SUGGEST
:
driver_calls
.
format
.
suggest
++
;
break
;
/* Stream messages */
case
ACMDM_STREAM_OPEN
:
driver_calls
.
stream
.
open
++
;
break
;
case
ACMDM_STREAM_CLOSE
:
driver_calls
.
stream
.
close
++
;
break
;
case
ACMDM_STREAM_SIZE
:
driver_calls
.
stream
.
size
++
;
break
;
case
ACMDM_STREAM_CONVERT
:
driver_calls
.
stream
.
convert
++
;
break
;
case
ACMDM_STREAM_RESET
:
driver_calls
.
stream
.
reset
++
;
return
MMSYSERR_NOTSUPPORTED
;
case
ACMDM_STREAM_PREPARE
:
driver_calls
.
stream
.
prepare
++
;
break
;
case
ACMDM_STREAM_UNPREPARE
:
driver_calls
.
stream
.
unprepare
++
;
break
;
default:
driver_calls
.
other
++
;
return
DefDriverProc
(
id
,
handle
,
msg
,
param1
,
param2
);
}
return
MMSYSERR_NOERROR
;
}
static
void
test_acmDriverAdd
(
void
)
{
MMRESULT
res
;
HACMDRIVERID
drvid
;
union
{
ACMDRIVERDETAILSA
drv_details
;
}
acm
;
/* Driver load steps:
* - acmDriverAdd checks the passed parameters
* - DRV_LOAD message is sent - required
* - DRV_ENABLE message is sent - required
* - DRV_OPEN message is sent - required
* - DRV_DETAILS message is sent - required
* - ACMDM_FORMATTAG_DETAILS message is sent - optional
* - DRV_QUERYCONFIGURE message is sent - optional
* - ACMDM_DRIVER_ABOUT message is sent - optional
*/
res
=
acmDriverAddA
(
&
drvid
,
GetModuleHandleA
(
NULL
),
(
LPARAM
)
acm_driver_func
,
0
,
ACM_DRIVERADDF_FUNCTION
);
ok
(
res
==
MMSYSERR_NOERROR
,
"Expected 0, got %d
\n
"
,
res
);
todo_wine
ok
(
driver_calls
.
driver
.
open
==
1
,
"Expected 1, got %d
\n
"
,
driver_calls
.
driver
.
open
);
ok
(
driver_calls
.
driver
.
details
==
1
,
"Expected 1, got %d
\n
"
,
driver_calls
.
driver
.
details
);
memset
(
&
acm
,
0
,
sizeof
(
acm
));
res
=
acmDriverDetailsA
(
drvid
,
&
acm
.
drv_details
,
0
);
ok
(
res
==
MMSYSERR_INVALPARAM
,
"Expected 11, got %d
\n
"
,
res
);
acm
.
drv_details
.
cbStruct
=
sizeof
(
acm
.
drv_details
);
res
=
acmDriverDetailsA
(
drvid
,
&
acm
.
drv_details
,
0
);
ok
(
res
==
MMSYSERR_NOERROR
,
"Expected 0, got %d
\n
"
,
res
);
todo_wine
ok
(
driver_calls
.
driver
.
open
==
1
,
"Expected 1, got %d
\n
"
,
driver_calls
.
driver
.
open
);
ok
(
driver_calls
.
driver
.
details
==
2
,
"Expected 2, got %d
\n
"
,
driver_calls
.
driver
.
details
);
todo_wine
ok
(
driver_calls
.
driver
.
close
==
0
,
"Expected 0, got %d
\n
"
,
driver_calls
.
driver
.
close
);
}
START_TEST
(
msacm
)
{
driver_tests
();
test_prepareheader
();
test_acmFormatSuggest
();
/* Test acmDriverAdd in the end as it may conflict
* with other tests due to codec lookup order */
test_acmDriverAdd
();
}
include/msacmdrv.h
View file @
f3f49a29
...
...
@@ -44,6 +44,7 @@
#define ACMDM_DRIVER_NOTIFY (ACMDM_BASE + 1)
#define ACMDM_DRIVER_DETAILS (ACMDM_BASE + 10)
#define ACMDM_DRIVER_ABOUT (ACMDM_BASE + 11)
#define ACMDM_HARDWARE_WAVE_CAPS_INPUT (ACMDM_BASE + 20)
#define ACMDM_HARDWARE_WAVE_CAPS_OUTPUT (ACMDM_BASE + 21)
...
...
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