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
22055590
Commit
22055590
authored
Oct 05, 2010
by
Jörg Höhle
Committed by
Alexandre Julliard
Nov 02, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winmm: MCI_INFO doesn't change the output buffer in case of error.
parent
a9f9b34e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
40 deletions
+43
-40
info.c
dlls/mciavi32/info.c
+4
-9
mcicda.c
dlls/mcicda/mcicda.c
+8
-11
mcimidi.c
dlls/mciseq/mcimidi.c
+7
-9
mciwave.c
dlls/mciwave/mciwave.c
+10
-11
mci.c
dlls/winmm/tests/mci.c
+14
-0
No files found.
dlls/mciavi32/info.c
View file @
22055590
...
...
@@ -211,16 +211,11 @@ DWORD MCIAVI_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_DGV_INFO_PARMSW lpParms)
WARN
(
"Don't know this info command (%u)
\n
"
,
dwFlags
);
ret
=
MCIERR_UNRECOGNIZED_COMMAND
;
}
if
(
str
)
{
if
(
strlenW
(
str
)
+
1
>
lpParms
->
dwRetSize
)
{
ret
=
MCIERR_PARAM_OVERFLOW
;
}
else
{
lstrcpynW
(
lpParms
->
lpstrReturn
,
str
,
lpParms
->
dwRetSize
);
}
}
else
{
lpParms
->
lpstrReturn
[
0
]
=
0
;
if
(
!
ret
)
{
WCHAR
zero
=
0
;
/* Only mciwave, mciseq and mcicda set dwRetSize (since NT). */
lstrcpynW
(
lpParms
->
lpstrReturn
,
str
?
str
:
&
zero
,
lpParms
->
dwRetSize
);
}
LeaveCriticalSection
(
&
wma
->
cs
);
return
ret
;
}
...
...
dlls/mcicda/mcicda.c
View file @
22055590
...
...
@@ -650,18 +650,15 @@ static DWORD MCICDA_Info(UINT wDevID, DWORD dwFlags, LPMCI_INFO_PARMSW lpParms)
WARN
(
"Don't know this info command (%u)
\n
"
,
dwFlags
);
ret
=
MCIERR_MISSING_PARAMETER
;
}
if
(
str
)
{
if
(
lpParms
->
dwRetSize
<=
strlenW
(
str
))
{
lstrcpynW
(
lpParms
->
lpstrReturn
,
str
,
lpParms
->
dwRetSize
-
1
);
ret
=
MCIERR_PARAM_OVERFLOW
;
}
else
{
strcpyW
(
lpParms
->
lpstrReturn
,
str
);
}
}
else
{
*
lpParms
->
lpstrReturn
=
0
;
if
(
!
ret
)
{
TRACE
(
"=> %s
\n
"
,
debugstr_w
(
str
));
if
(
lpParms
->
dwRetSize
)
{
WCHAR
zero
=
0
;
/* FIXME? Since NT, mciwave, mciseq and mcicda set dwRetSize
* to the number of characters written, excluding \0. */
lstrcpynW
(
lpParms
->
lpstrReturn
,
str
?
str
:
&
zero
,
lpParms
->
dwRetSize
);
}
else
ret
=
MCIERR_PARAM_OVERFLOW
;
}
TRACE
(
"=> %s (%d)
\n
"
,
debugstr_w
(
lpParms
->
lpstrReturn
),
ret
);
if
(
MMSYSERR_NOERROR
==
ret
&&
(
dwFlags
&
MCI_NOTIFY
))
MCICDA_Notify
(
lpParms
->
dwCallback
,
wmcda
,
MCI_NOTIFY_SUCCESSFUL
);
return
ret
;
...
...
dlls/mciseq/mcimidi.c
View file @
22055590
...
...
@@ -1600,15 +1600,13 @@ static DWORD MIDI_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_INFO_PARMSW lpParms)
WARN
(
"Don't know this info command (%u)
\n
"
,
dwFlags
);
return
MCIERR_UNRECOGNIZED_COMMAND
;
}
if
(
str
)
{
if
(
lpParms
->
dwRetSize
<=
strlenW
(
str
))
{
lstrcpynW
(
lpParms
->
lpstrReturn
,
str
,
lpParms
->
dwRetSize
-
1
);
ret
=
MCIERR_PARAM_OVERFLOW
;
}
else
{
strcpyW
(
lpParms
->
lpstrReturn
,
str
);
}
}
else
{
*
lpParms
->
lpstrReturn
=
0
;
if
(
!
ret
)
{
if
(
lpParms
->
dwRetSize
)
{
WCHAR
zero
=
0
;
/* FIXME? Since NT, mciwave, mciseq and mcicda set dwRetSize
* to the number of characters written, excluding \0. */
lstrcpynW
(
lpParms
->
lpstrReturn
,
str
?
str
:
&
zero
,
lpParms
->
dwRetSize
);
}
else
ret
=
MCIERR_PARAM_OVERFLOW
;
}
return
ret
;
}
...
...
dlls/mciwave/mciwave.c
View file @
22055590
...
...
@@ -1665,6 +1665,8 @@ static DWORD WAVE_mciInfo(MCIDEVICEID wDevID, DWORD dwFlags, LPMCI_INFO_PARMSW l
if
(
!
lpParms
||
!
lpParms
->
lpstrReturn
)
return
MCIERR_NULL_PARAMETER_BLOCK
;
TRACE
(
"buf=%p, len=%u
\n
"
,
lpParms
->
lpstrReturn
,
lpParms
->
dwRetSize
);
if
(
wmw
==
NULL
)
{
ret
=
MCIERR_INVALID_DEVICE_ID
;
}
else
{
...
...
@@ -1672,8 +1674,6 @@ static DWORD WAVE_mciInfo(MCIDEVICEID wDevID, DWORD dwFlags, LPMCI_INFO_PARMSW l
static
const
WCHAR
wszWaveIn
[]
=
{
'W'
,
'i'
,
'n'
,
'e'
,
' '
,
'W'
,
'a'
,
'v'
,
'e'
,
' '
,
'I'
,
'n'
,
0
};
static
const
WCHAR
wszWaveOut
[]
=
{
'W'
,
'i'
,
'n'
,
'e'
,
' '
,
'W'
,
'a'
,
'v'
,
'e'
,
' '
,
'O'
,
'u'
,
't'
,
0
};
TRACE
(
"buf=%p, len=%u
\n
"
,
lpParms
->
lpstrReturn
,
lpParms
->
dwRetSize
);
switch
(
dwFlags
&
~
(
MCI_WAIT
|
MCI_NOTIFY
))
{
case
MCI_INFO_PRODUCT
:
str
=
wszAudio
;
break
;
case
MCI_INFO_FILE
:
str
=
wmw
->
lpFileName
;
break
;
...
...
@@ -1681,17 +1681,16 @@ static DWORD WAVE_mciInfo(MCIDEVICEID wDevID, DWORD dwFlags, LPMCI_INFO_PARMSW l
case
MCI_WAVE_OUTPUT
:
str
=
wszWaveOut
;
break
;
default:
WARN
(
"Don't know this info command (%u)
\n
"
,
dwFlags
);
ret
=
MCIERR_UNRECOGNIZED_
COMMAN
D
;
ret
=
MCIERR_UNRECOGNIZED_
KEYWOR
D
;
}
}
if
(
str
)
{
if
(
strlenW
(
str
)
+
1
>
lpParms
->
dwRetSize
)
{
ret
=
MCIERR_PARAM_OVERFLOW
;
}
else
{
lstrcpynW
(
lpParms
->
lpstrReturn
,
str
,
lpParms
->
dwRetSize
);
}
}
else
{
lpParms
->
lpstrReturn
[
0
]
=
0
;
if
(
!
ret
)
{
if
(
lpParms
->
dwRetSize
)
{
WCHAR
zero
=
0
;
/* FIXME? Since NT, mciwave, mciseq and mcicda set dwRetSize
* to the number of characters written, excluding \0. */
lstrcpynW
(
lpParms
->
lpstrReturn
,
str
?
str
:
&
zero
,
lpParms
->
dwRetSize
);
}
else
ret
=
MCIERR_PARAM_OVERFLOW
;
}
if
(
MMSYSERR_NOERROR
==
ret
&&
(
dwFlags
&
MCI_NOTIFY
))
WAVE_mciNotify
(
lpParms
->
dwCallback
,
wmw
,
MCI_NOTIFY_SUCCESSFUL
);
...
...
dlls/winmm/tests/mci.c
View file @
22055590
...
...
@@ -30,6 +30,7 @@
static
MCIERROR
ok_saved
=
MCIERR_FILE_NOT_FOUND
;
typedef
union
{
MCI_INFO_PARMS
info
;
MCI_STATUS_PARMS
status
;
MCI_WAVE_SET_PARMS
set
;
MCI_WAVE_OPEN_PARMS
open
;
...
...
@@ -486,6 +487,19 @@ static void test_openCloseWAVE(HWND hwnd)
ok
(
err
==
MCIERR_INVALID_DEVICE_NAME
||
broken
(
err
==
MMSYSERR_NOTSUPPORTED
/* Win9x */
),
"mciCommand MCI_SYSINFO nodev installname: %s
\n
"
,
dbg_mcierr
(
err
));
ok
(
!
strcmp
(
buf
,
"K"
),
"output buffer %s
\n
"
,
buf
);
buf
[
1
]
=
'L'
;
parm
.
info
.
lpstrReturn
=
buf
;
parm
.
info
.
dwRetSize
=
2
;
err
=
mciSendCommand
(
1
,
MCI_INFO
,
MCI_INFO_PRODUCT
,
(
DWORD_PTR
)
&
parm
);
ok
(
!
err
,
"mciCommand MCI_INFO product: %s
\n
"
,
dbg_mcierr
(
err
));
ok
(
buf
[
0
]
&&
!
buf
[
1
],
"info product output buffer %s
\n
"
,
buf
);
buf
[
0
]
=
'K'
;
parm
.
info
.
dwRetSize
=
sizeof
(
buf
);
err
=
mciSendCommandW
(
1
,
MCI_INFO
,
0x07000000
,
(
DWORD_PTR
)
&
parm
);
ok
(
err
==
MCIERR_UNRECOGNIZED_KEYWORD
,
"mciCommand MCI_INFO other: %s
\n
"
,
dbg_mcierr
(
err
));
ok
(
!
strcmp
(
buf
,
"K"
),
"info output buffer %s
\n
"
,
buf
);
err
=
mciGetDeviceID
(
"all"
);
ok
(
MCI_ALL_DEVICE_ID
==
err
||
/* Win9x */
(
WORD
)
MCI_ALL_DEVICE_ID
==
err
,
"mciGetDeviceID all returned %u, expected %d
\n
"
,
err
,
MCI_ALL_DEVICE_ID
);
...
...
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