Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
644f5393
Commit
644f5393
authored
Feb 20, 2011
by
Jörg Höhle
Committed by
Alexandre Julliard
Jan 27, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winmm: Parse MCI colon notation as in T:MM:SS:F.
parent
7705ad45
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
18 deletions
+66
-18
mci.c
dlls/winmm/mci.c
+36
-13
mci.c
dlls/winmm/tests/mci.c
+29
-4
mcicda.c
dlls/winmm/tests/mcicda.c
+1
-1
No files found.
dlls/winmm/mci.c
View file @
644f5393
...
...
@@ -974,23 +974,47 @@ static WORD MCI_GetMessage(LPCWSTR lpCmd)
/**************************************************************************
* MCI_GetDWord [internal]
*
* Accept 0 -1 255 255:0 255:255:255:255 :::1 1::: 2::3 ::4: 12345678
* Refuse -1:0 0:-1 :: 256:0 1:256 0::::1
*/
static
BOOL
MCI_GetDWord
(
DWORD
*
data
,
LPWSTR
*
ptr
)
{
DWORD
val
;
LPWSTR
ret
;
val
=
strtoulW
(
*
ptr
,
&
ret
,
10
);
LPWSTR
ret
=
*
ptr
;
DWORD
total
=
0
,
shift
=
0
;
BOOL
sign
=
FALSE
,
digits
=
FALSE
;
while
(
*
ret
==
' '
||
*
ret
==
'\t'
)
ret
++
;
if
(
*
ret
==
'-'
)
{
ret
++
;
sign
=
TRUE
;
}
for
(;;)
{
DWORD
val
=
0
;
while
(
'0'
<=
*
ret
&&
*
ret
<=
'9'
)
{
val
=
*
ret
++
-
'0'
+
10
*
val
;
digits
=
TRUE
;
}
switch
(
*
ret
)
{
case
'\0'
:
break
;
case
'\t'
:
case
' '
:
ret
++
;
break
;
default:
return
FALSE
;
case
':'
:
if
((
val
>=
256
)
||
(
shift
>=
24
))
return
FALSE
;
total
|=
val
<<
shift
;
shift
+=
8
;
ret
++
;
continue
;
}
switch
(
*
ret
)
{
case
'\0'
:
break
;
case
' '
:
ret
++
;
break
;
default:
return
FALSE
;
if
(
!
digits
)
return
FALSE
;
if
(
shift
&&
(
val
>=
256
||
sign
))
return
FALSE
;
total
|=
val
<<
shift
;
*
data
=
sign
?
-
total
:
total
;
*
ptr
=
ret
;
return
TRUE
;
}
*
data
|=
val
;
*
ptr
=
ret
;
return
TRUE
;
}
/**************************************************************************
...
...
@@ -1116,7 +1140,6 @@ static DWORD MCI_ParseOptArgs(DWORD* data, int _offset, LPCWSTR lpCmd,
!
MCI_GetDWord
(
&
(
data
[
offset
+
1
]),
&
args
)
||
!
MCI_GetDWord
(
&
(
data
[
offset
+
2
]),
&
args
)
||
!
MCI_GetDWord
(
&
(
data
[
offset
+
3
]),
&
args
))
{
ERR
(
"Bad rect %s
\n
"
,
debugstr_w
(
args
));
return
MCIERR_BAD_INTEGER
;
}
TRACE
(
"flag=%08x for rectangle
\n
"
,
flg
);
...
...
dlls/winmm/tests/mci.c
View file @
644f5393
...
...
@@ -241,7 +241,7 @@ static void test_mciParser(HWND hwnd)
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
));
ok
(
err
==
MCIERR_BAD_INTEGER
,
"status waveaudio no track: %s
\n
"
,
dbg_mcierr
(
err
));
err
=
mciSendString
(
"status x track 3"
,
buf
,
sizeof
(
buf
),
NULL
);
ok
(
err
==
MCIERR_MISSING_PARAMETER
,
"status waveaudio track 3: %s
\n
"
,
dbg_mcierr
(
err
));
...
...
@@ -273,6 +273,21 @@ static void test_mciParser(HWND hwnd)
err
=
mciSendString
(
"status x nsa"
,
buf
,
sizeof
(
buf
),
hwnd
);
todo_wine
ok
(
err
==
MCIERR_BAD_CONSTANT
,
"status nsa: %s
\n
"
,
dbg_mcierr
(
err
));
err
=
mciSendString
(
"seek x to 0:0:0:0:0"
,
buf
,
sizeof
(
buf
),
NULL
);
ok
(
err
==
MCIERR_BAD_INTEGER
,
"seek to 0:0:0:0:0 returned %s
\n
"
,
dbg_mcierr
(
err
));
err
=
mciSendString
(
"seek x to 0:0:0:0:"
,
buf
,
sizeof
(
buf
),
NULL
);
ok
(
err
==
MCIERR_BAD_INTEGER
,
"seek to 0:0:0:0: returned %s
\n
"
,
dbg_mcierr
(
err
));
err
=
mciSendString
(
"seek x to :0:0:0:0"
,
buf
,
sizeof
(
buf
),
NULL
);
ok
(
err
==
MCIERR_BAD_INTEGER
,
"seek to :0:0:0:0 returned %s
\n
"
,
dbg_mcierr
(
err
));
err
=
mciSendString
(
"seek x to 256:0:0:0"
,
buf
,
sizeof
(
buf
),
NULL
);
ok
(
err
==
MCIERR_BAD_INTEGER
,
"seek to 256:0:0:0 returned %s
\n
"
,
dbg_mcierr
(
err
));
err
=
mciSendString
(
"seek x to 0:256"
,
buf
,
sizeof
(
buf
),
NULL
);
ok
(
err
==
MCIERR_BAD_INTEGER
,
"seek to 0:256 returned %s
\n
"
,
dbg_mcierr
(
err
));
err
=
mciSendString
(
"status all time format"
,
buf
,
sizeof
(
buf
),
hwnd
);
ok
(
err
==
MCIERR_CANNOT_USE_ALL
,
"status all: %s
\n
"
,
dbg_mcierr
(
err
));
...
...
@@ -296,7 +311,7 @@ static void test_mciParser(HWND hwnd)
if
(
!
err
)
ok
(
!
strcmp
(
buf
,
"1"
),
"sysinfo digitalvideo quantity open returned %s
\n
"
,
buf
);
err
=
mciSendString
(
"put a window at 0 0"
,
buf
,
sizeof
(
buf
),
NULL
);
todo_wine
ok
(
err
==
MCIERR_BAD_INTEGER
,
"put incomplete rect: %s
\n
"
,
dbg_mcierr
(
err
));
ok
(
err
==
MCIERR_BAD_INTEGER
,
"put incomplete rect: %s
\n
"
,
dbg_mcierr
(
err
));
/*w9X-w2k report code from device last opened, newer versions compare them all
* and return the one error code or MCIERR_MULTIPLE if they differ. */
...
...
@@ -844,8 +859,8 @@ static void test_playWAVE(HWND hwnd)
/* No notification (checked below) sent if error */
/* A second play caused Wine<1.1.33 to hang */
err
=
mciSendString
(
"play mysound from 500 to
150
0 wait"
,
NULL
,
0
,
NULL
);
ok
(
!
err
,
"mci play from 500 to
1500
returned %s
\n
"
,
dbg_mcierr
(
err
));
err
=
mciSendString
(
"play mysound from 500 to
220:5:
0 wait"
,
NULL
,
0
,
NULL
);
ok
(
!
err
,
"mci play from 500 to
220:5:0 (=1500)
returned %s
\n
"
,
dbg_mcierr
(
err
));
err
=
mciSendString
(
"status mysound position"
,
buf
,
sizeof
(
buf
),
hwnd
);
ok
(
!
err
,
"mci status position returned %s
\n
"
,
dbg_mcierr
(
err
));
...
...
@@ -880,6 +895,16 @@ static void test_playWAVE(HWND hwnd)
err
=
mciSendString
(
"seek mysound to 0xfa"
,
NULL
,
0
,
NULL
);
ok
(
err
==
MCIERR_BAD_INTEGER
,
"mci seek to 0xfa returned %s
\n
"
,
dbg_mcierr
(
err
));
/* MCI_INTEGER always accepts colon notation */
err
=
mciSendString
(
"seek mysound to :1"
,
NULL
,
0
,
NULL
);
ok
(
!
err
,
"mci seek to :1 (=256) returned %s
\n
"
,
dbg_mcierr
(
err
));
err
=
mciSendString
(
"seek mysound to 250::"
,
NULL
,
0
,
NULL
);
ok
(
!
err
,
"mci seek to 250:: returned %s
\n
"
,
dbg_mcierr
(
err
));
err
=
mciSendString
(
"seek mysound to 250:0"
,
NULL
,
0
,
NULL
);
ok
(
!
err
,
"mci seek to 250:0 returned %s
\n
"
,
dbg_mcierr
(
err
));
err
=
mciSendString
(
"status mysound position notify"
,
buf
,
sizeof
(
buf
),
hwnd
);
ok
(
!
err
,
"mci status position notify returned %s
\n
"
,
dbg_mcierr
(
err
));
if
(
!
err
)
ok
(
!
strcmp
(
buf
,
"250"
),
"mci status position: %s
\n
"
,
buf
);
...
...
dlls/winmm/tests/mcicda.c
View file @
644f5393
...
...
@@ -250,7 +250,7 @@ static void test_play(HWND hwnd)
test_notification
(
hwnd
,
"status 2flags"
,
err
?
0
:
MCI_NOTIFY_SUCCESSFUL
);
err
=
mciSendString
(
"play c from 00:02:00 to 00:01:00 notify"
,
buf
,
sizeof
(
buf
),
hwnd
);
todo_wine
ok
(
err
==
MCIERR_OUTOFRANGE
,
"play 2s to 1s: %s
\n
"
,
dbg_mcierr
(
err
));
ok
(
err
==
MCIERR_OUTOFRANGE
,
"play 2s to 1s: %s
\n
"
,
dbg_mcierr
(
err
));
test_notification
(
hwnd
,
"play 2s to 1s"
,
err
?
0
:
MCI_NOTIFY_SUCCESSFUL
);
err
=
mciSendString
(
"resume c"
,
buf
,
sizeof
(
buf
),
hwnd
);
...
...
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