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
88a8d211
Commit
88a8d211
authored
Sep 21, 2010
by
Jörg Höhle
Committed by
Alexandre Julliard
Nov 02, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winmm: mciSendString always returns a response string (albeit empty).
parent
e5e150a4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
mci.c
dlls/winmm/mci.c
+5
-3
mci.c
dlls/winmm/tests/mci.c
+11
-0
No files found.
dlls/winmm/mci.c
View file @
88a8d211
...
...
@@ -1535,8 +1535,10 @@ DWORD WINAPI mciSendStringW(LPCWSTR lpstrCommand, LPWSTR lpstrRet,
dwRet
=
MCI_SendCommand
(
wmd
?
wmd
->
wDeviceID
:
uDevID
,
wMsg
,
dwFlags
,
(
DWORD_PTR
)
&
data
);
}
TRACE
(
"=> 1/ %x (%s)
\n
"
,
dwRet
,
debugstr_w
(
lpstrRet
));
dwRet
=
MCI_HandleReturnValues
(
dwRet
,
wmd
,
retType
,
&
data
.
generic
,
lpstrRet
,
uRetLen
);
TRACE
(
"=> 2/ %x (%s)
\n
"
,
dwRet
,
debugstr_w
(
lpstrRet
));
if
(
!
LOWORD
(
dwRet
))
{
dwRet
=
MCI_HandleReturnValues
(
dwRet
,
wmd
,
retType
,
&
data
.
generic
,
lpstrRet
,
uRetLen
);
TRACE
(
"=> 2/ %x (%s)
\n
"
,
dwRet
,
debugstr_w
(
lpstrRet
));
}
errCleanUp:
if
(
auto_open
)
{
...
...
@@ -1569,9 +1571,9 @@ DWORD WINAPI mciSendStringA(LPCSTR lpstrCommand, LPSTR lpstrRet,
MultiByteToWideChar
(
CP_ACP
,
0
,
lpstrCommand
,
-
1
,
lpwstrCommand
,
len
);
if
(
lpstrRet
)
{
if
(
uRetLen
)
*
lpstrRet
=
'\0'
;
/* NT-w2k3 use memset(lpstrRet, 0, uRetLen); */
lpwstrRet
=
HeapAlloc
(
GetProcessHeap
(),
0
,
uRetLen
*
sizeof
(
WCHAR
));
if
(
!
lpwstrRet
)
{
WARN
(
"no memory
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
lpwstrCommand
);
return
MCIERR_OUT_OF_MEMORY
;
}
...
...
dlls/winmm/tests/mci.c
View file @
88a8d211
...
...
@@ -189,11 +189,15 @@ static void test_mciParser(HWND hwnd)
err
=
mciSendString
(
"open avivideo alias a"
,
buf
,
sizeof
(
buf
),
hwnd
);
ok
(
!
err
,
"open another: %s
\n
"
,
dbg_mcierr
(
err
));
buf
[
0
]
=
'z'
;
err
=
mciSendString
(
""
,
buf
,
sizeof
(
buf
),
NULL
);
todo_wine
ok
(
err
==
MCIERR_MISSING_COMMAND_STRING
,
"empty string: %s
\n
"
,
dbg_mcierr
(
err
));
ok
(
!
buf
[
0
],
"error buffer %s
\n
"
,
buf
);
buf
[
0
]
=
'd'
;
err
=
mciSendString
(
"open"
,
buf
,
sizeof
(
buf
),
NULL
);
ok
(
err
==
MCIERR_MISSING_DEVICE_NAME
,
"open void: %s
\n
"
,
dbg_mcierr
(
err
));
ok
(
!
buf
[
0
],
"open error buffer %s
\n
"
,
buf
);
err
=
mciSendString
(
"open notify"
,
buf
,
sizeof
(
buf
),
NULL
);
todo_wine
ok
(
err
==
MCIERR_INVALID_DEVICE_NAME
,
"open notify: %s
\n
"
,
dbg_mcierr
(
err
));
...
...
@@ -214,15 +218,19 @@ static void test_mciParser(HWND hwnd)
err
=
mciSendString
(
"status x length position"
,
buf
,
sizeof
(
buf
),
NULL
);
todo_wine
ok
(
err
==
MCIERR_FLAGS_NOT_COMPATIBLE
,
"status length+position: %s
\n
"
,
dbg_mcierr
(
err
));
buf
[
0
]
=
'I'
;
err
=
mciSendString
(
"set x time format milliseconds time format ms"
,
buf
,
sizeof
(
buf
),
NULL
);
todo_wine
ok
(
err
==
MCIERR_FLAGS_NOT_COMPATIBLE
,
"status length+position: %s
\n
"
,
dbg_mcierr
(
err
));
ok
(
!
buf
[
0
],
"set error buffer %s
\n
"
,
buf
);
/* device's response, not a parser test */
err
=
mciSendString
(
"status x"
,
buf
,
sizeof
(
buf
),
NULL
);
todo_wine
ok
(
err
==
MCIERR_MISSING_PARAMETER
,
"status waveaudio nokeyword: %s
\n
"
,
dbg_mcierr
(
err
));
buf
[
0
]
=
'G'
;
err
=
mciSendString
(
"status a"
,
buf
,
sizeof
(
buf
),
NULL
);
todo_wine
ok
(
err
==
MCIERR_UNSUPPORTED_FUNCTION
,
"status avivideo nokeyword: %s
\n
"
,
dbg_mcierr
(
err
));
ok
(
!
buf
[
0
],
"status error buffer %s
\n
"
,
buf
);
err
=
mciSendString
(
"status x track"
,
buf
,
sizeof
(
buf
),
NULL
);
todo_wine
ok
(
err
==
MCIERR_BAD_INTEGER
,
"status waveaudio no track: %s
\n
"
,
dbg_mcierr
(
err
));
...
...
@@ -283,6 +291,7 @@ static void test_mciParser(HWND hwnd)
* and return the one error code or MCIERR_MULTIPLE if they differ. */
err
=
mciSendString
(
"pause all"
,
buf
,
sizeof
(
buf
),
NULL
);
todo_wine
ok
(
err
==
MCIERR_MULTIPLE
||
broken
(
err
==
MCIERR_NONAPPLICABLE_FUNCTION
),
"pause all: %s
\n
"
,
dbg_mcierr
(
err
));
ok
(
!
buf
[
0
],
"pause error buffer %s
\n
"
,
buf
);
/* MCI_STATUS' dwReturn is a DWORD_PTR, others' a plain DWORD. */
parm
.
status
.
dwItem
=
MCI_STATUS_TIME_FORMAT
;
...
...
@@ -448,6 +457,7 @@ static void test_openCloseWAVE(HWND hwnd)
err
=
mciSendString
(
"sysinfo nodev installname"
,
buf
,
sizeof
(
buf
),
hwnd
);
ok
(
err
==
MCIERR_INVALID_DEVICE_NAME
,
"sysinfo nodev installname: %s
\n
"
,
dbg_mcierr
(
err
));
ok
(
!
buf
[
0
],
"sysinfo error buffer %s
\n
"
,
buf
);
err
=
mciGetDeviceID
(
"all"
);
ok
(
MCI_ALL_DEVICE_ID
==
err
||
/* Win9x */
(
UINT16
)
MCI_ALL_DEVICE_ID
==
err
,
"mciGetDeviceID all returned %u, expected %d
\n
"
,
err
,
MCI_ALL_DEVICE_ID
);
...
...
@@ -584,6 +594,7 @@ static void test_recordWAVE(HWND hwnd)
/* Info file fails until named in Open or Save. */
err
=
mciSendString
(
"info x file"
,
buf
,
sizeof
(
buf
),
NULL
);
todo_wine
ok
(
err
==
MCIERR_NONAPPLICABLE_FUNCTION
,
"mci info new file returned %s
\n
"
,
dbg_mcierr
(
err
));
ok
(
!
buf
[
0
],
"info error buffer %s
\n
"
,
buf
);
/* Check the default recording: 8-bits per sample, mono, 11kHz */
err
=
mciSendString
(
"status x samplespersec"
,
buf
,
sizeof
(
buf
),
NULL
);
...
...
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