2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
9 #include <aros/debug.h>
10 #include <dos/dosextens.h>
11 #include <proto/utility.h>
12 #include "dos_intern.h"
15 /*****************************************************************************
18 #include <proto/dos.h>
20 AROS_LH3(struct DosList
*, FindDosEntry
,
23 AROS_LHA(struct DosList
*, dlist
, D1
),
24 AROS_LHA(CONST_STRPTR
, name
, D2
),
25 AROS_LHA(ULONG
, flags
, D3
),
28 struct DosLibrary
*, DOSBase
, 114, Dos
)
31 Looks for the next dos list entry with the right name. The list
32 must be locked for this. There may be not more than one device
33 or assign node of the same name. There are no such restrictions
37 dlist - the value given by LockDosList() or the last call to
39 name - logical device name without colon. Case insensitive.
40 flags - the same flags as given to LockDosList() or a subset
44 Pointer to dos list entry found or NULL if the are no more entries.
56 *****************************************************************************/
60 static const ULONG flagarray
[]=
61 { 0, LDF_DEVICES
, LDF_ASSIGNS
, LDF_VOLUMES
, LDF_ASSIGNS
, LDF_ASSIGNS
};
63 /* Determine the size of the name (-1 if the last character is a ':') */
64 CONST_STRPTR end
= name
;
75 if (size
&& end
[-2] == ':')
83 /* Get next entry. Return NULL if there is none. */
84 dlist
= BADDR(dlist
->dol_Next
);
91 D(bug("[FindDosEntry] Found list entry 0x%p, '%b' type %d\n", dlist
, dlist
->dol_Name
, dlist
->dol_Type
));
93 /* Check type and name */
94 if (flags
& flagarray
[dlist
->dol_Type
+ 1] &&
95 !CMPNICBSTR(name
, dlist
->dol_Name
, size
) &&
96 !AROS_BSTR_ADDR(dlist
->dol_Name
)[size
])