home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 1283 < prev    next >
Encoding:
Text File  |  1996-08-05  |  2.7 KB  |  61 lines

  1. Path: cpca3.uea.ac.uk!news
  2. From: Dan J Archer <D.Archer@uea.ac.uk>
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: WBStartup - Help!
  5. Date: Wed, 17 Jan 1996 17:26:08 -0800
  6. Organization: EBP
  7. Message-ID: <30FDA1B0.5030@uea.ac.uk>
  8. References: <vreeland-1601961903260001@192.0.2.1>
  9. NNTP-Posting-Host: nc6h.nca.uea.ac.uk
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0b5 (Win95; I; 16bit)
  14.  
  15. Robert W. Vreeland Jr. wrote:
  16. ...
  17. > I've written some code to simulate launching a process as if it were
  18. > launched by the workbench.  The code works flawlessly, with one single
  19. > problem.  The new process never ends up with correct command paths setup....
  20. > Now does any one know:  how does a task spawned by the workbench get a
  21. > command path...where does it come from and how to I get my code to set
  22. > this up correctly.  It does not (contrary to what I saw someone post) get
  23. > sent by the WBStartup message.  This message contains the name of the new
  24. > process and lock on its directory as well as the names of any arguments
  25. > and locks on their directories.  So what gives?
  26. > Thanks in advance,
  27. > Robert.
  28.  
  29. Hmmm, it's a tricky one...I can be only of minor assistance.
  30.  
  31. CLI processes have the pr_CLI pointer pointing to a CommandLineInterface structure, and within 
  32. this heinous artifice is a cli_CommandDir pointer. This is a BPTR to a single linked list with 
  33. the following structure (not defined in CBM's header files)
  34.  
  35. struct PathList /* size = 8 */
  36. {
  37.    BPTR nextPath; /* BPTR to struct PathList */
  38.    BPTR pathLock; /* BPTR to struct FileLock */
  39. };
  40.  
  41. nextPath links the elements of the list together, and pathLock is a pointer to the FileLock 
  42. structure of the dir this path entry refers to.
  43.  
  44. Now, if it was a CLI process you were "faking", you would be home and dry. I have no idea where 
  45. WB processes get their pathList from: presumably they inherit it from Workbench, as WB is started 
  46. from the CLI and will thus have a ptr to a CommandLineInterface set. Is your simulator program a 
  47. CLI process? Maybe you need to copy WB's pr_CLI pointer to your simulator's process structure...?
  48.  
  49. Athankye.
  50.  
  51.  /----------------------------------------------------------------------\
  52. / "A friend of mine did ride astride with tattered hat and stalk of hay: \
  53. \  He carried buckets of giraffe, and hairless errors 'pon a tray."      /
  54.  \----------------------------------------------------------------------/
  55.  /        D.Archer@uea.ac.uk      |   http://www.uea.ac.uk/~u9537872/   \ 
  56.  \----------------------------------------------------------------------/
  57.   \  Opinions expressed are not those of UEA, or anyone with lawyers.  /
  58.    \------------------------------------------------------------------/
  59.