27 December 2017, 21:07 | #1 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,160
|
assembly code to test for assign (2.0+)
I have this code to test for an assign. Ex: pass a pointer on "T:" in D0 and it returns 0 if not found
Code:
move.l _DosBase,A6 move.l D0,D5 move.l #LDF_READ|LDF_WRITE|LDF_ALL,D1 JSRLIB LockDosList move.l D0,D6 ; head of dos list ; search in the list move.l D5,D2 move.l #LDF_READ|LDF_WRITE,D3 ; flags move.l D6,D1 JSRLIB FindDosEntry move.l D0,D4 ; return ; unlock dos list move.l #LDF_READ|LDF_WRITE,D1 ; flags JSRLIB UnLockDosList move.l D4,D0 ; NULL: not found Someone knows why? I'd like to keep that code, but if I have to get rid of it and replace by a "Lock" I'll do it (since my app switches the requesters off, I suppose it won't be an issue) Edit: replacing the flags by just Code:
move.l #LDF_READ,D1 Last edited by jotd; 27 December 2017 at 21:17. |
27 December 2017, 22:38 | #2 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
Hi jotd, have You tried
move.l #LDF_READ|LDF_ALL,D1? From Autodocs there is a possible deadlock using LDF_WRITE without AttemptLockDosList() before. |
27 December 2017, 23:16 | #3 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,160
|
tried that and it didn't lock, but didn't find the assign either. Anyway, used a good old "doslib.Lock" with requesters off, and it does exactly the same thing (I don't need assign, I need to see if the T: directory exists). Moreover, my code needs to be 1.3 compatible, so the Lock solution works. thanks
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to test time for piece of code | Powergoo | Coders. Asm / Hardware | 16 | 17 October 2015 23:08 |
ALWAYS test your code on real hardware!! | h0ffman | Coders. General | 32 | 16 July 2015 21:02 |
CD32 Frog Feast test available. Test out the final! | cdoty | News | 42 | 01 April 2008 16:20 |
Assign command | fc.studio | support.Apps | 2 | 28 December 2005 18:36 |
Multi-Assign | Shoonay | support.Apps | 17 | 12 April 2005 15:16 |
|
|