2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
5 Desc: DeviceProc - Return a handle to a device's 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
25 MsgPort responsible for a DOS device.
27 DeviceProc() will fail if you ask for the MsgPort of a device
28 created with AssignPath() as there is no process to return.
29 If the device requested is an assign, the IoErr() will contain
30 the Lock to the directory (the function will return the device
31 on which the lock is set).
34 name - The name of the DOS device, INCLUDING the ':'.
37 Either a pointer to the MsgPort, or NULL.
40 You should really use GetDeviceProc(), as that function
41 returns a more useful structure (DevProc), that will
42 persist until FreeDeviceProc() is called on it.
47 Does not support late- and non-bound assigns, or multiple
48 path assigns very well.
51 GetDeviceProc(), FreeDeviceProc()
55 *****************************************************************************/
63 /* just use GetDeviceProc(), it knows everything useful anyway */
64 if ((dvp
= GetDeviceProc(name
, NULL
)) == NULL
)
67 /* if GetDeviceProc() had to create the lock (ie non-binding assigns), we
68 * can't return it as there's no cleanup function, so we have to error */
69 if (dvp
->dvp_Flags
& DVPF_UNLOCK
)
72 err
= ERROR_DEVICE_NOT_MOUNTED
;
76 /* all good. get the lock and device */
78 err
= (SIPTR
)dvp
->dvp_Lock
;