New bitmap method SetRGBConversionFunction which can be used to
[tangerine.git] / rom / dos / deviceproc.c
blob9baf5bb4c76bd5ac7a937afed5c23135c89abb02
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: DeviceProc - Return a handle to a devices process.
6 Lang: english
7 */
8 #include "dos_intern.h"
10 /*****************************************************************************
12 NAME */
13 #include <proto/dos.h>
15 AROS_LH1(struct Device *, DeviceProc,
17 /* SYNOPSIS */
18 AROS_LHA(CONST_STRPTR, name, D1),
20 /* LOCATION */
21 struct DosLibrary *, DOSBase, 29, Dos)
23 /* FUNCTION
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).
34 INPUTS
35 name - The name of the DOS device, without the ':'.
37 RESULT
38 Either a pointer to the Device structure, or NULL.
40 NOTES
41 You should really use GetDeviceProc() as this function caters
42 for all possible device types.
44 EXAMPLE
46 BUGS
47 Does not support late- and non-bound assigns, or multiple
48 path assigns very well.
50 SEE ALSO
51 GetDeviceProc(), FreeDeviceProc().
53 INTERNALS
55 *****************************************************************************/
57 AROS_LIBFUNC_INIT
58 AROS_LIBBASE_EXT_DECL(struct DosLibrary *,DOSBase)
60 struct Device *res = NULL;
61 struct DosList *dl;
63 dl = LockDosList(LDF_READ|LDF_ALL);
64 dl = FindDosEntry(dl, name, LDF_ALL);
65 if(dl != NULL)
67 /* If it is a device, return the Device */
68 if(dl->dol_Type == DLT_DEVICE || dl->dol_Type == DLT_VOLUME)
70 res = dl->dol_Device;
73 /* If it is an assign, return device and lock */
74 else if(dl->dol_Type == DLT_DIRECTORY)
76 res = dl->dol_Device;
77 SetIoErr((ULONG)dl->dol_Lock);
80 UnLockDosList(LDF_READ|LDF_ALL);
82 return res;
83 AROS_LIBFUNC_EXIT
84 } /* DeviceProc */