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
895be2b0
Commit
895be2b0
authored
Oct 14, 2009
by
Charles Davis
Committed by
Alexandre Julliard
Oct 15, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Use the parent device for everything when processing a storage IOCTL request on Mac OS.
parent
45905b27
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
21 deletions
+25
-21
cdrom.c
dlls/ntdll/cdrom.c
+25
-21
No files found.
dlls/ntdll/cdrom.c
View file @
895be2b0
...
...
@@ -2334,6 +2334,31 @@ NTSTATUS CDROM_DeviceIoControl(HANDLE hDevice,
goto
error
;
}
#ifdef __APPLE__
{
char
name
[
100
];
/* This is ugly as hell, but Mac OS is unable to do anything from the
* partition fd, it wants an fd for the whole device, and it sometimes
* also requires the device fd to be closed first, so we have to close
* the handle that the caller gave us.
* Also for some reason it wants the fd to be closed before we even
* open the parent if we're trying to eject the disk.
*/
if
((
status
=
get_parent_device
(
fd
,
name
,
sizeof
(
name
)
)))
goto
error
;
if
(
dwIoControlCode
==
IOCTL_STORAGE_EJECT_MEDIA
)
NtClose
(
hDevice
);
if
(
needs_close
)
close
(
fd
);
TRACE
(
"opening parent %s
\n
"
,
name
);
if
((
fd
=
open
(
name
,
O_RDONLY
))
==
-
1
)
{
status
=
FILE_GetNtStatus
();
goto
error
;
}
needs_close
=
1
;
}
#endif
switch
(
dwIoControlCode
)
{
case
IOCTL_STORAGE_CHECK_VERIFY
:
...
...
@@ -2365,28 +2390,7 @@ NTSTATUS CDROM_DeviceIoControl(HANDLE hDevice,
if
(
lpInBuffer
!=
NULL
||
nInBufferSize
!=
0
||
lpOutBuffer
!=
NULL
||
nOutBufferSize
!=
0
)
status
=
STATUS_INVALID_PARAMETER
;
else
{
#ifdef __APPLE__
char
name
[
100
];
/* This is ugly as hell, but Mac OS is unable to eject from the device fd,
* it wants an fd for the whole device, and it also requires the device fd
* to be closed first, so we have to close the handle that the caller gave us.
* Also for some reason it wants the fd to be closed before we even open the parent.
*/
if
((
status
=
get_parent_device
(
fd
,
name
,
sizeof
(
name
)
)))
break
;
NtClose
(
hDevice
);
if
(
needs_close
)
close
(
fd
);
TRACE
(
"opening parent %s
\n
"
,
name
);
if
((
fd
=
open
(
name
,
O_RDONLY
))
==
-
1
)
{
status
=
FILE_GetNtStatus
();
break
;
}
needs_close
=
1
;
#endif
status
=
CDROM_SetTray
(
fd
,
TRUE
);
}
break
;
case
IOCTL_CDROM_MEDIA_REMOVAL
:
...
...
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