2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
8 #include "dos_intern.h"
10 /*****************************************************************************
13 #include <proto/dos.h>
15 AROS_LH2(LONG
, SameLock
,
18 AROS_LHA(BPTR
, lock1
, D1
),
19 AROS_LHA(BPTR
, lock2
, D2
),
22 struct DosLibrary
*, DOSBase
, 70, Dos
)
28 lock1, lock2 - locks to compare
31 LOCK_SAME - locks points to the same object
32 LOCK_SAME_VOLUME - locks are on the same volume
33 LOCK_DIFFERENT - locks are different
45 *****************************************************************************/
54 if(!SameDevice(lock1
, lock2
))
55 return LOCK_DIFFERENT
;
57 fl1
= (struct FileLock
*)BADDR(lock1
);
58 fl2
= (struct FileLock
*)BADDR(lock2
);
60 status
= dopacket2(DOSBase
, &res
, fl1
->fl_Task
, ACTION_SAME_LOCK
, lock1
, lock2
);
63 if (res
== ERROR_ACTION_NOT_KNOWN
) {
65 if (fl1
->fl_Volume
== fl2
->fl_Volume
&& fl1
->fl_Key
== fl2
->fl_Key
)
67 if (fl1
->fl_Volume
== fl2
->fl_Volume
)
68 return LOCK_SAME_VOLUME
;
70 return LOCK_DIFFERENT
;