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
ecb02ec9
Commit
ecb02ec9
authored
Aug 23, 2010
by
Jörg Höhle
Committed by
Alexandre Julliard
Aug 25, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mcicda: Access the first CD-ROM unless given a device letter.
parent
5bff616f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
12 deletions
+13
-12
mcicda.c
dlls/mcicda/mcicda.c
+9
-7
mcicda.c
dlls/winmm/tests/mcicda.c
+4
-5
No files found.
dlls/mcicda/mcicda.c
View file @
ecb02ec9
...
...
@@ -161,6 +161,7 @@ static DWORD MCICDA_drvOpen(LPCWSTR str, LPMCI_OPEN_DRIVER_PARMSW modp)
WINE_MCICDAUDIO
*
wmcda
;
if
(
!
modp
)
return
0xFFFFFFFF
;
/* FIXME: MCIERR_CANNOT_LOAD_DRIVER if there's no drive of type CD-ROM */
wmcda
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
WINE_MCICDAUDIO
));
...
...
@@ -400,11 +401,10 @@ static DWORD MCICDA_Stop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms
*/
static
DWORD
MCICDA_Open
(
UINT
wDevID
,
DWORD
dwFlags
,
LPMCI_OPEN_PARMSW
lpOpenParms
)
{
DWOR
D
dwDeviceID
;
DWORD
ret
=
MCIERR_HARDWARE
;
MCIDEVICEI
D
dwDeviceID
;
DWORD
ret
;
WINE_MCICDAUDIO
*
wmcda
=
(
WINE_MCICDAUDIO
*
)
mciGetDriverData
(
wDevID
);
WCHAR
root
[
7
],
drive
=
0
;
unsigned
int
count
;
TRACE
(
"(%04X, %08X, %p);
\n
"
,
wDevID
,
dwFlags
,
lpOpenParms
);
...
...
@@ -450,11 +450,10 @@ static DWORD MCICDA_Open(UINT wDevID, DWORD dwFlags, LPMCI_OPEN_PARMSW lpOpenPar
}
else
{
/* drive letter isn't passed... get the dwDeviceID'th cdrom in the system */
root
[
0
]
=
'A'
;
root
[
1
]
=
':'
;
root
[
2
]
=
'\\'
;
root
[
3
]
=
'\0'
;
for
(
count
=
0
;
root
[
0
]
<=
'Z'
;
root
[
0
]
++
)
for
(
;
root
[
0
]
<=
'Z'
;
root
[
0
]
++
)
{
if
(
GetDriveTypeW
(
root
)
==
DRIVE_CDROM
&&
++
count
>=
dwDeviceID
)
if
(
GetDriveTypeW
(
root
)
==
DRIVE_CDROM
)
{
drive
=
root
[
0
];
break
;
...
...
@@ -462,7 +461,7 @@ static DWORD MCICDA_Open(UINT wDevID, DWORD dwFlags, LPMCI_OPEN_PARMSW lpOpenPar
}
if
(
!
drive
)
{
ret
=
MCIERR_
INVALID_DEVICE_ID
;
ret
=
MCIERR_
CANNOT_LOAD_DRIVER
;
/* drvOpen should return this */
goto
the_error
;
}
}
...
...
@@ -474,7 +473,10 @@ static DWORD MCICDA_Open(UINT wDevID, DWORD dwFlags, LPMCI_OPEN_PARMSW lpOpenPar
root
[
0
]
=
root
[
1
]
=
'\\'
;
root
[
2
]
=
'.'
;
root
[
3
]
=
'\\'
;
root
[
4
]
=
drive
;
root
[
5
]
=
':'
;
root
[
6
]
=
'\0'
;
wmcda
->
handle
=
CreateFileW
(
root
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
0
,
0
);
if
(
wmcda
->
handle
==
INVALID_HANDLE_VALUE
)
{
ret
=
MCIERR_MUST_USE_SHAREABLE
;
goto
the_error
;
}
if
(
dwFlags
&
MCI_NOTIFY
)
{
mciDriverNotify
(
HWND_32
(
LOWORD
(
lpOpenParms
->
dwCallback
)),
...
...
dlls/winmm/tests/mcicda.c
View file @
ecb02ec9
...
...
@@ -166,13 +166,12 @@ static void test_play(HWND hwnd)
parm
.
gen
.
dwCallback
=
(
DWORD_PTR
)
hwnd
;
/* once to rule them all */
err
=
mciSendString
(
"open cdaudio alias c notify shareable"
,
buf
,
sizeof
(
buf
),
hwnd
);
if
(
err
==
MCIERR_INVALID_DEVICE_ID
)
/* Wine special */
todo_wine
ok
(
!
err
,
"open cdaudio must succeed even without CD-ROM drive
\n
"
);
else
ok
(
!
err
||
broken
(
err
==
MCIERR_MUST_USE_SHAREABLE
),
ok
(
!
err
||
err
==
MCIERR_CANNOT_LOAD_DRIVER
||
err
==
MCIERR_MUST_USE_SHAREABLE
,
"mci open cdaudio notify returned %s
\n
"
,
dbg_mcierr
(
err
));
test_notification
(
hwnd
,
"open alias notify"
,
err
?
0
:
MCI_NOTIFY_SUCCESSFUL
);
/* Some machines return MUST_USE_SHAREABLE when there's trouble with the hardware
* (e.g. unreadable disk), yet adding that flag does not help get past this error. */
/* Native returns MUST_USE_SHAREABLE when there's trouble with the hardware
* (e.g. unreadable disk) or when Media Player already has the device open,
* yet adding that flag does not help get past this error. */
if
(
err
)
{
skip
(
"Cannot open any cdaudio device, %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