2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
5 Desc: DeviceProc - Return a handle to a devices process.
8 #include "dos_intern.h"
10 /*****************************************************************************
13 #include <proto/dos.h>
15 AROS_LH1(struct MsgPort
*, DeviceProc
,
18 AROS_LHA(CONST_STRPTR
, name
, D1
),
21 struct DosLibrary
*, DOSBase
, 29, Dos
)
24 DeviceProc() is an obsolete function that returns the Process
25 responsible for a DOS device. It has been updated to return a
26 new filesystem device.
28 DeviceProc() will fail if you ask for the Process of a device
29 created with AssignPath() as there is no process to return.
30 If the device requested is an assign, the IoErr() will contain
31 the Lock to the directory (the function will return the device
32 on which the lock is set).
35 name - The name of the DOS device, without the ':'.
38 Either a pointer to the Device structure, or NULL.
41 You should really use GetDeviceProc() as this function caters
42 for all possible device types.
47 Does not support late- and non-bound assigns, or multiple
48 path assigns very well.
51 GetDeviceProc(), FreeDeviceProc()
55 *****************************************************************************/
59 struct MsgPort
*res
= NULL
;
62 /* just use GetDeviceProc(), it knows everything useful anyway */
63 if ((dvp
= GetDeviceProc(name
, NULL
)) == NULL
)
66 /* if GetDeviceProc() had to create the lock (ie non-binding assigns), we
67 * can't return it as there's no cleanup function, so we have to error */
68 if (dvp
->dvp_Flags
& DVPF_UNLOCK
) {
70 SetIoErr(ERROR_DEVICE_NOT_MOUNTED
);
74 /* all good. get the lock and device */
75 SetIoErr(dvp
->dvp_Lock
);