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
321189aa
Commit
321189aa
authored
May 10, 2004
by
Robert Reif
Committed by
Alexandre Julliard
May 10, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More parameter checking fixes with tests.
parent
426b0236
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
4 deletions
+66
-4
format.c
dlls/msacm/format.c
+17
-1
pcmconverter.c
dlls/msacm/pcmconverter.c
+1
-1
msacm.c
dlls/msacm/tests/msacm.c
+48
-2
No files found.
dlls/msacm/format.c
View file @
321189aa
...
...
@@ -741,6 +741,15 @@ MMRESULT WINAPI acmFormatTagEnumA(HACMDRIVER had, PACMFORMATTAGDETAILSA paftda,
ACMFORMATTAGDETAILSW
aftdw
;
struct
MSACM_FormatTagEnumWtoA_Instance
aftei
;
if
(
!
paftda
)
return
MMSYSERR_INVALPARAM
;
if
(
paftda
->
cbStruct
<
sizeof
(
*
paftda
))
return
MMSYSERR_INVALPARAM
;
if
(
fdwEnum
!=
0
)
return
MMSYSERR_INVALFLAG
;
memset
(
&
aftdw
,
0
,
sizeof
(
aftdw
));
aftdw
.
cbStruct
=
sizeof
(
aftdw
);
aftdw
.
dwFormatTagIndex
=
paftda
->
dwFormatTagIndex
;
...
...
@@ -768,7 +777,14 @@ MMRESULT WINAPI acmFormatTagEnumW(HACMDRIVER had, PACMFORMATTAGDETAILSW paftd,
TRACE
(
"(%p, %p, %p, %ld, %ld)
\n
"
,
had
,
paftd
,
fnCallback
,
dwInstance
,
fdwEnum
);
if
(
paftd
->
cbStruct
<
sizeof
(
*
paftd
))
return
MMSYSERR_INVALPARAM
;
if
(
!
paftd
)
return
MMSYSERR_INVALPARAM
;
if
(
paftd
->
cbStruct
<
sizeof
(
*
paftd
))
return
MMSYSERR_INVALPARAM
;
if
(
fdwEnum
!=
0
)
return
MMSYSERR_INVALFLAG
;
/* (WS) MSDN info page says that if had != 0, then we should find
* the specific driver to get its tags from. Therefore I'm removing
...
...
dlls/msacm/pcmconverter.c
View file @
321189aa
...
...
@@ -960,7 +960,7 @@ static LRESULT PCM_FormatSuggest(PACMDRVFORMATSUGGEST adfs)
if
(
adfs
->
pwfxSrc
->
wFormatTag
!=
WAVE_FORMAT_PCM
)
{
WARN
(
"not possible
\n
"
);
return
ACMERR_NOTPOSSIBLE
;
}
}
adfs
->
pwfxDst
->
wFormatTag
=
adfs
->
pwfxSrc
->
wFormatTag
;
}
/* check if result is ok */
...
...
dlls/msacm/tests/msacm.c
View file @
321189aa
...
...
@@ -31,6 +31,16 @@
#include "mmreg.h"
#include "msacm.h"
static
BOOL
CALLBACK
FormatTagEnumProc
(
HACMDRIVERID
hadid
,
PACMFORMATTAGDETAILS
paftd
,
DWORD
dwInstance
,
DWORD
fdwSupport
)
{
trace
(
" Format 0x%04lx: %s
\n
"
,
paftd
->
dwFormatTag
,
paftd
->
szFormatTag
);
return
TRUE
;
}
static
BOOL
CALLBACK
FormatEnumProc
(
HACMDRIVERID
hadid
,
LPACMFORMATDETAILS
pafd
,
DWORD
dwInstance
,
...
...
@@ -141,8 +151,6 @@ static BOOL CALLBACK DriverEnumProc(HACMDRIVERID hadid,
if
(
rc
==
MMSYSERR_NOERROR
)
{
DWORD
dwSize
;
WAVEFORMATEX
*
pwfx
;
ACMFORMATDETAILS
fd
;
HACMDRIVERID
hid
;
/* try bad pointer */
...
...
@@ -202,6 +210,10 @@ static BOOL CALLBACK DriverEnumProc(HACMDRIVERID hadid,
"acmMetrics(): rc = %08x, should be %08x
\n
"
,
rc
,
MMSYSERR_NOERROR
);
if
(
rc
==
MMSYSERR_NOERROR
)
{
ACMFORMATDETAILS
fd
;
WAVEFORMATEX
*
pwfx
;
ACMFORMATTAGDETAILS
aftd
;
/* try bad pointer */
rc
=
acmFormatEnum
(
had
,
0
,
FormatEnumProc
,
0
,
0
);
ok
(
rc
==
MMSYSERR_INVALPARAM
,
...
...
@@ -241,6 +253,40 @@ static BOOL CALLBACK DriverEnumProc(HACMDRIVERID hadid,
"acmFormatEnum(): rc = %08x, should be %08x
\n
"
,
rc
,
MMSYSERR_NOERROR
);
/* try bad pointer */
rc
=
acmFormatTagEnum
(
had
,
0
,
FormatTagEnumProc
,
0
,
0
);
ok
(
rc
==
MMSYSERR_INVALPARAM
,
"acmFormatTagEnum(): rc = %08x, should be %08x
\n
"
,
rc
,
MMSYSERR_INVALPARAM
);
/* try bad structure size */
ZeroMemory
(
&
aftd
,
sizeof
(
fd
));
rc
=
acmFormatTagEnum
(
had
,
&
aftd
,
FormatTagEnumProc
,
0
,
0
);
ok
(
rc
==
MMSYSERR_INVALPARAM
,
"acmFormatTagEnum(): rc = %08x, should be %08x
\n
"
,
rc
,
MMSYSERR_INVALPARAM
);
aftd
.
cbStruct
=
sizeof
(
aftd
)
-
1
;
rc
=
acmFormatTagEnum
(
had
,
&
aftd
,
FormatTagEnumProc
,
0
,
0
);
ok
(
rc
==
MMSYSERR_INVALPARAM
,
"acmFormatTagEnum(): rc = %08x, should be %08x
\n
"
,
rc
,
MMSYSERR_INVALPARAM
);
aftd
.
cbStruct
=
sizeof
(
aftd
);
aftd
.
dwFormatTag
=
WAVE_FORMAT_UNKNOWN
;
/* try bad flag */
rc
=
acmFormatTagEnum
(
had
,
&
aftd
,
FormatTagEnumProc
,
0
,
1
);
ok
(
rc
==
MMSYSERR_INVALFLAG
,
"acmFormatTagEnum(): rc = %08x, should be %08x
\n
"
,
rc
,
MMSYSERR_INVALFLAG
);
/* try valid parameters */
rc
=
acmFormatTagEnum
(
had
,
&
aftd
,
FormatTagEnumProc
,
0
,
0
);
ok
(
rc
==
MMSYSERR_NOERROR
,
"acmFormatTagEnum(): rc = %08x, should be %08x
\n
"
,
rc
,
MMSYSERR_NOERROR
);
free
(
pwfx
);
/* try invalid handle */
...
...
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