But when, for example, iTunes uses volume and cannot be unmounted. "ret" has a value of 0xc010, which I do not quite understand.
The documentation that you are attached to for the DAReturn
type lists all disk arbitration constants that look like this:
kDAReturnError = err_local | err_local_diskarbitration | 0x01, /* ( 0xF8DA0001 ) */
Thus, DA error return consists of three components, OR'd together.
If you look at the documentation for DADissenterGetStatus
, it says:
The BSD return code, if applicable, is encoded using unix_err ().
If you then look at the headers for unix_err
, you will find it in /usr/include/mach/error.h which says:
#define unix_err(errno) (err_kern|err_sub(3)|errno)
and
/* * error number layout as follows: * * hi lo * | system(6) | subsystem(12) | code(14) | */
These three components again. Some other macros with the .h error arrange the values โโof the system and subsystem (for example, err_kern
and err_sub(3)
) at these positions.
So, open the calculator, press โ3 to put it into programming mode, switch it to base-16 and enter the error code and see what it says:
0xC010
0000 0000 0000 0000 1100 0000 0001 0000 31 15 0
Separating this in accordance with the above diagram, we find:
0000 00 31
System: 0, which error.h is talking about err_kern
. This error has arisen from a kernel.
00 0000 0000 11 31 15
Subsystem: 3 (0b11). This plus system code matches the definition of unix_err
above. So this is the BSD return code, as DADissenterGetStatus
said.
00 0000 0001 0000 31 15 0
Individual error code: 16 (0x10, 0b10000).
UNIX / BSD errors are defined in <sys/errno.h>
, which states:
#define EBUSY 16
This suggests that you cannot disconnect this device because it is being used.