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
445fc35e
Commit
445fc35e
authored
May 03, 2004
by
Robert Reif
Committed by
Alexandre Julliard
May 03, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better function parameter checking.
parent
2f0a4ac4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
25 deletions
+64
-25
driver.c
dlls/msacm/driver.c
+41
-24
format.c
dlls/msacm/format.c
+11
-1
msacm32_main.c
dlls/msacm/msacm32_main.c
+12
-0
No files found.
dlls/msacm/driver.c
View file @
445fc35e
...
...
@@ -132,29 +132,38 @@ MMRESULT WINAPI acmDriverDetailsA(HACMDRIVERID hadid, PACMDRIVERDETAILSA padd, D
MMRESULT
mmr
;
ACMDRIVERDETAILSW
addw
;
if
(
!
padd
)
return
MMSYSERR_INVALPARAM
;
if
(
padd
->
cbStruct
<
4
)
return
MMSYSERR_INVALPARAM
;
addw
.
cbStruct
=
sizeof
(
addw
);
mmr
=
acmDriverDetailsW
(
hadid
,
&
addw
,
fdwDetails
);
if
(
mmr
==
0
)
{
padd
->
fccType
=
addw
.
fccType
;
padd
->
fccComp
=
addw
.
fccComp
;
padd
->
wMid
=
addw
.
wMid
;
padd
->
wPid
=
addw
.
wPid
;
padd
->
vdwACM
=
addw
.
vdwACM
;
padd
->
vdwDriver
=
addw
.
vdwDriver
;
padd
->
fdwSupport
=
addw
.
fdwSupport
;
padd
->
cFormatTags
=
addw
.
cFormatTags
;
padd
->
cFilterTags
=
addw
.
cFilterTags
;
padd
->
hicon
=
addw
.
hicon
;
WideCharToMultiByte
(
CP_ACP
,
0
,
addw
.
szShortName
,
-
1
,
padd
->
szShortName
,
sizeof
(
padd
->
szShortName
),
NULL
,
NULL
);
WideCharToMultiByte
(
CP_ACP
,
0
,
addw
.
szLongName
,
-
1
,
padd
->
szLongName
,
sizeof
(
padd
->
szLongName
),
NULL
,
NULL
);
WideCharToMultiByte
(
CP_ACP
,
0
,
addw
.
szCopyright
,
-
1
,
padd
->
szCopyright
,
sizeof
(
padd
->
szCopyright
),
NULL
,
NULL
);
WideCharToMultiByte
(
CP_ACP
,
0
,
addw
.
szLicensing
,
-
1
,
padd
->
szLicensing
,
sizeof
(
padd
->
szLicensing
),
NULL
,
NULL
);
WideCharToMultiByte
(
CP_ACP
,
0
,
addw
.
szFeatures
,
-
1
,
padd
->
szFeatures
,
sizeof
(
padd
->
szFeatures
),
NULL
,
NULL
);
ACMDRIVERDETAILSA
padda
;
padda
.
fccType
=
addw
.
fccType
;
padda
.
fccComp
=
addw
.
fccComp
;
padda
.
wMid
=
addw
.
wMid
;
padda
.
wPid
=
addw
.
wPid
;
padda
.
vdwACM
=
addw
.
vdwACM
;
padda
.
vdwDriver
=
addw
.
vdwDriver
;
padda
.
fdwSupport
=
addw
.
fdwSupport
;
padda
.
cFormatTags
=
addw
.
cFormatTags
;
padda
.
cFilterTags
=
addw
.
cFilterTags
;
padda
.
hicon
=
addw
.
hicon
;
WideCharToMultiByte
(
CP_ACP
,
0
,
addw
.
szShortName
,
-
1
,
padda
.
szShortName
,
sizeof
(
padda
.
szShortName
),
NULL
,
NULL
);
WideCharToMultiByte
(
CP_ACP
,
0
,
addw
.
szLongName
,
-
1
,
padda
.
szLongName
,
sizeof
(
padda
.
szLongName
),
NULL
,
NULL
);
WideCharToMultiByte
(
CP_ACP
,
0
,
addw
.
szCopyright
,
-
1
,
padda
.
szCopyright
,
sizeof
(
padda
.
szCopyright
),
NULL
,
NULL
);
WideCharToMultiByte
(
CP_ACP
,
0
,
addw
.
szLicensing
,
-
1
,
padda
.
szLicensing
,
sizeof
(
padda
.
szLicensing
),
NULL
,
NULL
);
WideCharToMultiByte
(
CP_ACP
,
0
,
addw
.
szFeatures
,
-
1
,
padda
.
szFeatures
,
sizeof
(
padda
.
szFeatures
),
NULL
,
NULL
);
memcpy
(
padd
,
&
padda
,
min
(
padd
->
cbStruct
,
sizeof
(
*
padd
)));
}
return
mmr
;
}
...
...
@@ -167,14 +176,22 @@ MMRESULT WINAPI acmDriverDetailsW(HACMDRIVERID hadid, PACMDRIVERDETAILSW padd, D
HACMDRIVER
acmDrvr
;
MMRESULT
mmr
;
if
(
!
padd
)
return
MMSYSERR_INVALPARAM
;
if
(
padd
->
cbStruct
<
4
)
return
MMSYSERR_INVALPARAM
;
if
(
fdwDetails
)
return
MMSYSERR_INVALFLAG
;
mmr
=
acmDriverOpen
(
&
acmDrvr
,
hadid
,
0
);
if
(
mmr
==
MMSYSERR_NOERROR
)
{
mmr
=
(
MMRESULT
)
MSACM_Message
(
acmDrvr
,
ACMDM_DRIVER_DETAILS
,
(
LPARAM
)
padd
,
0
);
ACMDRIVERDETAILSW
paddw
;
mmr
=
(
MMRESULT
)
MSACM_Message
(
acmDrvr
,
ACMDM_DRIVER_DETAILS
,
(
LPARAM
)
&
paddw
,
0
);
acmDriverClose
(
acmDrvr
,
0
);
memcpy
(
padd
,
&
paddw
,
min
(
padd
->
cbStruct
,
sizeof
(
*
padd
)));
}
return
mmr
;
...
...
@@ -216,9 +233,6 @@ MMRESULT WINAPI acmDriverID(HACMOBJ hao, PHACMDRIVERID phadid, DWORD fdwDriverID
{
PWINE_ACMOBJ
pao
;
if
(
!
phadid
)
return
MMSYSERR_INVALPARAM
;
if
(
fdwDriverID
)
return
MMSYSERR_INVALFLAG
;
...
...
@@ -226,6 +240,9 @@ MMRESULT WINAPI acmDriverID(HACMOBJ hao, PHACMDRIVERID phadid, DWORD fdwDriverID
if
(
!
pao
)
return
MMSYSERR_INVALHANDLE
;
if
(
!
phadid
)
return
MMSYSERR_INVALPARAM
;
*
phadid
=
(
HACMDRIVERID
)
pao
->
pACMDriverID
;
return
MMSYSERR_NOERROR
;
...
...
dlls/msacm/format.c
View file @
445fc35e
...
...
@@ -411,6 +411,12 @@ MMRESULT WINAPI acmFormatEnumA(HACMDRIVER had, PACMFORMATDETAILSA pafda,
ACMFORMATDETAILSW
afdw
;
struct
MSACM_FormatEnumWtoA_Instance
afei
;
if
(
!
pafda
)
return
MMSYSERR_INVALPARAM
;
if
(
pafda
->
cbStruct
<
sizeof
(
*
pafda
))
return
MMSYSERR_INVALPARAM
;
memset
(
&
afdw
,
0
,
sizeof
(
afdw
));
afdw
.
cbStruct
=
sizeof
(
afdw
);
afdw
.
dwFormatIndex
=
pafda
->
dwFormatIndex
;
...
...
@@ -489,7 +495,11 @@ MMRESULT WINAPI acmFormatEnumW(HACMDRIVER had, PACMFORMATDETAILSW pafd,
TRACE
(
"(%p, %p, %p, %ld, %ld)
\n
"
,
had
,
pafd
,
fnCallback
,
dwInstance
,
fdwEnum
);
if
(
pafd
->
cbStruct
<
sizeof
(
*
pafd
))
return
MMSYSERR_INVALPARAM
;
if
(
!
pafd
)
return
MMSYSERR_INVALPARAM
;
if
(
pafd
->
cbStruct
<
sizeof
(
*
pafd
))
return
MMSYSERR_INVALPARAM
;
if
(
fdwEnum
&
(
ACM_FORMATENUMF_WFORMATTAG
|
ACM_FORMATENUMF_NCHANNELS
|
ACM_FORMATENUMF_NSAMPLESPERSEC
|
ACM_FORMATENUMF_WBITSPERSAMPLE
|
...
...
dlls/msacm/msacm32_main.c
View file @
445fc35e
...
...
@@ -120,6 +120,7 @@ MMRESULT WINAPI acmMetrics(HACMOBJ hao, UINT uMetric, LPVOID pMetric)
/* fall through */
case
ACM_METRIC_COUNT_LOCAL_DRIVERS
:
if
(
hao
)
return
MMSYSERR_INVALHANDLE
;
if
(
!
pMetric
)
return
MMSYSERR_INVALPARAM
;
for
(
padid
=
MSACM_pFirstACMDriverID
;
padid
;
padid
=
padid
->
pNextACMDriverID
)
if
(
!
(
padid
->
fdwSupport
&
ACMDRIVERDETAILS_SUPPORTF_DISABLED
)
&&
CheckLocal
(
padid
))
val
++
;
...
...
@@ -131,6 +132,7 @@ MMRESULT WINAPI acmMetrics(HACMOBJ hao, UINT uMetric, LPVOID pMetric)
/* fall through */
case
ACM_METRIC_COUNT_LOCAL_CODECS
:
if
(
hao
)
return
MMSYSERR_INVALHANDLE
;
if
(
!
pMetric
)
return
MMSYSERR_INVALPARAM
;
for
(
padid
=
MSACM_pFirstACMDriverID
;
padid
;
padid
=
padid
->
pNextACMDriverID
)
if
(
!
(
padid
->
fdwSupport
&
ACMDRIVERDETAILS_SUPPORTF_DISABLED
)
&&
(
padid
->
fdwSupport
&
ACMDRIVERDETAILS_SUPPORTF_CODEC
)
&&
...
...
@@ -144,6 +146,7 @@ MMRESULT WINAPI acmMetrics(HACMOBJ hao, UINT uMetric, LPVOID pMetric)
/* fall through */
case
ACM_METRIC_COUNT_LOCAL_CONVERTERS
:
if
(
hao
)
return
MMSYSERR_INVALHANDLE
;
if
(
!
pMetric
)
return
MMSYSERR_INVALPARAM
;
for
(
padid
=
MSACM_pFirstACMDriverID
;
padid
;
padid
=
padid
->
pNextACMDriverID
)
if
(
!
(
padid
->
fdwSupport
&
ACMDRIVERDETAILS_SUPPORTF_DISABLED
)
&&
(
padid
->
fdwSupport
&
ACMDRIVERDETAILS_SUPPORTF_CONVERTER
)
&&
...
...
@@ -157,6 +160,7 @@ MMRESULT WINAPI acmMetrics(HACMOBJ hao, UINT uMetric, LPVOID pMetric)
/* fall through */
case
ACM_METRIC_COUNT_LOCAL_FILTERS
:
if
(
hao
)
return
MMSYSERR_INVALHANDLE
;
if
(
!
pMetric
)
return
MMSYSERR_INVALPARAM
;
for
(
padid
=
MSACM_pFirstACMDriverID
;
padid
;
padid
=
padid
->
pNextACMDriverID
)
if
(
!
(
padid
->
fdwSupport
&
ACMDRIVERDETAILS_SUPPORTF_DISABLED
)
&&
(
padid
->
fdwSupport
&
ACMDRIVERDETAILS_SUPPORTF_FILTER
)
&&
...
...
@@ -170,6 +174,7 @@ MMRESULT WINAPI acmMetrics(HACMOBJ hao, UINT uMetric, LPVOID pMetric)
/* fall through */
case
ACM_METRIC_COUNT_LOCAL_DISABLED
:
if
(
hao
)
return
MMSYSERR_INVALHANDLE
;
if
(
!
pMetric
)
return
MMSYSERR_INVALPARAM
;
for
(
padid
=
MSACM_pFirstACMDriverID
;
padid
;
padid
=
padid
->
pNextACMDriverID
)
if
((
padid
->
fdwSupport
&
ACMDRIVERDETAILS_SUPPORTF_DISABLED
)
&&
CheckLocal
(
padid
))
val
++
;
...
...
@@ -204,10 +209,17 @@ MMRESULT WINAPI acmMetrics(HACMOBJ hao, UINT uMetric, LPVOID pMetric)
}
else
{
return
MMSYSERR_INVALHANDLE
;
}
if
(
!
pMetric
)
return
MMSYSERR_INVALPARAM
;
*
(
LPDWORD
)
pMetric
=
val
;
break
;
case
ACM_METRIC_COUNT_HARDWARE
:
if
(
hao
)
return
MMSYSERR_INVALHANDLE
;
if
(
!
pMetric
)
return
MMSYSERR_INVALPARAM
;
*
(
LPDWORD
)
pMetric
=
0
;
FIXME
(
"ACM_METRIC_COUNT_HARDWARE not implemented
\n
"
);
break
;
case
ACM_METRIC_HARDWARE_WAVE_INPUT
:
case
ACM_METRIC_HARDWARE_WAVE_OUTPUT
:
case
ACM_METRIC_MAX_SIZE_FILTER
:
...
...
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