home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / csmpdigest / csmp-digest-v3-077 < prev    next >
Text File  |  2010-09-21  |  74KB  |  2,119 lines

  1. Received-Date: Mon, 2 Jan 1995 18:45:22 +0100
  2. From: pottier@clipper.ens.fr (Francois Pottier)
  3. Subject: csmp-digest-v3-077
  4. To: csmp-digest@ens.fr
  5. Date: Mon, 2 Jan 1995 18:45:17 +0100 (MET)
  6. X-Mailer: ELM [version 2.4 PL23]
  7. Mime-Version: 1.0
  8. Content-Type: text/plain; charset=ISO-8859-1
  9. Content-Transfer-Encoding: 8bit
  10. Errors-To: listman@ens.fr
  11. Reply-To: pottier@clipper.ens.fr
  12. X-Sequence: 83
  13.  
  14. C.S.M.P. Digest             Mon, 02 Jan 95       Volume 3 : Issue 77
  15.  
  16. Today's Topics:
  17.  
  18.         AppleShare Volume or Local Volume?
  19.         Default button in a modeless dialogue?
  20.         How difficult to create an AS wrapper for porting?
  21.         How to get Macintosh Name or Owner Name?
  22.         How to receive events in AppleScript script?
  23.         Jasik 12-08 Update available
  24.         Mounting Appleshare Volumes
  25.         PUZZLER: How to get to A5 world in _ExitToShell patch
  26.         Password for mounting remote volumes
  27.         SUMMARY: MacTCP Performance Problems
  28.         [Q] How to find parameter info for traps
  29.         string constants in Metrowerks C code resource?
  30.  
  31.  
  32.  
  33. The Comp.Sys.Mac.Programmer Digest is moderated by Francois Pottier
  34. (pottier@clipper.ens.fr).
  35.  
  36. The digest is a collection of article threads from the internet newsgroup
  37. comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
  38. regularly and want an archive of the discussions.  If you don't know what a
  39. newsgroup is, you probably don't have access to it.  Ask your systems
  40. administrator(s) for details.  If you don't have access to news, you may
  41. still be able to post messages to the group by using a mail server like
  42. anon.penet.fi (mail help@anon.penet.fi for more information).
  43.  
  44. Each issue of the digest contains one or more sets of articles (called
  45. threads), with each set corresponding to a 'discussion' of a particular
  46. subject.  The articles are not edited; all articles included in this digest
  47. are in their original posted form (as received by our news server at
  48. nef.ens.fr).  Article threads are not added to the digest until the last
  49. article added to the thread is at least two weeks old (this is to ensure that
  50. the thread is dead before adding it to the digest).  Article threads that
  51. consist of only one message are generally not included in the digest.
  52.  
  53. The digest is officially distributed by two means, by email and ftp.
  54.  
  55. If you want to receive the digest by mail, send email to listserv@ens.fr
  56. with no subject and one of the following commands as body:
  57.     help                        Sends you a summary of commands
  58.     subscribe csmp-digest Your Name    Adds you to the mailing list
  59.     signoff csmp-digest            Removes you from the list
  60. Once you have subscribed, you will automatically receive each new
  61. issue as it is created.
  62.  
  63. The official ftp info is //ftp.dartmouth.edu/pub/csmp-digest.
  64. Questions related to the ftp site should be directed to
  65. scott.silver@dartmouth.edu. Currently no previous volumes of the CSMP
  66. digest are available there.
  67.  
  68. Also, the digests are available to WAIS users.  To search back issues
  69. with WAIS, use comp.sys.mac.programmer.src. With Mosaic, use
  70. http://www.wais.com/wais-dbs/comp.sys.mac.programmer.html.
  71.  
  72.  
  73. -------------------------------------------------------
  74.  
  75. >From jms20@po.cwru.edu (John M. Sully)
  76. Subject: AppleShare Volume or Local Volume?
  77. Date: Thu, 01 Dec 1994 10:55:08 -0600
  78. Organization: Library Information Technologies - CWRU
  79.  
  80. Greetings,
  81.    I need to figure out the following about a mounted volume and am not
  82. sure what the "correct" way of doing it is...
  83.  
  84. (1) Is the volume on an Appleshare server?
  85.  
  86. an if so...
  87.  
  88. (2) What is the name of the server it is on?
  89.  
  90. Thanks,
  91. John
  92.  
  93. -- 
  94. - -------------------------------------------------------------------------
  95. | John M. Sully                    | Freiberger Library | Yesterday's     |
  96. | Software Maintenance and         |      Room 305      |    Technology   | 
  97. |    Development Specialist        | voice:(216)368-8989| Solving Today's |
  98. | Library Infomation Technologies  | fax:(216)368-8720  |    Problems     | 
  99. | Case Western Reserve University  | jms20@po.cwru.edu  | Tomorrow        |
  100. - ------------------------------------------------------------------------- 
  101. |        <A HREF="http://x-wing.lit.cwru.edu/">John's Server  </A>        |
  102. - -------------------------------------------------------------------------
  103.  
  104. +++++++++++++++++++++++++++
  105.  
  106. >From jumplong@aol.com (Jump Long)
  107. Date: 12 Dec 1994 01:50:27 -0500
  108. Organization: America Online, Inc. (1-800-827-6364)
  109.  
  110. In article <jms20-0112941055080001@lit35332.lit.cwru.edu>,
  111. jms20@po.cwru.edu (John M. Sully) writes:
  112.  
  113. >(1) Is the volume on an Appleshare server?
  114. >
  115. >an if so...
  116. >
  117. >(2) What is the name of the server it is on?
  118.  
  119. If you just want to find out if the volume is a network volume, call
  120. PBHGetVolParms and look at the vMServerAdr volume returned in the
  121. GetVolParmsInfoBuffer structure.  If vMServerAdr is non-zero, then the
  122. volume is a netowork volume.
  123.  
  124. If you want to find out if a volume is mounted by the AppleShare foreign
  125. file system, then you should first call PBGetVolMountInfoSize.  That will
  126. return the size of the volume mount information record that
  127. PBGetVolMountInfo will return.  Allocate a block big enough for the volume
  128. mount information record and then call PBGetVolMountInfo to fill it in. 
  129. If the media field in the volume mount information record is
  130. AppleShareMediaType, then the volume is an AppleShare volume and you can
  131. get the server name out of the volume mount information record.
  132.  
  133. If you use the routines in Apple's sample code MoreFiles, this is made
  134. pretty easy. For example:
  135.  
  136. OSErr result;
  137. short infoSize;
  138. short theFlags;
  139. short theUAMType;
  140. Str32 theZoneName, theServerName, theVolName, theUserName;
  141.  
  142. result = GetVolMountInfoSize(NULL, vRefNum, &infoSize);
  143. if (result == noErr)
  144. {
  145.   Ptr  volMountInfo = NewPtr((Size)infoSize);
  146.   if (volMountInfo != NULL)
  147.   {
  148.     result = GetVolMountInfo(NULL, vRefNum, volMountInfo);
  149.     if (result == noErr)
  150.     {
  151.       result = RetrieveAFPVolMountInfo((AFPVolMountInfoPtr)volMountInfo,
  152. &theFlags,
  153.                                        &theUAMType, theZoneName,
  154. theServerName,
  155.                                        theVolName, theUserName);
  156.       if (result == paramErr)
  157.       {
  158.         /* volume isn't an AFP volume (RetrieveAFPVolMountInfo returns
  159. paramErr in this case) */
  160.       }
  161.     }
  162.     DisposePtr(volMountInfo);
  163.   }
  164. }
  165. else
  166. {
  167.   /* volume doesn't support volume mount calls so it isn't AppleShare
  168. volume */
  169. }
  170.  
  171. (the code above was typed in here but not test compiled)
  172.  
  173. Hope that helps...
  174.  
  175. - Jim Luther
  176.  
  177. ---------------------------
  178.  
  179. >From ian@eruvia.demon.co.uk (Ian McCall)
  180. Subject: Default button in a modeless dialogue?
  181. Date: 16 Dec 1994 16:02:44 -0600
  182. Organization: UTexas Mail-to-News Gateway
  183.  
  184. Hi.
  185.  
  186. I'm trying to implement a modeless dialogue for the first time, and I've
  187. come across a problem.
  188.  
  189. How do you implement default buttons in a modeless dialogue with editText
  190. fields? I've got the button there, and I've framed it using the dummy
  191. userItem method. However, I can't see how to make it understand that
  192. pressing return/enter is the same as clicking on the OK button.
  193.  
  194. I'm calling IsDialogEvent, followed by DialogSelect in order to determine
  195. which dialogue the event is for. Thing is, DialogSelect 'helpfully'
  196. processes the event for me too. By the time I know both which key has been
  197. pressed and which dialogue it was pressed in, DialogSelect has already
  198. passed it on to the active TextEdit field.
  199.  
  200. I've used return/enter here as examples, but it's also happening when I try
  201. to intercept escape for the 'cancel' button, and all the standard edit
  202. combos (z, x, c, v). As sson as I try to find out which dialogue the
  203. keypresses are in, the events get process anyway and I'm left with an
  204. unwanted character sitting in my editText field.
  205.  
  206.  
  207. Also, whilst I'm here, I'd like to ask for some help on pop-up menus under
  208. System 7. I haven't got all the documentation, but apparently there's a
  209. CDEF I can use in combination with PopUpMenuSelect(). Which CDEF is it,
  210. please? And how would I go about determining that information? This pop-up
  211. is to go in the same modeless dialogue as above, so I assume that what I
  212. need to do is get a handle to the CDEF and then do a SetDItem call - is
  213. that right?
  214.  
  215. Thanks in advance for any information. As I say, I've not done a modeless
  216. dialogue box before and without having all the documentation to hand I'm
  217. finding it a bit awkward.
  218.  
  219. Please reply via email, since I don't actually read this group very often.
  220. It's just too big to use with an online reader and your own phone bill
  221. ticking along in the background...
  222.  
  223.  
  224. Cheers,
  225. Ian
  226.  
  227. (ian@eruvia.demon.co.uk)
  228.  
  229.  
  230.  
  231. +++++++++++++++++++++++++++
  232.  
  233. >From rmah@panix.com (Robert Mah)
  234. Date: Fri, 16 Dec 1994 21:43:32 -0500
  235. Organization: One Step Beyond
  236.  
  237. ian@eruvia.demon.co.uk (Ian McCall) wrote:
  238.  
  239. ) How do you implement default buttons in a modeless dialogue with editText
  240. ) fields? I've got the button there, and I've framed it using the dummy
  241. ) userItem method. However, I can't see how to make it understand that
  242. ) pressing return/enter is the same as clicking on the OK button.
  243. ) I'm calling IsDialogEvent, followed by DialogSelect in order to determine
  244. ) which dialogue the event is for. Thing is, DialogSelect 'helpfully'
  245. ) processes the event for me too. By the time I know both which key has been
  246. ) pressed and which dialogue it was pressed in, DialogSelect has already
  247. ) passed it on to the active TextEdit field.
  248.  
  249. One thing you can do is call the standard filter proc manually using the
  250. CallModalFilterProc macro returned from GetStdFilterProc.  Come to think
  251. of it, calling the StdFilterProc() function may do the trick.  Anyway,
  252. do this before calling DialogSelect() and call it only when it returns
  253. false (or is it true?  Damn, I can never remember).
  254.  
  255. Yes, I know these are usually used with modal dialogs, but they DO work
  256. with modeless dialogs as well.  I use them in a SemiModalDialog() function
  257. I whipped up.
  258.  
  259.  
  260. ) and all the standard edit combos (z, x, c, v). As sson as I try to find
  261. ) out which dialogue the keypresses are in, the events get process anyway
  262. ) and I'm left with an unwanted character sitting in my editText field.
  263.  
  264. You shouldn't pass keydown events with the cmdKey bit of the event.modifiers
  265. field set to DialogSelect.  Trap these out and send them to your menu
  266. command function.  Then, in your Edit menu handler, check to see if the
  267. front window is a dialog.  If so, then call the appropriate DlgXXXX traps.
  268.  
  269.  
  270. ) Also, whilst I'm here, I'd like to ask for some help on pop-up menus under
  271. ) System 7. I haven't got all the documentation, but apparently there's a
  272. ) CDEF I can use in combination with PopUpMenuSelect(). Which CDEF is it,
  273. ) please? And how would I go about determining that information? This pop-up
  274. ) is to go in the same modeless dialogue as above, so I assume that what I
  275. ) need to do is get a handle to the CDEF and then do a SetDItem call - is
  276. ) that right?
  277.  
  278. The procID is 1009.  But there are a few variation codes and each field
  279. in the CNTL resource means something special.  It's documented in Inside
  280. Mac VI as well as one of the new Inside Macs (but I can't remember which).
  281.  
  282. Cheers,
  283. Rob
  284. _______________________________________________________________________
  285. Robert S. Mah        Macintosh Software Development     +1.212.947.6507
  286. One Step Beyond         and Network Consulting           rmah@panix.com
  287.  
  288. ---------------------------
  289.  
  290. >From osiris@cs.utexas.edu (Rob Browning)
  291. Subject: How difficult to create an AS wrapper for porting?
  292. Date: Sun, 11 Dec 1994 13:18:40 -0600
  293. Organization: The University of Texas at Austin
  294.  
  295. There are a number of unix tools that would be useful to have on the Mac
  296. (indent comes to mind).  I was wondering how difficult it would be to
  297. create a library representing a wrapper that could be used to encapsulate
  298. the unix code, turning it into an AppleScriptable application.  It would
  299. be nice to be able to write scripts like this (please excuse my naive AS
  300. syntax):
  301.  
  302. tell application "WordCount" --i.e. wc
  303.    run given parameters:"-l" stdin:"MyDrive:inputFile"
  304. stdout:"MyDrive:outputFile"
  305. end tell
  306.  
  307. or something like this.
  308.  
  309. If this were done, porting some of the unix tools to the mac could be much
  310. more straightforward, and you could chain tools in a manner similar to the
  311. way tools are combined in MPW and unix.  As it stands now, a number of
  312. these tools have been ported, but it is difficult to combine the
  313. standalone versions to do anything useful. 
  314.  
  315. Does anyone have an idea how difficult this would be?
  316.  
  317. Thanks -- Rob
  318.  
  319. +++++++++++++++++++++++++++
  320.  
  321. >From julian@cs.auckland.ac.nz (Julian Harris)
  322. Date: Thu, 15 Dec 1994 18:21:54 +1300
  323. Organization: Computer Science Department, UA
  324.  
  325. In article <osiris-1112941318400001@slip-14-1.ots.utexas.edu>,
  326. osiris@cs.utexas.edu (Rob Browning) wrote:
  327.  
  328. > There are a number of unix tools that would be useful to have on the Mac
  329. > (indent comes to mind).  I was wondering how difficult it would be to
  330. > create a library representing a wrapper that could be used to encapsulate
  331. > the unix code, turning it into an AppleScriptable application.  It would
  332. > be nice to be able to write scripts like this (please excuse my naive AS
  333. > syntax):
  334. > tell application "WordCount" --i.e. wc
  335. >    run given parameters:"-l" stdin:"MyDrive:inputFile"
  336. > stdout:"MyDrive:outputFile"
  337. > end tell
  338. > or something like this.
  339. > Does anyone have an idea how difficult this would be?
  340.  
  341. That could work. You'd 'subclass' the 'oapp' event so that its default
  342. behaviour would be the same (no arguments), but if you give it others,i.e.
  343. stdin and stdout parameters, it would accept them too. It could also do
  344. something tricky with odoc events too, so you can drag a file onto the app
  345. (which would then be the stdin source).
  346.  
  347. Because AppleEvents are sent through events, you'd have two basic states
  348. of the program:
  349.  
  350. - the wrapper which hangs around for the oapp and odoc events (if there are any)
  351.   and if none, brings up the standard ccommand thing that is supplied with
  352.   Symantec and MW.
  353.  
  354. - the core app.
  355.  
  356. Actually it would be better to have the stdin, stdout, parameters, etc
  357. sent in another event so you can do it again when the app is running.
  358.  
  359. But one of the biggest problems with getting unix programs to work is that
  360. they rely on static initialisation of variables. That you have to do
  361. manually, but I agree, it wouldn't be too difficult to do such a thing.
  362. .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .
  363. Microsoft is not the answer.                    >  Julian Harris, Programmer   >
  364. Microsoft is the question.                     >  Comp. Sci. Dept.     x8915  >
  365.                                               >  The University of Auckland  >
  366. NO is the answer.                            >  julian@cs.auckland.ac.nz    >
  367.  
  368. +++++++++++++++++++++++++++
  369.  
  370. >From gilbert@marin.cc.ca.us (Tim Gilbert)
  371. Date: Thu, 15 Dec 1994 20:12:31 GMT
  372. Organization: College of Marin, Kentfield, CA 94904
  373.  
  374. Rob Browning (osiris@cs.utexas.edu) wrote:
  375. : There are a number of unix tools that would be useful to have on the Mac
  376. : (indent comes to mind).  I was wondering how difficult it would be to
  377. : create a library representing a wrapper that could be used to encapsulate
  378. : the unix code, turning it into an AppleScriptable application.  It would
  379. : be nice to be able to write scripts like this (please excuse my naive AS
  380. : syntax):
  381.  
  382. : tell application "WordCount" --i.e. wc
  383. :    run given parameters:"-l" stdin:"MyDrive:inputFile"
  384. : stdout:"MyDrive:outputFile"
  385. : end tell
  386.  
  387. : or something like this.
  388.  
  389. This is something that's been kicking around my head for a long time; I
  390. think it's a great idea.  Unfortunately I've never had the System 7 savvy
  391. to work on it.  But here are a few of the ideas I've had:
  392.  
  393.  -- All the simple TextEdit editors in all of those unix ports would be
  394.     unnecessary; stdin could read either from a window or a file (the ProIcon
  395.     environment handles this very nicely).
  396.  
  397.  -- Code size could be drastically reduced; most of the file, console, etc
  398.     stuff in the <ANSI> lib could be replaced by simple AppleEvent calls.
  399.     Further, all apps would use the same (single) stio library, which
  400.     would be essentailly a shared library.
  401.  
  402.  -- My ambition was to write a full ANSI lib that would be in the public
  403.     domain, with strcpy, malloc, fprintf, etc, etc...  Unfortunately I
  404.     don't have the time for any of that now.  But the advantages of
  405.     bundling all those up into a shared library should be clear, I
  406.     think.
  407.  
  408. Somewhere (perhaps the nic.switch.ch source archive?) is a package called
  409. posixlib...  I haven't looked at it yet, but maybe it would provide some
  410. good code to use as a base to start from...
  411.  
  412. Anyways, keep us all posted about what you come up with, if anything,
  413. please...  Good luck!                -- Tim
  414.  
  415. -- 
  416. Tim Gilbert <> gilbert@marin.cc.ca.us <> College of Marin, S.F. Bay Area
  417.  
  418. +++++++++++++++++++++++++++
  419.  
  420. >From osiris@cs.utexas.edu (Rob Browning)
  421. Date: Fri, 16 Dec 1994 18:57:04 -0600
  422. Organization: The University of Texas at Austin
  423.  
  424. In article <D0vC4v.EK5@marin.cc.ca.us>, gilbert@marin.cc.ca.us (Tim
  425. Gilbert) wrote:
  426.  
  427. > This is something that's been kicking around my head for a long time; I
  428. > think it's a great idea.  Unfortunately I've never had the System 7 savvy
  429. > to work on it.  But here are a few of the ideas I've had:
  430. >  -- All the simple TextEdit editors in all of those unix ports would be
  431. >     unnecessary; stdin could read either from a window or a file (the ProIcon
  432. >     environment handles this very nicely).
  433.  
  434. Quite true.  It would really be nice if the wrapper could be constructed so that
  435. these tools could have their stdin and stdout redirected to your favorite
  436. text editor
  437. (Alpha for me :>), and then you could use the editor's text windows as shell
  438. windows to run the tools.  One of the nice things about this is that the tools
  439. would only be taking up RAM when they are running (instead of the way that
  440. MPW handles tools).  There could also be a flag that determines whether or not
  441. the tool quits after a run or stays open waiting for the next command.
  442.  
  443. I've started looking into what it takes to create an applescriptable app,
  444. (in IM: Interapplication Communications), and it looks like I'm certainly not
  445. yet up to the task.  Hopefully I'll get some time, and can learn the stuff
  446. I need to
  447. know, but it looks like a substantial undertaking...
  448.  
  449. If anyone else gets the urge and knows this stuff better, feel free to go
  450. ahead :>
  451.  
  452. --Rob.
  453.  
  454. +++++++++++++++++++++++++++
  455.  
  456. >From jacobowi@crab.rutgers.edu (Howard Jacobowitz)
  457. Date: 17 Dec 1994 21:41:13 -0500
  458. Organization: Rutgers University
  459.  
  460. osiris@cs.utexas.edu (Rob Browning) writes:
  461.  
  462. >There are a number of unix tools that would be useful to have on the Mac
  463. >(indent comes to mind).  I was wondering how difficult it would be to
  464. >create a library representing a wrapper that could be used to encapsulate
  465. >the unix code, turning it into an AppleScriptable application.  It would
  466. >be nice to be able to write scripts like this (please excuse my naive AS
  467. >syntax):
  468.  
  469. >tell application "WordCount" --i.e. wc
  470. >   run given parameters:"-l" stdin:"MyDrive:inputFile"
  471. >stdout:"MyDrive:outputFile"
  472. >end tell
  473.  
  474. >or something like this.
  475.  
  476. >If this were done, porting some of the unix tools to the mac could be much
  477. >more straightforward, and you could chain tools in a manner similar to the
  478. >way tools are combined in MPW and unix.  As it stands now, a number of
  479. >these tools have been ported, but it is difficult to combine the
  480. >standalone versions to do anything useful. 
  481.  
  482. >Does anyone have an idea how difficult this would be?
  483.  
  484. >Thanks -- Rob
  485.  
  486. I shouldn't think it would be too hard.  Actually, it would probably
  487. be kind of interesting to work out.  I started something similar to
  488. this once, but never really spent enough time on it to get it to work
  489. decently.
  490.  
  491. +++++++++++++++++++++++++++
  492.  
  493. >From julian@cs.auckland.ac.nz (Julian Harris)
  494. Date: Mon, 19 Dec 1994 14:11:18 +1300
  495. Organization: Computer Science Department, UA
  496.  
  497. In article <osiris-1612941857040001@slip-25-2.ots.utexas.edu>,
  498. osiris@cs.utexas.edu (Rob Browning) wrote:
  499.  
  500. > In article <D0vC4v.EK5@marin.cc.ca.us>, gilbert@marin.cc.ca.us (Tim
  501. > Gilbert) wrote:
  502. > > This is something that's been kicking around my head for a long time; I
  503. > > think it's a great idea.  Unfortunately I've never had the System 7 savvy
  504. > > to work on it.  But here are a few of the ideas I've had:
  505. > > 
  506. > >  -- All the simple TextEdit editors in all of those unix ports would be
  507. > >     unnecessary; stdin could read either from a window or a file (the
  508. ProIcon
  509. > >     environment handles this very nicely).
  510. > Quite true.  It would really be nice if the wrapper could be constructed
  511. so that
  512. > these tools could have their stdin and stdout redirected to your favorite
  513. > text editor
  514.  
  515. <snip>
  516.  
  517. > If anyone else gets the urge and knows this stuff better, feel free to go
  518. > ahead :>
  519.  
  520. Well, it does sound like with Apple events, and the proliferation of
  521. scriptable apps, that it could work reasonably well. One day, in a distant
  522. land, perhaps I could get around to it.
  523.  
  524. I'm just researching IAC myself, and have printed out the relevant
  525. sections on Apple events, object descriptors, and recording (all 500 pages
  526. of it :) and have got lots of neat ideas about how to write a scriptable
  527. app. The first (which is extrememly revolutionary :) is to model your
  528. application in terms of what apple event objects it is comprised of, and
  529. their properties and elements they're associated with.
  530.  
  531. Perhaps when I have a bit more experience with Apple events I could get on
  532. to this. It doesn't sound too hard I reckon.
  533. .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .
  534. Microsoft is not the answer.                    >  Julian Harris, Programmer   >
  535. Microsoft is the question.                     >  Comp. Sci. Dept.     x8915  >
  536.                                               >  The University of Auckland  >
  537. NO is the answer.                            >  julian@cs.auckland.ac.nz    >
  538.  
  539. ---------------------------
  540.  
  541. >From tonyc@iconz.co.nz (Tony Cooper)
  542. Subject: How to get Macintosh Name or Owner Name?
  543. Date: 16 Dec 1994 06:20:03 GMT
  544. Organization: Public Access Internet, Auckland New Zealand
  545.  
  546. How do you get the Macintosh Name or Owner Name? I have all the Inside Mac
  547. bookks, all the snippets, and all the Develop Bookmark CDs. But I can't
  548. find this one anywhere.
  549.  
  550. Someone, please put me out of my misery and give me a reference. Mail
  551. to tonyc@iconz.co.nz.
  552.  
  553. Shouldn't Gestalt do this?
  554.  
  555. Thanks
  556. Tony Cooper
  557. tonyc@iconz.co.nz
  558.  
  559.  
  560. +++++++++++++++++++++++++++
  561.  
  562. >From Jaeger@fquest.com (Brian Stern)
  563. Date: 17 Dec 1994 04:21:18 GMT
  564. Organization: The University of Texas at Austin, Austin, Texas
  565.  
  566. In article <3crbil$54s@status>, tonyc@iconz.co.nz (Tony Cooper) wrote:
  567.  
  568. < How do you get the Macintosh Name or Owner Name? I have all the Inside Mac
  569. < bookks, all the snippets, and all the Develop Bookmark CDs. But I can't
  570. < find this one anywhere.
  571. < Someone, please put me out of my misery and give me a reference. Mail
  572. < to tonyc@iconz.co.nz.
  573. < Shouldn't Gestalt do this?
  574. < Thanks
  575. < Tony Cooper
  576. < tonyc@iconz.co.nz
  577.  
  578. You can call GetString() with these constants:
  579.  
  580. const short kChooserNameID = -16096;
  581. const short kMachineNameID = -16413;
  582.  
  583. These 'STR ' resources are in the system file.
  584.  
  585. -- 
  586. Brian  Stern  :-{)}
  587. Toolbox commando and Menu bard
  588. Jaeger@fquest.com
  589.  
  590. +++++++++++++++++++++++++++
  591.  
  592. >From jwbaxter@olympus.net (John W. Baxter)
  593. Date: Fri, 16 Dec 1994 20:44:22 -0800
  594. Organization: Internet for the Olympic Peninsula
  595.  
  596. In article <3crbil$54s@status>, tonyc@iconz.co.nz (Tony Cooper) wrote:
  597.  
  598. > How do you get the Macintosh Name or Owner Name? I have all the Inside Mac
  599. > bookks, all the snippets, and all the Develop Bookmark CDs. But I can't
  600. > find this one anywhere.
  601.  
  602. 'STR ' resource ID -16096 is the user name
  603. 'STR ' resource ID -16413 is the machine name
  604.  
  605. See page 1-127, IM More Mac Toolbox (I have the corner folded over).
  606.  
  607. 'STR ' resource ID -8192 is the printer type (driver name) except when it
  608. isn't.  One situation where it isn't is when QuickDraw GX printing is
  609. installed, when 'STR ' -8192 is the name of the current default desktop
  610. printer.
  611.  
  612. > Mail to tonyc@iconz.co.nz.
  613. Done.
  614.   --John
  615.  
  616. -- 
  617. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  618.    Caesar attended the Senate in a rented toga.
  619.    jwbaxter@pt.olympus.net
  620.  
  621. ---------------------------
  622.  
  623. >From markm@XMission.com (Mark A. Matthews)
  624. Subject: How to receive events in AppleScript script?
  625. Date: Sun, 11 Dec 1994 12:05:46 -0700
  626. Organization: XMission Public Access Internet (801 539 0900)
  627.  
  628.  
  629. I'm trying to write a script which will receive events from Eudora when
  630. mail arrives.  I can convince Eudora to send my script the events, but I
  631. can't figure out how to write the part of the script that is to receive
  632. the event from Eudora.
  633.  
  634. A fragment of AppleScript demonstrating this would help greatly.  Can
  635. anyone provide one?
  636.  
  637. -- 
  638. -Mark
  639.  
  640. +++++++++++++++++++++++++++
  641.  
  642. >From paul@gig.nl (Paul Boots)
  643. Date: Mon, 12 Dec 1994 12:01:00 +0100
  644. Organization: ELECTROGIG Europe
  645.  
  646. In article <markm-1112941205460001@slc34.xmission.com>, markm@XMission.com
  647. (Mark A. Matthews) wrote:
  648.  
  649. > I'm trying to write a script which will receive events from Eudora when
  650. > mail arrives.  I can convince Eudora to send my script the events, but I
  651. > can't figure out how to write the part of the script that is to receive
  652. > the event from Eudora.
  653. > A fragment of AppleScript demonstrating this would help greatly.  Can
  654. > anyone provide one?
  655. > -- 
  656. > -Mark
  657.  
  658.  
  659. Hi Mark,  below some code I tested with Eudora.  It will receive the notice
  660. event sent by Eudora.
  661.  
  662.  
  663. Paul Boots
  664. paul@gig.nl
  665.  
  666. - --
  667. CODE BEGINS
  668. - --
  669. on run
  670.    
  671.    --activate
  672.    --start notifying when mail sent
  673.    --tell application "Eudora1.5.1fc1-1.95" to start notifying
  674.    set WhoIam to the (path to current application as alias)
  675.    tell application "Eudora1.5.1fc1-1.95" to start notifying WhoIam when
  676. mail sent
  677.    
  678. end run
  679.  
  680. on notice messages theMsgList
  681.    tell me to activate
  682.    display dialog "Eudora notified me that it has send the following
  683. messages: " & ¨
  684.       return & theMsgList
  685. end notice
  686. - --
  687. END OF CODE
  688. - --
  689.  
  690. ---------------------------
  691.  
  692. >From pottier@triere.ens.fr (Francois Pottier)
  693. Subject: Jasik 12-08 Update available
  694. Date: 10 Dec 1994 13:11:00 GMT
  695. Organization: Ecole Normale Superieure, PARIS, France
  696.  
  697.  
  698. Steve Jasik asked me to post this message here. Note that I am in no
  699. way affiliated with Jasik Designs, I'm just a happy user of The Debugger...
  700.  
  701. - ------------------------------------------------------------------------------
  702.  
  703. 12/8 Jasik Debugger patch Notes - Dec 8, 1994
  704.  
  705. To all Jasik Debugger users:
  706.  
  707. The file '12_08_Dbgr_Patch' is an Application which patchs the
  708. 9/30/94 version of The Debugger.
  709.  
  710. ••••• Current Fixes/changes - 12/8 •••••
  711.  
  712. • auto load CFM LIbraries that we are notified about
  713.     Open Doc users:
  714.     Name your .sym files as Libname.xSym and they will get loaded Automatically
  715.     when the OpenDoc part loads.
  716.  
  717. FIX - Watchpoint to make more reliable, remove warning window
  718.  
  719. fix - Step Into $AAFE (_MixedModeMagic) traps ( 68K -> PPC transitions ) now works
  720.  
  721. fix - change Cursor handling to eliminate turds on PB 5xx Macs
  722.  
  723. fix - when Interrupting a Mac running PowerPC code, xfer to it
  724.  
  725. fix - stack crawl to handle both type of MixedMode switch frames
  726. fix - Discipline & Block Zapping - account for Modern Memory Mgr
  727. fix    - Discipline & ioNamePtr - names can be in ROM
  728. fix -?stack - not processing 3rd arg properly
  729. fix - addresses were truncated to 24 bit values in unstructured asm windows
  730.  
  731. ••••• Current Fixes/changes - 11/19 •••••
  732.  
  733. fix - delete Bkpt's from memory image when deleting a task
  734.  
  735. ••••• Fixes/changes since 11/15 •••••
  736.  
  737. fix - off by 1 in Target Lib command changes - incorrect data seg addr
  738.  
  739. fix - add a 'ppat' resource to Dbgr so it doesn't clear DeskCPat
  740.  
  741. fix - ignore DiskEvents so we don't lose them when we stop at INIT time.
  742.  
  743. ••••• Fixes/changes since 10/17/94 •••••
  744.  
  745. fix - auto unload PPC targeted tasks properly
  746.  
  747. fix - allow absolute address Breakpoints above 16 Meg
  748.                 display instructions & Bkpts properly in asm windows
  749.  
  750. fix - not listing fields of array properly so they could be modified
  751.  
  752. fix - allow Local Vars window to retain it's All or 1 frame mode
  753.                 when it becomes dynamic 
  754.  
  755. fix - allow modification of vars in other than the 1st frame.
  756.                 NOTE: You can't modify Reg Vars in other than Current proc.
  757.  
  758. fix - blowup in _CloseResFile when trying to do SysBeep in 7.5 on IIfx, IIci
  759.  
  760. fix - PACK 3 so we don't get an error trying to access the PowerTalk volumes
  761.  
  762. fix - Garbage task in task tbl due to MF's heap moving when Modern Mem Mgr
  763.         also cleanup code in Add_AuxTask which was incorrect
  764.  
  765. • extend Target Lib to handle 68K Libs & libs with multiple exec segs
  766.  
  767. fix - ignore SameProcess calls inside Dbgr as Wacom are asshole's
  768.  
  769. fix - problems with Metrowerks .SYM files overflowing NTE limits, etc
  770.  
  771. fix - Undo processing in text windows & memory leaks
  772.             cmd-delete or Clear forces shrinking of the Text buffer
  773.  
  774. fix - screwed type processing when 1st type was a dup type
  775.  
  776. ••••• Fixes/changes since 10/10/94 ••••• 
  777.  
  778. fix - remove code to play with GetResource patch as it assumed Dbgr's
  779.         patch was 1st on the chain.
  780.         Fixes problems with System 7.5 & Apple Menu Options
  781.  
  782. fix - a bug in PPC WatchPoint that caused it to hang
  783.  
  784. • add ?stack(fba,stk_top,is_PPC) command to dump an arbitrary stack
  785.     if stk_top = 0 then stk_top := fba + 0C00,
  786.     is_PPC = 1 for stack that starts with PPC stack frames.
  787.     NOTE:  This could be useful for Thread Mgr debugging.
  788.  
  789. • Cmd_Key_Plus flag - If FrontWindow is Read_only then 'Cmd key' is added
  790.         to any Key press except 'e' and period.
  791.         You may turn this option OFF with the 'Cmd_Key_Plus' flag.
  792.     NOTE
  793.         a) remove the PLI_Buf flag from your ROM.dsi
  794.         b) This option is more convenient than Function Keys for stepping
  795.  
  796. fix - protect against OSDispatch calls inside The Debugger's environment
  797.     by returning 'No such process' for GetFrontProcess, GetNextProcess, …
  798.     Fixes problems with MS Word 6 and FileSharing, etc.
  799.  
  800. ••••• Fixes/changes since 9/30/94 ••••• 
  801.  
  802. fix - Metrowerks Global Vars above A5 now works.
  803.  
  804. fix - Allowing periods in the  middle of names broke 'Struct.field' in parser, etc
  805.         Restrict name syntax to: 'xxx.nn' where n is a number
  806.  
  807. fix - handle 4 byte enums in SYM files correctly
  808.  
  809. Flag CFM Libraries in the Heap Display as: ' CFM Lib: pwpc' 
  810.     Ω-G - search for symName if addr is in a CFM Library or ROM (like Frown dcmd )
  811.  
  812. Change default NTE Cutoff to $CE00
  813.  
  814. fix - incorrect tabbing in writable windows, also set dialog box properly
  815.  
  816. fix - stepping into a JSR d(A5) didn't alway work
  817.  
  818. fix - MacApp Object displays - prefix window with task number (name too wide),
  819.         make class tree work for specified subtree, fix Methods of for PPC tasks
  820.  
  821. fix - speed up Cmd-D 'by name' search by NOT searching for a ROM name
  822.             unless already in the ROM task
  823.  
  824. ••••• To update your version of The Debugger••••••:
  825.  
  826. A) Open up the folder 'Dbgr/Nosy files' and 
  827.    change the name of of the 9/30/94 version of 'The Debugger'
  828.    to: '9/30/94 The Debugger'
  829.  
  830. B) Dbl-click on the UpdateMaker file '12_08_Dbgr_Patch'
  831.    to create a new version of 'The Debugger' 
  832.      (in the 'Dbgr/Nosy files' folder).
  833.  
  834. • NOTE: If the patch program complains that FONT resources
  835. • don't match, then try Booting with Extensions OFF
  836. • (shift key down while booting) and try the Updater again.
  837.  
  838.  
  839. You may verify that you are running the newer version
  840. of The Debugger by checking the 4th line of the '-Notes-'
  841. window when you re-boot with The Debugger installed.
  842.  
  843. It should read:
  844. USR_SG =   nnnn The Debugger - V2.7.5-PPC 12/8/94
  845.                                           -------
  846. Steve Jasik
  847. -- 
  848. Francois Pottier                                            pottier@dmi.ens.fr
  849. - ----------------------------------------------------------------------------
  850. Check my WWW page at http://acacia.ens.fr:8080/home/pottier/index.html ...
  851.  
  852. ---------------------------
  853.  
  854. >From brianv@serv0.cae.wisc.edu (brianv)
  855. Subject: Mounting Appleshare Volumes
  856. Date: 7 Dec 1994 23:50:08 GMT
  857. Organization: Division of Information Technology
  858.  
  859. Hello, 
  860. I have been fighting with my mac trying to get it to mount an
  861. Appleshare volume located on an ethernet network using the command
  862. PBVolumeMount().
  863. However, I haven't had any luck.  Can anyone send me some code where
  864. they have had success doing this? 
  865.  
  866. Thanks,
  867. Brian Vanderpool
  868. brianv@cae.wisc.edu
  869.  
  870. +++++++++++++++++++++++++++
  871.  
  872. >From quinn@cs.uwa.edu.au (Quinn "The Eskimo!")
  873. Date: Sun, 11 Dec 1994 15:50:34 +0800
  874. Organization: Department of Computer Science, University of Western Australia
  875.  
  876. In article <3c5hng$ghd@news.doit.wisc.edu>, brianv@serv0.cae.wisc.edu
  877. (brianv) wrote:
  878.  
  879. >I have been fighting with my mac trying to get it to mount an
  880. >Appleshare volume located on an ethernet network using the command
  881. >PBVolumeMount().
  882.  
  883. Did this just the other day...
  884.  
  885.   function MountAFPVolume(zone, server, vol, user, password : Str32;
  886.                var mountedVRefNum : integer) : OSErr;
  887.     var
  888.       info: AFPVolMountInfo;
  889.       cur_offset: integer;
  890.  
  891.     function CopyString (s: Str32): integer;
  892.     begin
  893.       CopyString := cur_offset + 23;      (* 23 = header size - 1 (because
  894. the AFPData array is 1 based) *)
  895.       BlockMove(@s, @info.AFPData[cur_offset], length(s) + 1);
  896.       cur_offset := cur_offset + length(s) + 1;
  897.     end; (* CopyString *)
  898.  
  899.     var
  900.       pb: ParamBlockRec;
  901.       err : OSErr;
  902.   begin
  903.     mountedVRefNum := 0;
  904.     info.length := sizeof(info);
  905.     info.media := AppleShareMediaType;
  906.     info.flags := 0;
  907.     info.nbpInterval := 0;
  908.     info.nbpCount := 0;
  909.     info.uamType := kTwoWayEncryptPassword;
  910.     cur_offset := 1;
  911.     info.zoneNameOffset := CopyString(zone);
  912.     info.serverNameOffset := CopyString(server);
  913.     info.volNameOffset := CopyString(vol);
  914.     info.userNameOffset := CopyString(user);
  915.     info.userPasswordOffset := CopyString(password);
  916.     info.volPasswordOffset := CopyString('');
  917.     with pb do begin (* safe *)
  918.       pb.ioBuffer := @info;
  919.     end; (* with *)
  920.     err := PBVolumeMount(@pb);
  921.     if err = noErr then begin
  922.       mountedVRefNum := pb.ioVRefNum;
  923.     end; (* if *)
  924.     MountAFPVolume := err;
  925.   end; (* MountAFPVolume *)
  926.  
  927. Share and Enjoy.
  928. --
  929. Quinn "The Eskimo!"                   "Ah ha, the carnage begins!"
  930.  
  931. +++++++++++++++++++++++++++
  932.  
  933. >From jumplong@aol.com (Jump Long)
  934. Date: 12 Dec 1994 00:40:15 -0500
  935. Organization: America Online, Inc. (1-800-827-6364)
  936.  
  937. In article <3c5hng$ghd@news.doit.wisc.edu>, brianv@serv0.cae.wisc.edu
  938. (brianv) writes:
  939.  
  940. >I have been fighting with my mac trying to get it to mount an Appleshare
  941. >volume located on an ethernet network using the command PBVolumeMount().
  942. >However, I haven't had any luck.  Can anyone send me some code where
  943. >they have had success doing this? 
  944.  
  945. Brian, Apple's sample code MoreFiles has a routine named
  946. BuildAFPVolMountInfo which will correctly built the mounting record for
  947. you. MoreFiles also has a high-level version of PBVolumeMount that you
  948. might find useful.
  949.  
  950. If you need the user to enter their name and password, you can let the
  951. system take care of that for you by using NewAliasMinimalFromFullPath and
  952. then ResolveAlias.
  953.  
  954. - Jim Luther
  955.  
  956. ---------------------------
  957.  
  958. >From scouten@uiuc.edu (Eric Scouten)
  959. Subject: PUZZLER: How to get to A5 world in _ExitToShell patch
  960. Date: Tue, 06 Dec 1994 16:55:05 -0600
  961. Organization: University of Illinois
  962.  
  963. Howdy,
  964.  
  965. I have an application that sets up lots of interrupt-level stuff
  966. (particularly sound channels). These, of course, have lots of asynchronous
  967. callback routines.
  968. To avoid the problem of leaving these things hanging when somebody (often
  969. myself, via the debugger or MacsBug) aborts the application via
  970. ExitToShell, I'm writing an ETS patch.
  971.  
  972. All works fine when I do kill process from the MW Debugger, but *most* of
  973. the time when I hit the programmer's switch and do "es" from MacsBug, the
  974. A5 world is off the wall. (From what I can tell, I hit the NMI while the
  975. Toolbox was doing something for my app.) I need A5 to get to my list of
  976. things to close, but I can't figure any way to save a copy of A5 for
  977. myself. Static variables won't do, since they're all A5-indexed; the usual
  978. trick of extending the parameter block (for Time Manager tasks, etc., as
  979. documented in Develop) won't work since ETS has no parameter block.
  980.  
  981. So I'm confused... anybody got bright ideas?
  982.  
  983. -es
  984.  
  985. __________________________________________________________________________
  986. Eric Scouten <scouten@uiuc.edu> * MS Comp Sci '96, Univ of Illinois
  987.  
  988. Universities seem happiest when they are closest to anarchy.
  989.    -Bill DiBrito
  990.  
  991. +++++++++++++++++++++++++++
  992.  
  993. >From Matt Slot <fprefect@engin.umich.edu>
  994. Date: 7 Dec 1994 00:38:17 GMT
  995. Organization: University of Michigan
  996.  
  997. There is a lomem global called CurrentA5 which saves the valid A5 from the
  998. current context.
  999.  
  1000. That should do it.
  1001.  
  1002. Matt
  1003.  
  1004. +++++++++++++++++++++++++++
  1005.  
  1006. >From scouten@uiuc.edu (Eric Scouten)
  1007. Date: Tue, 06 Dec 1994 21:15:08 -0600
  1008. Organization: University of Illinois
  1009.  
  1010. In article <3c305p$2ju@controversy.math.lsa.umich.edu>, Matt Slot
  1011. <fprefect@engin.umich.edu> wrote:
  1012.  
  1013. > There is a lomem global called CurrentA5 which saves the valid A5 from the
  1014. > current context.
  1015.  
  1016. Duhhh... of course. Thanks for reminding me. :)
  1017.  
  1018. Must have been the lack of sleep.
  1019.  
  1020. -es
  1021.  
  1022. __________________________________________________________________________
  1023. Eric Scouten <scouten@uiuc.edu> * MS Comp Sci '96, Univ of Illinois
  1024.  
  1025. We're putting out fires with gasoline.
  1026.    -David Bowie
  1027.  
  1028. +++++++++++++++++++++++++++
  1029.  
  1030. >From gurgle@dnai.com (Pete Gontier)
  1031. Date: Tue, 06 Dec 1994 20:40:56 -0700
  1032. Organization: cellular
  1033.  
  1034. In article <scouten-0612941655050001@saguaro.cso.uiuc.edu>,
  1035. scouten@uiuc.edu (Eric Scouten) wrote:
  1036.  
  1037. > I have an application that sets up lots of interrupt-level stuff
  1038. > (particularly sound channels)... To avoid the problem of leaving
  1039. > these things hanging (upon an unexpected call to) ExitToShell,
  1040. > I'm writing an ETS patch.
  1041. > All works fine when I do kill process from the MW Debugger, but *most* of
  1042. > the time when I hit the programmer's switch and do "es" from MacsBug, the
  1043. > A5 world is off the wall.
  1044.  
  1045. The programmer's switch induces an NMI regardless of the code being
  1046. executed. It may be the code from some other app, it may be trap code, it
  1047. may be one of your completion routines -- anything. So yes, A5 can be
  1048. wacky when you hit that NMI.
  1049.  
  1050. However, this is not a problem having to do with A5, really. The real
  1051. problem is the fact that you are inducing that NMI when code other than
  1052. that of your app is running. Doing an 'es' under these circumstances is
  1053. dangerous for a number of reasons, *not* the most important of which is
  1054. that A5 is not set up correctly (because you can easily fix that in your
  1055. patch by -- theoretically -- getting the "correct" value from the low
  1056. memory global CurrentA5). It may also be the case that your app's heap is
  1057. not the current heap, your app's copy of the low memory globals has not
  1058. been swapped in, and a number of other things, some of which only Apple
  1059. engineers are aware.
  1060.  
  1061. So the problem is not your patch but the timing of your 'es' command.
  1062.  
  1063. What I do to insure everything is set up correctly for me to do an 'es'
  1064. against any app is to drag a window or pull down a menu, keeping the mouse
  1065. button held down, invoke MacsBug (most often by holding down the command
  1066. key with my free thumb and depressing the power key with my nose), type
  1067. 'atba', command-G, and release the mouse. (Probably I had to release the
  1068. mouse to type the MacsBug command, but you get the idea.) The click/hold
  1069. sequence ensures that the front app is the current app. As soon as the app
  1070. calls its next trap (probably the one right after DragWindow or
  1071. MenuSelect), MacsBug steps in. Then I know it's probably a little more
  1072. safe to do 'es'. If it's my app, then I know for sure it's safe, because
  1073. I've patched ExitToShell like you are doing. :-)
  1074.  
  1075. +++++++++++++++++++++++++++
  1076.  
  1077. >From alexm@cts.com (Alex Maluta)
  1078. Date: Wed, 7 Dec 1994 09:38:40 GMT
  1079. Organization: /etc/organization
  1080.  
  1081. Eric,
  1082.  
  1083. > All works fine when I do kill process from the MW Debugger, but *most* of
  1084. > the time when I hit the programmer's switch and do "es" from MacsBug, the
  1085. > A5 world is off the wall. (From what I can tell, I hit the NMI while the
  1086. > Toolbox was doing something for my app.) I need A5 to get to my list of
  1087. > things to close, but I can't figure any way to save a copy of A5 for
  1088. > myself. Static variables won't do, since they're all A5-indexed; the usual
  1089. > trick of extending the parameter block (for Time Manager tasks, etc., as
  1090. > documented in Develop) won't work since ETS has no parameter block.
  1091.  
  1092. I haven't tried this in exactly your case, but a quick look at TCL 1.1.3
  1093. (which does patch ExitToShell) shows that they get at globals by simply
  1094. calling SetCurrentA5().  It's too early in the morning for me to figure
  1095. out if this is exactly what you're looking for, but hopefully it'll help.
  1096.  
  1097. -Alex
  1098.  
  1099. +++++++++++++++++++++++++++
  1100.  
  1101. >From hawkfish@halcyon.com (Richard Wesley)
  1102. Date: 7 Dec 1994 15:41:48 GMT
  1103. Organization: Punch Deck Consulting
  1104.  
  1105. In article <scouten-0612941655050001@saguaro.cso.uiuc.edu>
  1106. scouten@uiuc.edu (Eric Scouten) writes:
  1107.  
  1108. > All works fine when I do kill process from the MW Debugger, but *most* of
  1109. > the time when I hit the programmer's switch and do "es" from MacsBug, the
  1110. > A5 world is off the wall. (From what I can tell, I hit the NMI while the
  1111. > Toolbox was doing something for my app.) I need A5 to get to my list of
  1112. > things to close, but I can't figure any way to save a copy of A5 for
  1113. > myself. Static variables won't do, since they're all A5-indexed; the usual
  1114. > trick of extending the parameter block (for Time Manager tasks, etc., as
  1115. > documented in Develop) won't work since ETS has no parameter block.
  1116.  
  1117. Try using SetCurrentA5.
  1118.  
  1119. rmgw
  1120.  
  1121. +++++++++++++++++++++++++++
  1122.  
  1123. >From Matt Slot <fprefect@engin.umich.edu>
  1124. Date: 7 Dec 1994 20:49:06 GMT
  1125. Organization: University of Michigan
  1126.  
  1127. Pete Gontier, gurgle@dnai.com writes:
  1128.  > However, this is not a problem having to do with A5, really. The real
  1129.  > problem is the fact that you are inducing that NMI when code other than
  1130.  > that of your app is running. Doing an 'es' under these circumstances is
  1131.  > dangerous for a number of reasons, *not* the most important of which is
  1132.  > that A5 is not set up correctly (because you can easily fix that in your
  1133.  > patch by -- theoretically -- getting the "correct" value from the low
  1134.  > memory global CurrentA5). It may also be the case that your app's heap is
  1135.  > not the current heap, your app's copy of the low memory globals has not
  1136.  > been swapped in, and a number of other things, some of which only Apple
  1137.  > engineers are aware.
  1138.  
  1139. If I use the debugger to 'es', it will kill the current app -- not the
  1140. owner of the interrupt based routine you are in -- based on the switched in
  1141. heap. You shouldn't have to worry about being exited when your app isn't
  1142. in context. (I believe this, but have no confirmation).
  1143.  
  1144. Doing an 'es' from anyone else's context should be safe enough to your 
  1145. interrupt routines if you have placed them in your heap or the system heap --
  1146. but don't trust another app's heap, that would be bad. If you don't
  1147. care for cleanliness and don't depend on globals from your app's heap, 
  1148. you can place your buffers/routines in the system heap. When you drop out,
  1149. they will simply keep operating -- I know its not pretty, but fairly quick
  1150. and safe.
  1151.  
  1152. The only issue is to restore a valid globals context when you get the
  1153. 'es' when your app is current, so that you can get the info about those
  1154. routines you installed.
  1155.  
  1156. Matt
  1157.  
  1158. +++++++++++++++++++++++++++
  1159.  
  1160. >From reinder@neuretp.biol.ruu.nl (Reinder Verlinde)
  1161. Date: Thu, 8 Dec 1994 19:00:32 GMT
  1162. Organization: Rijksuniversiteit Utrecht
  1163.  
  1164. In article <gurgle-0612942040560001@mac.kat.gurgle>, gurgle@dnai.com (Pete
  1165. Gontier) wrote:
  1166.  
  1167. > ...
  1168. > What I do to insure everything is set up correctly for me to do an 'es'
  1169. > against any app is to drag a window or pull down a menu, keeping the mouse
  1170. > button held down, invoke MacsBug (most often by holding down the command
  1171. > key with my free thumb and depressing the power key with my nose), type
  1172. > 'atba', command-G, and release the mouse. (Probably I had to release the
  1173. > mouse to type the MacsBug command, but you get the idea.) The click/hold
  1174. > sequence ensures that the front app is the current app. As soon as the app
  1175. > calls its next trap (probably the one right after DragWindow or
  1176. > MenuSelect), MacsBug steps in. Then I know it's probably a little more
  1177. > safe to do 'es'. If it's my app, then I know for sure it's safe, because
  1178. > I've patched ExitToShell like you are doing. :-)
  1179. >
  1180. > ...
  1181.  
  1182. The easier way to obtain the same result is to use a FKEY to enter MacsBug.
  1183. To prevent nasty surprises when MacsBug is not installed (which should not
  1184. happen often) one should use a FKEY like:
  1185.  
  1186. #define MacJmp 0x120
  1187.  
  1188. void main()
  1189. {
  1190.     asm
  1191.     {
  1192.         move.l  MacJmp,D0
  1193.         and.l   #0x7FFFFFFF,D0
  1194.         beq.s   @noDebuggerPresent
  1195.         dc.w    _Debugger
  1196.         rts
  1197.     
  1198.     noDebuggerPresent:
  1199.         Move.w  #0x09,-(sp)
  1200.         dc.w    _SysBeep
  1201. //      rts     automatically included at end by Think C
  1202.     }
  1203. }
  1204.  
  1205. or in hex (can be pasted into an empty FKEY resource in ResEdit):
  1206.  
  1207. 2038012002807FFFFFFF6704A9FF4E753F3C0009A9C84E75
  1208.  
  1209. I don't know whether it works with all debuggers, but it does work
  1210. fine for me (I got the information on Debugger detection from an Apple
  1211. Technote called 'PT 535 - MacsBug Q&As'. I'm not sure whether I
  1212. followed the note completely; I remember detecting an inconsistency
  1213. between its text and some Macs I examined)
  1214.  
  1215. Reinder Verlinde
  1216.  
  1217. +++++++++++++++++++++++++++
  1218.  
  1219. >From gurgle@dnai.com (Pete Gontier)
  1220. Date: Tue, 13 Dec 1994 15:24:44 -0700
  1221. Organization: cellular
  1222.  
  1223. In article <reinder-0812942000320001@neuretc.biol.ruu.nl>, 
  1224. reinder@neuretp.biol.ruu.nl (Reinder Verlinde) wrote:
  1225.  
  1226. > The easier way to obtain the same result is to use a FKEY to enter MacsBug.
  1227.  
  1228. Yes, but...
  1229.  
  1230.    (1) FKEYs don't work unless GNE is getting called periodicially.
  1231.    (2) I *like* hitting the power key with my nose. Who are you to
  1232.        tell me I shouldn't? :-)
  1233.  
  1234. -- 
  1235.  
  1236.  Pete Gontier // MacZealotry, Ink. // gurgle@dnai.com
  1237.  
  1238.  Where do I want to go today? Anywhere but Chicago.
  1239.  
  1240. +++++++++++++++++++++++++++
  1241.  
  1242. >From dnebing@andy.bgsu.edu (bgsuvax)
  1243. Date: 9 Dec 1994 23:39:27 GMT
  1244. Organization: Bowling Green State University
  1245.  
  1246. scouten@uiuc.edu (Eric Scouten) writes:
  1247. > Howdy,
  1248. > I have an application that sets up lots of interrupt-level stuff
  1249. > (particularly sound channels). These, of course, have lots of asynchronous
  1250. > callback routines.
  1251. > To avoid the problem of leaving these things hanging when somebody (often
  1252. > myself, via the debugger or MacsBug) aborts the application via
  1253. > ExitToShell, I'm writing an ETS patch.
  1254.  
  1255.   The following code works well for me...
  1256.  
  1257.   There are two functions to this.  The first is InstallExitToShellPatch
  1258. which takes a procedure pointer for the procedure that you want to
  1259. to be called when the app is quitting.  InstallExitToShellPatch patches
  1260. ExitToShell to call the second function, CallExitToShells.
  1261.  
  1262. How it works:
  1263.  
  1264.   InstallExitToShellPatch builds a list of procedure pointers.  Every
  1265. time that you call InstallExitToShellPatch, the procedure is added
  1266. to the queue.  When your app quits and the CallExitToShells procedure
  1267. is called, it sets up the A5 world and then starts calling the procedures
  1268. in the list (last in, first out).
  1269.  
  1270.   Three files are included.  ExitToShell Patch.c and ExitToShell Patch.h,
  1271. as well as a small file (named main.c) that demonstrates how to use
  1272. the routines.
  1273.  
  1274. Enjoy,
  1275.  
  1276.   Dave
  1277.  
  1278. ============================================================
  1279. Dave Nebinger                    dnebing@bgsuvax.bgsu.edu
  1280. Network Manager, Biology Dept.   dnebing@opie.bgsu.edu
  1281. Bowling Green State University   dnebing@bgsuopie (bitnet)
  1282. Bowling Green, OH 43403          #include <std_disclaimer.h>
  1283.  
  1284.             Mighty 'Moof-in' PowerPC Ranger
  1285.  
  1286. /*
  1287.     ExitToShell Patch.h
  1288.  
  1289.     Header file for ExitToShell Patch.c
  1290.  
  1291. */
  1292.  
  1293. #pragma once
  1294.  
  1295. #ifndef __H_ExitToShell_Patch__
  1296. #define __H_ExitToShell_Patch__
  1297.  
  1298. #include <Memory.h>
  1299. #include <SegLoad.h>
  1300.  
  1301. typedef pascal void (*ExitToShellProcPtr)(void);
  1302.  
  1303. enum {
  1304.     uppExitToShellProcInfo = kPascalStackBased
  1305. };
  1306.  
  1307. #if USESROUTINEDESCRIPTORS
  1308. typedef UniversalProcPtr ExitToShellUPP;
  1309.  
  1310. #define CallExitToShellProc(userRoutine)    \
  1311.     CallUniversalProcPtr((UniversalProcPtr)(userRoutine),uppExitToShellProcInfo)
  1312. #define NewExitToShellProc(userRoutine)    \
  1313.     (ExitToShellUPP)NewRoutineDescriptor((ProcPtr)(userRoutine),uppExitToShellProcInfo,\
  1314.         GetCurrentISA())
  1315.  
  1316. #else
  1317. typedef ExitToShellProcPtr ExitToShellUPP;
  1318.  
  1319. #define CallExitToShellProc(userRoutine)    \
  1320.     (*(userRoutine))()
  1321. #define NewExitToShellProc(userRoutine)    \
  1322.     (ExitToShellUPP)(userRoutine)
  1323. #endif
  1324.  
  1325. #define DisposeExitToShellProc(userRoutine)\
  1326.     DisposeRoutineDescriptor(userRoutine)
  1327.  
  1328. #if defined(powerc)||defined(__powerc)
  1329. #pragma options align=mac68k
  1330. #endif
  1331. struct ExitToShellUPPList{
  1332.     struct ExitToShellUPPList* nextProc;
  1333.     ExitToShellUPP userProc;
  1334. };
  1335. #if defined(powerc)||defined(__powerc)
  1336. #pragma options align=reset
  1337. #endif
  1338.  
  1339. typedef struct ExitToShellUPPList ExitToShellUPPList,* ExitToShellUPPListPtr,** ExitToShellUPPHdl;
  1340.  
  1341. #if defined(powerc)||defined(__powerc)
  1342. #pragma options align=mac68k
  1343. #endif
  1344. struct ExitToShellDataStruct{
  1345.     unsigned long a5;
  1346.     short numUserProcs;
  1347.     ExitToShellUPPList* userProcs;
  1348.     ExitToShellUPP oldProc;
  1349. };
  1350. #if defined(powerc)||defined(__powerc)
  1351. #pragma options align=reset
  1352. #endif
  1353.  
  1354. typedef struct ExitToShellDataStruct ExitToShellDataRec,* ExitToShellDataPtr,** ExitToShellDataHdl;
  1355.  
  1356. extern ExitToShellDataPtr gExitToShellData;
  1357.  
  1358. #ifdef __cplusplus
  1359. extern "C" {
  1360. #endif
  1361.  
  1362. OSErr InstallExitToShellPatch(ExitToShellProcPtr newProc);
  1363. static pascal void CallExitToShells(void);
  1364.  
  1365. #ifdef __cplusplus
  1366. }
  1367. #endif
  1368.  
  1369. #endif
  1370.  
  1371.  
  1372.  
  1373. /****************  End Of File! ***************/
  1374.  
  1375.  
  1376. /*
  1377.     ExitToShell Patch.c
  1378.  
  1379.     Patches ExitToShell to call a user routine.  With the advent of UPPs and MixedMode, it gets
  1380.     harder to patch things correctly.  Anyway, InstallExitToShellPatch takes an 'old' ProcPtr and
  1381.     creates the necessary UPP which NSetTrapAddress now requires.  Hopefully everything is
  1382.     done correctly... ;-)  CallExitToShells, the intermediary procedure, ensures that A5 is set
  1383.     up correctly for the application before calling the custom ExitToShell routine.
  1384.  
  1385.     8/14/94 dn - Created.
  1386.  
  1387.     11/31/94 dn - Major modifications!
  1388.         Modified to allow multiple ExitToShell patches.  Basically, this just builds a list of procedures to
  1389.         call before exiting the program.
  1390. */
  1391.  
  1392. #include "ExitToShell Patch.h"
  1393.  
  1394. static ExitToShellDataPtr gExitToShellData=(ExitToShellDataPtr)0L;
  1395.  
  1396. /*
  1397.     InstallExitToShellPatch
  1398.  
  1399.     Installs the ExitToShell patch (obviously ;-).  In the data structure for gExitToShellData is stored the
  1400.     current value of the A5 register, the UPP for the routine that should be called first, then the UPP for
  1401.     the routine that was originally there.  ExitToShell is then patched to call the 'CallExitToShells' which
  1402.     handles all of the garbage for setting up the A5 register, etc., before calling the two routines.
  1403.  
  1404.     (patching ExitToShell info/example comes from TCL 1.1.3 CApplication.c, ) Symantec, Inc.)
  1405. */
  1406. OSErr InstallExitToShellPatch(ExitToShellProcPtr newProc){
  1407.     short etsTrap;
  1408.     ExitToShellUPP oldETS,newETS,callETS;
  1409.     ExitToShellUPPListPtr lp;
  1410.     long oldETSTrap,newETSTrap;
  1411.     OSErr err;
  1412.  
  1413.     if (gExitToShellData==(ExitToShellDataPtr)0L){
  1414.         // the patches have not been initialized, set it up first...
  1415.  
  1416.         // allocate the memory to hold the information...
  1417.         gExitToShellData=(ExitToShellDataPtr)NewPtr(sizeof(ExitToShellDataRec));
  1418.  
  1419.         // save the value of register a5
  1420.         gExitToShellData->a5=SetCurrentA5();
  1421.  
  1422.         // init the number of user procs.
  1423.         gExitToShellData->numUserProcs=0;
  1424.         gExitToShellData->userProcs=(ExitToShellUPPList*)0L;
  1425.  
  1426.         // now set up the UPP for the original ExitToShell
  1427.         etsTrap=_ExitToShell & 0x3ff;                                // set up trap value...
  1428.         callETS=NewExitToShellProc(CallExitToShells);                    // get the UPP for intermediary proc
  1429.         oldETS=(ExitToShellUPP)NGetTrapAddress(etsTrap,ToolTrap);        // get the old trap UPP...
  1430.         NSetTrapAddress((UniversalProcPtr)callETS,etsTrap,ToolTrap);    // set to the intermediary proc
  1431.         gExitToShellData->oldProc=oldETS;                            // save the old ETS UPP
  1432.  
  1433.     }
  1434.  
  1435.     // get the upp for the new replacement proc
  1436.     newETS=NewExitToShellProc(newProc);
  1437.  
  1438.     // allocate a new node...
  1439.     lp=(ExitToShellUPPListPtr)NewPtrClear(sizeof(ExitToShellUPPList));
  1440.     lp->userProc=newETS;
  1441.  
  1442.     // put it into the chain...
  1443.     lp->nextProc=gExitToShellData->userProcs;
  1444.     gExitToShellData->userProcs=lp;
  1445.     gExitToShellData->numUserProcs++;
  1446.  
  1447.     return noErr;
  1448. }
  1449.  
  1450. /*
  1451.     CallExitToShells
  1452.  
  1453.     First this routine calls the user's ExitToShell routines, then it calls the original
  1454.     ExitToShell trap routine.  That's why it is referred to as the intermediary procedure
  1455.     in InstallETSPatch.
  1456. */
  1457. static pascal void CallExitToShells(){
  1458.     OSErr err,err2;
  1459.     long oldA5=SetCurrentA5(); // get the current value for register A5 and set it to the application's A5
  1460.     ExitToShellUPP oldETS;
  1461.     ExitToShellUPPListPtr nextProc,curProc;
  1462.  
  1463.     SetA5(gExitToShellData->a5);
  1464.  
  1465.     if (gExitToShellData->numUserProcs>0){
  1466.         // call the user's routines
  1467.  
  1468.         // get the first routine
  1469.         curProc=gExitToShellData->userProcs;
  1470.  
  1471.         // loop though the procedures...
  1472.         do {
  1473.             // set up for the next routine
  1474.             nextProc=curProc->nextProc;
  1475.  
  1476.             // call the procedure
  1477.             CallExitToShellProc(curProc->userProc);
  1478.  
  1479.             // dispose of the UPP
  1480.             DisposeExitToShellProc(curProc->userProc);
  1481.  
  1482.             // dispose of the list entry
  1483.             DisposePtr((Ptr)curProc);
  1484.  
  1485.             curProc=nextProc;
  1486.         } while (curProc!=(ExitToShellUPPListPtr)0L);
  1487.         // done!
  1488.     }
  1489.  
  1490.     // prepare to call the original ExitToShell
  1491.     oldETS=gExitToShellData->oldProc;
  1492.  
  1493.     // dispose of the memory gExitToShellData holds
  1494.     DisposePtr((Ptr)gExitToShellData);
  1495.  
  1496.     // restore the old a5
  1497.     SetA5(oldA5);
  1498.  
  1499.     // now call the original ExitToShell
  1500.     CallExitToShellProc(oldETS);
  1501.  
  1502.     return;
  1503. }
  1504.  
  1505.  
  1506.  
  1507. /***********  End Of File! **************/
  1508.  
  1509.  
  1510. /*
  1511.     main.c
  1512.  
  1513. */
  1514.  
  1515. #include "ExitToShell Patch.h"
  1516.  
  1517. pascal void proc1(void);
  1518. pascal void proc2(void);
  1519. pascal void proc3(void);
  1520.  
  1521. main(){
  1522.  
  1523.     InitMac();// self explanatory
  1524.  
  1525.     InstallExitToShellPatch(proc1);
  1526.  
  1527.     InstallExitToShellPatch(proc2);
  1528.  
  1529.     InstallExitToShellPatch(proc3);
  1530.  
  1531. }
  1532.  
  1533. pascal void proc1(){
  1534.     long time;
  1535.  
  1536.     SysBeep();
  1537.     Delay(120,&time); // needed to get the beeps to happen
  1538. }
  1539.  
  1540. pascal void proc2(){
  1541.         long time;
  1542.  
  1543.         SysBeep();
  1544.         SysBeep();
  1545.         Delay(120,&time); // needed to get the beeps to happen
  1546. }
  1547.  
  1548. pascal void proc3(){
  1549.         long time;
  1550.  
  1551.         SysBeep();
  1552.         SysBeep();
  1553.         SysBeep();
  1554.         Delay(120,&time); // needed to get the beeps to happen
  1555. }
  1556.  
  1557.  
  1558. +++++++++++++++++++++++++++
  1559.  
  1560. >From phils@bedford.symantec.com (Phil Shapiro)
  1561. Date: Fri, 16 Dec 1994 10:07:02 -0500
  1562. Organization: Symantec Corp.
  1563.  
  1564. In article <3caprf$bf@falcon.bgsu.edu>, dnebing@andy.bgsu.edu (bgsuvax) wrote:
  1565.  
  1566. | scouten@uiuc.edu (Eric Scouten) writes:
  1567. | > I have an application that sets up lots of interrupt-level stuff
  1568. | > (particularly sound channels). These, of course, have lots of asynchronous
  1569. | > callback routines.
  1570. | > To avoid the problem of leaving these things hanging when somebody (often
  1571. | > myself, via the debugger or MacsBug) aborts the application via
  1572. | > ExitToShell, I'm writing an ETS patch.
  1573. |   The following code works well for me...
  1574. |   There are two functions to this.  The first is InstallExitToShellPatch
  1575. | which takes a procedure pointer for the procedure that you want to
  1576. | to be called when the app is quitting.  InstallExitToShellPatch patches
  1577. | ExitToShell to call the second function, CallExitToShells.
  1578. | How it works:
  1579. |   InstallExitToShellPatch builds a list of procedure pointers.  Every
  1580. | time that you call InstallExitToShellPatch, the procedure is added
  1581. | to the queue.  When your app quits and the CallExitToShells procedure
  1582. | is called, it sets up the A5 world and then starts calling the procedures
  1583. | in the list (last in, first out).
  1584. |   Three files are included.  ExitToShell Patch.c and ExitToShell Patch.h,
  1585. | as well as a small file (named main.c) that demonstrates how to use
  1586. | the routines.
  1587.  
  1588. Anyone who has THINK C or Symantec C++ already has this -- it's called
  1589. "atexit()". If you register a function with atexit(), it's called at
  1590. ExitToShell time with the correct A5, automatically.
  1591.  
  1592. It doesn't support PowerPC patching of ETS, though. I believe that the CDK
  1593. comes with a PowerPC version of atexit() that uses __term instead of
  1594. patching ETS.
  1595.  
  1596.    -phil
  1597.  
  1598. +++++++++++++++++++++++++++
  1599.  
  1600. >From dnebing@andy.bgsu.edu (bgsuvax)
  1601. Date: 16 Dec 1994 19:49:08 GMT
  1602. Organization: Bowling Green State University
  1603.  
  1604. phils@bedford.symantec.com (Phil Shapiro) writes:
  1605. > Anyone who has THINK C or Symantec C++ already has this -- it's called
  1606. > "atexit()". If you register a function with atexit(), it's called at
  1607. > ExitToShell time with the correct A5, automatically.
  1608.  
  1609.   Yes, but:
  1610.  
  1611.     1. you need TC or SymC++ (I do)
  1612.     2. you need the ANSI baggage
  1613.  
  1614.   It was mostly for #2 that I put the code together.  I have the
  1615. UPP code worked out for PPC patching, but like you said I am not
  1616. sure that it is the best method for PPC code...
  1617.  
  1618. Dave
  1619.  
  1620. ============================================================
  1621. Dave Nebinger                    dnebing@bgsuvax.bgsu.edu
  1622. Network Manager, Biology Dept.   dnebing@opie.bgsu.edu
  1623. Bowling Green State University   dnebing@bgsuopie (bitnet)
  1624. Bowling Green, OH 43403          #include <std_disclaimer.h>
  1625.  
  1626.             Mighty 'Moof-in' PowerPC Ranger
  1627.  
  1628.  
  1629. ---------------------------
  1630.  
  1631. >From howardk@cyberstore.ca (Howard Katz)
  1632. Subject: Password for mounting remote volumes
  1633. Date: Mon, 28 Nov 1994 12:11:47 -0800
  1634. Organization: Enigmatic Software
  1635.  
  1636. Can someone tell me what a volume password is? Let me provide a little
  1637. context for the question.
  1638.  
  1639. We need to periodically automount remote servers on our network to ship
  1640. files over to them for archiving purposes. We need to do this transparently
  1641. without user intervention, so I'd like to use PBVolumeMount() to remount a
  1642. server, passing in saved mounting information from a prior session. This
  1643. seems fairly straightforward.
  1644.  
  1645. IM mentions a caveat, however, that System 7 filesharing software (which we
  1646. use) will not pass the volume password along with the PBVolumeMount() call.
  1647. My question is:
  1648.  
  1649. (1) What _is_ a volume password? All I currently know about and have access
  1650. to is the user password, and
  1651.  
  1652. (2) Does this mean I can't do what I want to do?
  1653.  
  1654. Any help would be much appreciated.
  1655.  
  1656. Thanks in advance,
  1657.  
  1658. Howard Katz
  1659. - --
  1660. Time flies like an arrow.
  1661. Fruit flies like a banana.
  1662.  
  1663. +++++++++++++++++++++++++++
  1664.  
  1665. >From jumplong@aol.com (Jump Long)
  1666. Date: 12 Dec 1994 01:15:34 -0500
  1667. Organization: America Online, Inc. (1-800-827-6364)
  1668.  
  1669. In article <howardk-281194121147@howard-katz.bcaa.bc.ca>,
  1670. howardk@cyberstore.ca (Howard Katz) writes:
  1671.  
  1672. >IM mentions a caveat, however, that System 7 filesharing software (which
  1673. >we use) will not pass the volume password along with the PBVolumeMount()
  1674. >call. My question is:
  1675. >
  1676. >(1) What _is_ a volume password? All I currently know about and have
  1677. >access to is the user password, and
  1678.  
  1679. Volume passwords are an optional feature of the AppleTalk Filing Protocol.
  1680.  It's so optional, that the AppleShare and File Sharing file servers don't
  1681. support it. There may be non-Apple AFP servers that support volume
  1682. passwords, but I don't know which ones.  It's kind of a stupid feature
  1683. since the password is sent to the server "clear text" (no encryption).
  1684.  
  1685. The note in IM: Files about volume passwords and PBVolumeMount only
  1686. pertains to older versions of the AppleShare client (the AppleShare
  1687. Chooser extension).  The problem was fixed in the AppleShare 3.0 client
  1688. and all laters versions of the AppleShare client (i.e., the clients that
  1689. shipped with System 7.1 and later, and with AppleShare Pro and 4.0.x).
  1690.  
  1691. >(2) Does this mean I can't do what I want to do?
  1692.  
  1693. Nope, not at all. Since you'll rarely even find a network volume with a
  1694. volume password, you probably don't even have to worry about it.  System 7
  1695. has little support for volume passwords - in fact, the Alias Manager
  1696. doesn't support them.
  1697.  
  1698. - Jim Luther
  1699.  
  1700. ---------------------------
  1701.  
  1702. >From jimsa@microsoft.com (Jim Sather)
  1703. Subject: SUMMARY: MacTCP Performance Problems
  1704. Date: Wed, 14 Dec 1994 20:42:07 GMT
  1705. Organization: Microsoft Corporation
  1706.  
  1707.  
  1708. About a week ago I asked for help/suggestions on how to speed up a TCP/IP
  1709. transport.  Here's a quick run down on the suggestions received.  It turns
  1710. out that the push flag was my problem.
  1711.  
  1712. -Jim
  1713.  
  1714. Robert Mah  <rmah@panix.com> wrote:
  1715. - -------------------------------------------------------
  1716. MacTCP is fairly sensitive to buffer space.   Try allocating a LOT more
  1717. space for the receive buffer when you create the stream.  Another thing
  1718. you might want to try is to use the TCPNoCopyRcv receive calls instead
  1719. of the TCPRcv call.
  1720.  
  1721. Also, make sure you are setting the "push" flag for TCPSend at the
  1722. appropriate times.  I think if you set it too often, you get lot's of
  1723. "smaller" packets instead of a few "larger" ones.  When to do this is
  1724. very application specific in nature.
  1725.  
  1726. Finally, you *are* calling MacTCP asynchronouslly aren't you?  And you
  1727. *are* using asych file mgr calls too, right?
  1728.  
  1729. Eric Scouten  <scouten@uiuc.edu> wrote:
  1730. - ----------------------------------------------------------
  1731. You have to do a lot of funny business with MacTCP to get good performance
  1732. from it. Try playing with such parameters as the buffer size, number of
  1733. entries in the RDS/WDS. Also, you can issue multiple read/write commands;
  1734. doing so may help performance.
  1735.  
  1736. In my experience, MacTCP maxes out at about 410KB/second on an otherwise
  1737. quiet Ethernet. This is in line with Apple's advertising copy for MacTCP,
  1738. and suggests that there is some inherent slowness in MacTCP.
  1739.  
  1740.  
  1741. ttuck  <ttuck@jolt.mpx.com.au> wrote:
  1742. - ----------------------------------------------------
  1743. You might be suffering from the "infinite slowdown problem" that
  1744. plagues MacTcp up to version 2.0.4.
  1745.  
  1746. I have noticed an increase in speed of my favourite netapps since the
  1747. upgrade.
  1748.  
  1749. You can FTP a patcher from seeding.apple.com. You apply the patch to a
  1750. "virgin" copy of 2.0.4.
  1751.  
  1752. It fixes a whole swag of bugs including a nasty one with DNS that could
  1753. hose it if the DNS had a lot to say ! :-)
  1754.  
  1755.  
  1756. ---------------------------
  1757.  
  1758. >From tjb@acpub.duke.edu (Tom Bryce)
  1759. Subject: [Q] How to find parameter info for traps
  1760. Date: 11 Dec 1994 18:25:48 GMT
  1761. Organization: Duke Med
  1762.  
  1763.  
  1764. I have a copy the Develop CD #17 with the old Inside Macs I-VI on it,
  1765. as well as files, toolbox, toolbox essentials, and so on from the new
  1766. Inside Macs.
  1767.  
  1768. Can anyone tell me where I should look to find information on parameter
  1769. info for traps? For example, if I were to patch _MountVol, in which
  1770. registers would the parameters for _MountVol be passed, and how should
  1771. I return a return value? Push an OSErr onto the stack??
  1772.  
  1773. Thanks for any help.
  1774.  
  1775. - ----------------------------------------------------------------------
  1776.  
  1777. Tom Bryce
  1778. for PGP public key finger tjbryce@amherst.edu
  1779.  
  1780. +++++++++++++++++++++++++++
  1781.  
  1782. >From scouten@metrowerks.com (Eric Scouten)
  1783. Date: Sun, 11 Dec 1994 12:46:03 -0600
  1784. Organization: metrowerks, inc.
  1785.  
  1786. In article <3cfg7c$mdl@news.duke.edu>, tjb@acpub.duke.edu (Tom Bryce) wrote:
  1787.  
  1788. > Can anyone tell me where I should look to find information on parameter
  1789. > info for traps? For example, if I were to patch _MountVol, in which
  1790. > registers would the parameters for _MountVol be passed, and how should
  1791. > I return a return value? Push an OSErr onto the stack??
  1792.  
  1793. My advice is to dissect the relevant header files. For example, in
  1794. <Files.h>, there is the following declaration, which gives 68K register
  1795. declarations:
  1796.  
  1797. #if !GENERATINGCFM
  1798. #pragma parameter __D0 PBMountVol(__A0)
  1799. #endif
  1800. extern pascal OSErr PBMountVol(ParmBlkPtr paramBlock)
  1801.  ONEWORDINLINE(0xA00F);
  1802.  
  1803.  
  1804. (NOTE: This is from the new Universal Headers 2.0, but the old headers
  1805. should look somewhat similar.)
  1806.  
  1807. In general, the IM volumes concentrate more on providing info to those who
  1808. are *using* the traps, rather than those who are patching them. When you
  1809. get into patching, you may have to do some sleuthing to get the info and
  1810. then experiment to ensure that you're getting the right parameters in the
  1811. right places.
  1812.  
  1813. -es
  1814.  
  1815. __________________________________________________________________________
  1816. Eric Scouten <scouten@metrowerks.com>
  1817.  
  1818. +++++++++++++++++++++++++++
  1819.  
  1820. >From tjb@acpub.duke.edu (Tom Bryce)
  1821. Date: 11 Dec 1994 20:31:25 GMT
  1822. Organization: Duke Med
  1823.  
  1824. In article <scouten-1112941246030001@mingus.isdn.uiuc.edu>
  1825. scouten@metrowerks.com (Eric Scouten) writes:
  1826.  
  1827. > In article <3cfg7c$mdl@news.duke.edu>, tjb@acpub.duke.edu (Tom Bryce) wrote:
  1828. > > Can anyone tell me where I should look to find information on parameter
  1829. > > info for traps? For example, if I were to patch _MountVol, in which
  1830. > > registers would the parameters for _MountVol be passed, and how should
  1831. > > I return a return value? Push an OSErr onto the stack??
  1832. > My advice is to dissect the relevant header files. For example, in
  1833. > <Files.h>, there is the following declaration, which gives 68K register
  1834. > declarations:
  1835. > #if !GENERATINGCFM
  1836. > #pragma parameter __D0 PBMountVol(__A0)
  1837. > #endif
  1838. > extern pascal OSErr PBMountVol(ParmBlkPtr paramBlock)
  1839. >  ONEWORDINLINE(0xA00F);
  1840.  
  1841. Can I follow up with a question about how to interpret the following
  1842. header, just grabbed at random from Files.h
  1843.  
  1844. pascal OSErr PBClose(ParmBlkPtr paramBlock,Boolean async); 
  1845. #pragma parameter __D0 PBCloseSync(__A0)
  1846. pascal OSErr PBCloseSync(ParmBlkPtr paramBlock)
  1847.     = 0xA001; 
  1848. #pragma parameter __D0 PBCloseAsync(__A0)
  1849. pascal OSErr PBCloseAsync(ParmBlkPtr paramBlock)
  1850.     = 0xA401; 
  1851.  
  1852. The first declaration (PBClose) seems to be for a close command. The
  1853. boolean seems to refer to whether it is being called asyncronously or
  1854. not, or in flow terms, whether the PBCloseSync or PBCloseAsync was
  1855. being called. 
  1856.  
  1857. Suppose I were patching the PBClose command, for example, just to give
  1858. a sysbeep whenever a file is closed. Files.h did not give an address
  1859. for a trap for PBClose, the above is all it had. Should I then patch
  1860. two traps, one for PBCloseSync, and another for PBCloseAsync? And where
  1861. is the decision being made to call one or the other? Is there a trap
  1862. PBClose that is first called which then interprets the Boolean async
  1863. and calls one of the other two?
  1864.  
  1865. Am I correct in assuming A0 points to the parameters for these two
  1866. routines, and D0 should hold the result code they return when they are
  1867. finished?
  1868.  
  1869. Also, if PBClose has its own trap, what does the parameter block look
  1870. like? There are *two* arguments to PBClose here. So, for example, does
  1871. A0 point to a chunk of memory in which first a ParmBlkPtr is located,
  1872. then sequentially thereafter one byte of Boolean? So *((unsigned char
  1873. *)A0+sizeof(ParmBlkPtr)) would point to the Boolean parameter?
  1874.  
  1875. If it sounds like I'm a total neophyte, I am. :-) I have the FAQ on
  1876. init writing and some sample code, but nowhere have I seen explained
  1877. how to handle these parameter issues.
  1878.  
  1879. Thanks
  1880.  
  1881. Tom
  1882.  
  1883. - ----------------------------------------------------------------------
  1884.  
  1885. Tom Bryce
  1886. for PGP public key finger tjbryce@amherst.edu
  1887.  
  1888. +++++++++++++++++++++++++++
  1889.  
  1890. >From scouten@metrowerks.com (Eric Scouten)
  1891. Date: Sun, 11 Dec 1994 15:15:30 -0600
  1892. Organization: metrowerks, inc.
  1893.  
  1894. In article <3cfnit$qum@news.duke.edu>, tjb@acpub.duke.edu (Tom Bryce) wrote:
  1895.  
  1896. [Initial question & my response deleted]
  1897.  
  1898. > Can I follow up with a question about how to interpret the following
  1899. > header, just grabbed at random from Files.h
  1900. > pascal OSErr PBClose(ParmBlkPtr paramBlock,Boolean async); 
  1901. > #pragma parameter __D0 PBCloseSync(__A0)
  1902. > pascal OSErr PBCloseSync(ParmBlkPtr paramBlock)
  1903. >     = 0xA001; 
  1904. > #pragma parameter __D0 PBCloseAsync(__A0)
  1905. > pascal OSErr PBCloseAsync(ParmBlkPtr paramBlock)
  1906. >     = 0xA401; 
  1907. > The first declaration (PBClose) seems to be for a close command. The
  1908. > boolean seems to refer to whether it is being called asyncronously or
  1909. > not, or in flow terms, whether the PBCloseSync or PBCloseAsync was
  1910. > being called.
  1911.  
  1912. Ahhh... now you're hitting on some of the complexity of Macintosh system
  1913. calls. As you suspectd, PBClose is actually a piece of glue code in the
  1914. compiler's library that dispatches the call to the PBCloseSync or
  1915. PBCloseAsync trap based on the value of the boolean parameter.
  1916.  
  1917. BUT.. the fun's not over yet: The A001 and A401 actually get dispatched to
  1918. the *SAME* address (the _Close, 0x001 in OS trap dispatch table). The
  1919. routine that implements these traps (actually part of the Device Manager,
  1920. although the File Manager shares the traps) then looks at the trap word to
  1921. determine how it should respond to the call.
  1922.  
  1923. Fun, huh?
  1924.  
  1925. So for your application, you should patch the _Close trap. Both sync &
  1926. async calls will be routed to your patch. HOWEVER, you should know that
  1927. you'll *also* be getting requests to close *devices*, so you'll have to
  1928. some work to decode the param block before declaring that a close file was
  1929. executed.
  1930.  
  1931.  
  1932. > Suppose I were patching the PBClose command, for example, just to give
  1933. > a sysbeep whenever a file is closed.
  1934.  
  1935. DANGER WILL ROBINSON... SysBeep cannot be called from interrupt-level
  1936. code. The asynchronous flavor of _Close (and all the other file/device
  1937. calls) *can* be called from interrupt code (even if your app doesn't do
  1938. it, some other system process is likely to). So you'll have to figure some
  1939. other debugging method.
  1940.  
  1941.  
  1942. > Files.h did not give an address
  1943. > for a trap for PBClose, the above is all it had.
  1944.  
  1945. As I said, PBClose is merely a bit of glue code. In the new Universal
  1946. Headers (shipping on CW/5), it's been replaced by a macro, so the compiler
  1947. can optomize away the extra call if a constant is given for the async
  1948. parameter. It looks like this:
  1949.  
  1950.   #define PBClose(pb, async) ((async) ? PBCloseAsync(pb) : PBCloseSync(pb))
  1951.  
  1952.  
  1953. > Am I correct in assuming A0 points to the parameters for these two
  1954. > routines, and D0 should hold the result code they return when they are
  1955. > finished?
  1956.  
  1957. Yes. This is generally true for all of the "low-level" file/device manager
  1958. calls. (These are the calls that have PB at the start of their names.)
  1959.  
  1960. -es
  1961.  
  1962. __________________________________________________________________________
  1963. Eric Scouten <scouten@metrowerks.com>
  1964.  
  1965. +++++++++++++++++++++++++++
  1966.  
  1967. >From jwbaxter@olympus.net (John W. Baxter)
  1968. Date: Sun, 11 Dec 1994 16:33:22 -0800
  1969. Organization: Internet for the Olympic Peninsula
  1970.  
  1971. In article <scouten-1112941515300001@mingus.isdn.uiuc.edu>,
  1972. scouten@metrowerks.com (Eric Scouten) wrote:
  1973.  
  1974. Eric Scouten sez:
  1975. > As I said, PBClose is merely a bit of glue code. In the new Universal
  1976. > Headers (shipping on CW/5), it's been replaced by a macro, so the compiler
  1977. > can optomize away the extra call if a constant is given for the async
  1978. > parameter. It looks like this:
  1979. >   #define PBClose(pb, async) ((async) ? PBCloseAsync(pb) : PBCloseSync(pb))
  1980. That's also the headers I have in my MPW installation (from E.T.O. 15).
  1981.  
  1982. For PPC, there really are two calls into the shared library:  PBCloseAsync
  1983. and PBCloseSync...the macro is a clever way to separate them out at
  1984. compile time, and doesn't get in the way of setting up the bit in the trap
  1985. for 68K.
  1986.  
  1987.    --John
  1988.  
  1989. -- 
  1990. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  1991.    Caesar attended the Senate in a rented toga.
  1992.    jwbaxter@pt.olympus.net
  1993.  
  1994. ---------------------------
  1995.  
  1996. >From han@ifa.hawaii.edu (Byron Han)
  1997. Subject: string constants in Metrowerks C code resource?
  1998. Date: Thu, 8 Dec 1994 07:40:57 GMT
  1999. Organization: Institute for Astronomy, University of Hawaii
  2000.  
  2001. How does one get string constants to work in 68K code resources in
  2002. Metrowerks?   I used to be able to do this just fine in MPW but now I am
  2003. stuck.  The PPC side of the code resource works just fine with the
  2004. embedded string constants but the 68K side is broken...
  2005.  
  2006. Thanks in advance.
  2007.  
  2008. BH
  2009.  
  2010. -- 
  2011. Byron Han * Institute for Astronomy * University of Hawaii at Manoa
  2012.   2680 Woodlawn Drive * Honolulu HI 96822 * han@ifa.hawaii.edu
  2013.       WWW: http://galileo.ifa.hawaii.edu/~sped/byronhan.html 
  2014.                 eWorld: BYRONHAN * AOL: BYRON Han
  2015.  
  2016. +++++++++++++++++++++++++++
  2017.  
  2018. >From jwbaxter@olympus.net (John W. Baxter)
  2019. Date: Fri, 09 Dec 1994 08:18:40 -0800
  2020. Organization: Internet for the Olympic Peninsula
  2021.  
  2022. In article <han-0712942140570001@128.171.75.8>, han@ifa.hawaii.edu (Byron
  2023. Han) wrote:
  2024.  
  2025. > How does one get string constants to work in 68K code resources in
  2026. > Metrowerks?   I used to be able to do this just fine in MPW but now I am
  2027. > stuck.  The PPC side of the code resource works just fine with the
  2028. > embedded string constants but the 68K side is broken...
  2029.  
  2030. See the sample CODE resources folder.  Metrowerks follows THINK's idea of
  2031. using register A4 to point to the globals (but the details are
  2032. different).  String constants are just globals to THINK and
  2033. CodeWarrior...not handled with the special embed in the code and reference
  2034. via the PC as MPW can be told to do.  [Frankly, I prefer MPW's way.]
  2035.  
  2036.   --John
  2037.  
  2038. -- 
  2039. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  2040.    Caesar attended the Senate in a rented toga.
  2041.    jwbaxter@pt.olympus.net
  2042.  
  2043. +++++++++++++++++++++++++++
  2044.  
  2045. >From ericstad@netcom.com (Eric Stadtherr)
  2046. Date: Mon, 12 Dec 1994 03:24:25 GMT
  2047. Organization: NETCOM On-line Communication Services (408 261-4700 guest)
  2048.  
  2049. han@ifa.hawaii.edu (Byron Han) writes:
  2050.  
  2051. >How does one get string constants to work in 68K code resources in
  2052. >Metrowerks?   I used to be able to do this just fine in MPW but now I am
  2053. >stuck.  The PPC side of the code resource works just fine with the
  2054. >embedded string constants but the 68K side is broken...
  2055.  
  2056. >Thanks in advance.
  2057.  
  2058. >BH
  2059.  
  2060. Are you trying something like:
  2061.  
  2062. void CodeResourceMain (void)
  2063. {
  2064.     StringPtr theString = "\pThis is a string";
  2065.     ...
  2066.     oldA4 = SetUpA4();
  2067.     ...
  2068.     RestoreA4 (oldA4);
  2069. }
  2070.  
  2071. If so, you'll need to move the assignment of the StringPtr inside the
  2072. SetUpA4() call.  This is because the string globals are referenced from
  2073. A4 under MetroWerks.  This worked under THINK C, I believe, since THINK
  2074. code resources always started with A0 pointing to the start of the
  2075. resource.
  2076.  
  2077. -Eric Stadtherr
  2078.  Ootinta Software
  2079.  
  2080. ---------------------------
  2081.  
  2082. End of C.S.M.P. Digest
  2083. **********************
  2084.  
  2085.  
  2086.