[comp.sys.amiga.tech] Problem with handler

aries@skorpio.usask.ca (Aries Project) (12/01/89)

I've written a handler and it works just fine, except that when it is
active it shows up as a disk device.  How do I prevent this from
happening?

Also, do handlers have to be re-entrant?  Mine isn't and it seems to
work fine even when I have multiple incarnations of it running.

I guess what it really boils down to is that I'm looking for a good
low-level dos reference (sorry, the AmigDos manual just doesn't cut
it).

	-Mike Oliphant

cmcmanis%pepper@Sun.COM (Chuck McManis) (12/11/89)

In article <1989Dec1.152959.5833@dvinci.usask.ca> (Aries Project) writes:

>I've written a handler and it works just fine, except that when it is
>active it shows up as a disk device.  How do I prevent this from
>happening?

This is because AmigaDOS doesn't have any really good way of figuring 
out what a disk device is. Andy Finkel wrote some code for the '88 
Developers Conference that has become something of the reference. 
Essentially, the way in which many early File Requesters that figured
out what disks were available worked was to check for a device with a 
handler task (as oppose to number which was a clue to port-handler on whether
or not they were the serial or parallel device.) These days most people
check for a handler task, a valid DSKENV vector, and really careful 
campers send an ACTION_DISKINFO packet to make sure. 

>Also, do handlers have to be re-entrant?  Mine isn't and it seems to
>work fine even when I have multiple incarnations of it running.

Yes, there is only one copy of the code. If your handler allows multiple
ACTION_OPEN packets then that would mean several processes could be 
executing through your code. If you don't allow multiple opens then you
should be ok as long as the packet code up to the refusal is reentrant.

And no, there isn't a really good DOS reference. Maybe we should send
cards and letters to Randall at cbmvax and suggest it? 

--Chuck McManis
uucp: {anywhere}!sun!cmcmanis   BIX: cmcmanis  ARPAnet: cmcmanis@Eng.Sun.COM
These opinions are my own and no one elses, but you knew that didn't you.
"If it didn't have bones in it, it wouldn't be crunchy now would it?!"