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
5bff616f
Commit
5bff616f
authored
Aug 13, 2010
by
Jörg Höhle
Committed by
Alexandre Julliard
Aug 25, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mcicda: Opens d, d:, d:\, d:\foo since w2k. Only d: is portable.
parent
127af150
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
9 deletions
+49
-9
mcicda.c
dlls/mcicda/mcicda.c
+7
-7
mcicda.c
dlls/winmm/tests/mcicda.c
+42
-2
No files found.
dlls/mcicda/mcicda.c
View file @
5bff616f
...
...
@@ -428,23 +428,23 @@ static DWORD MCICDA_Open(UINT wDevID, DWORD dwFlags, LPMCI_OPEN_PARMSW lpOpenPar
if
(
dwFlags
&
MCI_OPEN_ELEMENT
)
{
if
(
dwFlags
&
MCI_OPEN_ELEMENT_ID
)
{
WARN
(
"MCI_OPEN_ELEMENT_ID %p! Abort
\n
"
,
lpOpenParms
->
lpstrElementName
);
ret
=
MCIERR_
NO_ELEMENT_ALLOWED
;
ret
=
MCIERR_
FLAGS_NOT_COMPATIBLE
;
goto
the_error
;
}
TRACE
(
"MCI_OPEN_ELEMENT element name: %s
\n
"
,
debugstr_w
(
lpOpenParms
->
lpstrElementName
));
if
(
!
isalpha
(
lpOpenParms
->
lpstrElementName
[
0
])
||
lpOpenParms
->
lpstrElementName
[
1
]
!=
':'
||
(
lpOpenParms
->
lpstrElementName
[
2
]
&&
lpOpenParms
->
lpstrElementName
[
2
]
!=
'\\'
))
/* Only the first letter counts since w2k
* Win9x-NT accept only d: and w98SE accepts d:\foobar as well.
* Play d:\Track03.cda plays from the first track, not #3. */
if
(
!
isalpha
(
lpOpenParms
->
lpstrElementName
[
0
]))
{
WARN
(
"MCI_OPEN_ELEMENT unsupported format: %s
\n
"
,
debugstr_w
(
lpOpenParms
->
lpstrElementName
));
ret
=
MCIERR_NO_ELEMENT_ALLOWED
;
ret
=
MCIERR_INVALID_FILE
;
goto
the_error
;
}
drive
=
toupper
(
lpOpenParms
->
lpstrElementName
[
0
]);
root
[
0
]
=
drive
;
root
[
1
]
=
':'
;
root
[
2
]
=
'\\'
;
root
[
3
]
=
'\0'
;
if
(
GetDriveTypeW
(
root
)
!=
DRIVE_CDROM
)
{
ret
=
MCIERR_INVALID_
DEVICE_NAM
E
;
ret
=
MCIERR_INVALID_
FIL
E
;
goto
the_error
;
}
}
...
...
dlls/winmm/tests/mcicda.c
View file @
5bff616f
...
...
@@ -26,6 +26,7 @@
typedef
union
{
MCI_STATUS_PARMS
status
;
MCI_GETDEVCAPS_PARMS
caps
;
MCI_OPEN_PARMS
open
;
MCI_PLAY_PARMS
play
;
MCI_SEEK_PARMS
seek
;
MCI_SAVE_PARMS
save
;
...
...
@@ -151,8 +152,6 @@ static DWORD MSF_Add(DWORD d1, DWORD d2)
return
MCI_MAKE_MSF
(
m
,
s
,
f
);
}
/* TODO test_open "open X: type cdaudio" etc. */
/* TODO demonstrate open X:\ fails on win95 while open X: works. */
/* TODO show that shareable flag is not what Wine implements. */
static
void
test_play
(
HWND
hwnd
)
...
...
@@ -607,6 +606,46 @@ static void test_play(HWND hwnd)
test_notification
(
hwnd
,
"STOP final"
,
0
);
}
static
void
test_openclose
(
HWND
hwnd
)
{
MCIDEVICEID
wDeviceID
;
MCI_PARMS_UNION
parm
;
MCIERROR
err
;
char
drive
[]
=
{
'a'
,
':'
,
'\\'
,
'X'
,
'\0'
};
/* Bug in native since NT: After OPEN "c" without MCI_OPEN_ALIAS fails with
* MCIERR_DEVICE_OPEN, any subsequent OPEN fails with EXTENSION_NOT_FOUND! */
parm
.
open
.
lpstrAlias
=
"x"
;
/* with alias, OPEN "c" behaves normally */
parm
.
open
.
lpstrDeviceType
=
(
LPCSTR
)
MCI_DEVTYPE_CD_AUDIO
;
parm
.
open
.
lpstrElementName
=
drive
;
for
(
;
strlen
(
drive
);
drive
[
strlen
(
drive
)
-
1
]
=
0
)
for
(
drive
[
0
]
=
'a'
;
drive
[
0
]
<=
'z'
;
drive
[
0
]
++
)
{
err
=
mciSendCommand
(
0
,
MCI_OPEN
,
MCI_OPEN_ELEMENT
|
MCI_OPEN_TYPE
|
MCI_OPEN_TYPE_ID
|
MCI_OPEN_SHAREABLE
|
MCI_OPEN_ALIAS
,
(
DWORD_PTR
)
&
parm
);
ok
(
!
err
||
err
==
MCIERR_INVALID_FILE
,
"OPEN %s type: %s
\n
"
,
drive
,
dbg_mcierr
(
err
));
/* open X:\ fails in Win9x/NT. Only open X: works everywhere. */
if
(
!
err
)
{
wDeviceID
=
parm
.
open
.
wDeviceID
;
trace
(
"ok with %s
\n
"
,
drive
);
err
=
mciSendCommand
(
wDeviceID
,
MCI_CLOSE
,
0
,
0
);
ok
(
!
err
,
"mciCommand close returned %s
\n
"
,
dbg_mcierr
(
err
));
}
}
drive
[
0
]
=
'\\'
;
err
=
mciSendCommand
(
0
,
MCI_OPEN
,
MCI_OPEN_ELEMENT
|
MCI_OPEN_TYPE
|
MCI_OPEN_TYPE_ID
|
MCI_OPEN_SHAREABLE
,
(
DWORD_PTR
)
&
parm
);
ok
(
err
==
MCIERR_INVALID_FILE
,
"OPEN %s type: %s
\n
"
,
drive
,
dbg_mcierr
(
err
));
if
(
!
err
)
mciSendCommand
(
parm
.
open
.
wDeviceID
,
MCI_CLOSE
,
0
,
0
);
if
(
0
)
{
parm
.
open
.
lpstrElementName
=
(
LPCSTR
)
0xDEADBEEF
;
err
=
mciSendCommand
(
0
,
MCI_OPEN
,
MCI_OPEN_ELEMENT
|
MCI_OPEN_ELEMENT_ID
|
MCI_OPEN_TYPE
|
MCI_OPEN_TYPE_ID
|
MCI_OPEN_SHAREABLE
,
(
DWORD_PTR
)
&
parm
);
todo_wine
ok
(
err
==
MCIERR_FLAGS_NOT_COMPATIBLE
,
"OPEN elt_ID: %s
\n
"
,
dbg_mcierr
(
err
));
if
(
!
err
)
mciSendCommand
(
parm
.
open
.
wDeviceID
,
MCI_CLOSE
,
0
,
0
);
}
}
START_TEST
(
mcicda
)
{
MCIERROR
err
;
...
...
@@ -615,6 +654,7 @@ START_TEST(mcicda)
0
,
0
,
0
,
NULL
);
test_notification
(
hwnd
,
"-prior to tests-"
,
0
);
test_play
(
hwnd
);
test_openclose
(
hwnd
);
err
=
mciSendCommand
(
MCI_ALL_DEVICE_ID
,
MCI_STOP
,
0
,
0
);
todo_wine
ok
(
!
err
||
broken
(
err
==
MCIERR_HARDWARE
/* blank CD or testbot without CD-ROM */
),
"STOP all returned %s
\n
"
,
dbg_mcierr
(
err
));
...
...
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