Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!killer!texbell!sugar!uunet!mcvax!unido!fauern!faui44!mlelstv From: mlelstv@faui44.informatik.uni-erlangen.de (Michael van Elst ) Newsgroups: comp.sys.amiga.tech Subject: Re: Finding DOS Handler Message Ports Message-ID: <662@faui44.informatik.uni-erlangen.de> Date: 10 Oct 88 11:38:13 GMT References: <5459@netnews.upenn.edu> Reply-To: mlelstv@faui44.UUCP (Michael van Elst (kdebugger)) Organization: CSD., University of Erlangen, W - Germany Lines: 33 In article <5459@netnews.upenn.edu> ranjit@eniac.seas.upenn.edu.UUCP (Ranjit Bhatnagar) writes: >Alright, suppose I were writing a DOS handler which would filter >packets given to it and pass them on to other handlers. How can I, >given a filename, figure out the handler corresponding to it without >actually making any attempt to access the file (or device) in question? > There is a functions called DeviceProc in the dos.library. You pass a filename to the function and it returns a pointer to the corresponding handlers messageport. There you can send DosPackets like ACTION_INHIBIT to stop the file system or ACTION_FIND_INPUT to open a file for reading, etc. The filename you pass to this functions doesn't need to refer to an existing file. You might stop dos from asking you to insert a disk if you want to access a volume that is not mounted. This is done by writing a -1 into your Process structure pr_WindowPtr field. Don't forget to restore the original value. You can find the handler that serves your current directory by examining your Process structure pr_FileSys field. The DeviceProc function cannot be used with CON: and RAW: handlers because there might be more than one of each. The Open call returns a BPTR to FileHandle. You can find the handler port in the fh_Type field of this FileHandle structure. Hope that helps. Michael van Elst E-mail: UUCP: ...uunet!unido!fauern!faui44!mlelstv