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

  1. C.S.M.P. Digest             Sat, 18 Jun 94       Volume 3 : Issue 37
  2.  
  3. Today's Topics:
  4.  
  5.         Finding a drive's SCSI ID
  6.         How to tell which volume was booted from?
  7.         Open Transport & ASLM (Was: Re: ASLM)
  8.         Symantec at WWDC (Was: Symantec vs. Metrowerks? What to do?)
  9.         [Q] Finding out if volume is locked
  10.  
  11.  
  12.  
  13. The Comp.Sys.Mac.Programmer Digest is moderated by Francois Pottier
  14. (pottier@clipper.ens.fr).
  15.  
  16. The digest is a collection of article threads from the internet newsgroup
  17. comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
  18. regularly and want an archive of the discussions.  If you don't know what a
  19. newsgroup is, you probably don't have access to it.  Ask your systems
  20. administrator(s) for details.  If you don't have access to news, you may
  21. still be able to post messages to the group by using a mail server like
  22. anon.penet.fi (mail help@anon.penet.fi for more information).
  23.  
  24. Each issue of the digest contains one or more sets of articles (called
  25. threads), with each set corresponding to a 'discussion' of a particular
  26. subject.  The articles are not edited; all articles included in this digest
  27. are in their original posted form (as received by our news server at
  28. nef.ens.fr).  Article threads are not added to the digest until the last
  29. article added to the thread is at least two weeks old (this is to ensure that
  30. the thread is dead before adding it to the digest).  Article threads that
  31. consist of only one message are generally not included in the digest.
  32.  
  33. The digest is officially distributed by two means, by email and ftp.
  34.  
  35. If you want to receive the digest by mail, send email to listserv@ens.fr
  36. with no subject and one of the following commands as body:
  37.     help                        Sends you a summary of commands
  38.     subscribe csmp-digest Your Name    Adds you to the mailing list
  39.     signoff csmp-digest            Removes you from the list
  40. Once you have subscribed, you will automatically receive each new
  41. issue as it is created.
  42.  
  43. The official ftp info is //ftp.dartmouth.edu/pub/csmp-digest.
  44. Questions related to the ftp site should be directed to
  45. scott.silver@dartmouth.edu. Currently no previous volumes of the CSMP
  46. digest are available there.
  47.  
  48. Also, the digests are available to WAIS users.  To search back issues
  49. with WAIS, use comp.sys.mac.programmer.src. With Mosaic, use
  50. http://www.wais.com/wais-dbs/comp.sys.mac.programmer.html.
  51.  
  52.  
  53. -------------------------------------------------------
  54.  
  55. From Jerry.Halstead@launchpad.unc.edu (jerry halstead)
  56. Subject: Finding a drive's SCSI ID
  57. Date: 27 May 1994 22:49:40 GMT
  58. Organization: University of North Carolina Extended Bulletin Board Service
  59.  
  60. I am writing a program that uses GetVInfo to get a list of drives the Mac
  61. sees (and snarf information about them) and then a lower level SCSI
  62. routine to go out and find out what drives are on the SCSI chain.  After
  63. getting this info I would like to be able to match the GetVInfo with the
  64. device info I found, determining which drives are Mac supported drives and
  65. which are unformatted or other types of SCSI devices.  Any ideas how to
  66. accomplish this?  Here's what I have so far, first here's the infor from
  67. GetVInfo:
  68.  
  69.       Drive 9:  Volume Ref: -1;  Bytes free: 92809728, Name: 'Quack'
  70.  
  71. Then my low level SCSI routine returns the following:
  72.  
  73.          Device ID: 2
  74.       dev type: 0
  75.               qual: 0
  76.            version: 1
  77.           response: 1
  78.            add len: 31
  79.              vendor: MAXTOR  LXT-340S        6.75
  80.      productId: LXT-340S        6.75
  81.     productRev: 6.75
  82.     data: 45 52 02 00 00 0a 26 38 
  83.         00 00 00 00 00 00 00 00 
  84.         00 02 00 00 00 40 00 05 
  85.         01 01 00 0a 25 fffffff5 00 08 }
  86.  
  87. I know these two collections of info are the same, but how do I enlighten
  88. my program?  How can I get a drive's SCSI ID by using vRefNum, or how can
  89. I get the name of a Mac drive using low level SCSI routines?  Is there a
  90. handy routine for this, or do I need to learn more about the format of Mac
  91. disks (say it ain't so!).
  92.  
  93. Tanks!
  94.  
  95. Oh, btw, the data below productRev is from reading sector zero on the
  96. drive: is there signifigance to the "45 52 02"? I found it on a couple of
  97. Mac drives I was peeking at.
  98. --
  99. - ----------------------------------------------------------------------------
  100.  \ The above does not represent OIT, UNC-CH, laUNChpad, or its other users. /
  101.    ------------------------------------------------------------------------
  102.  
  103. +++++++++++++++++++++++++++
  104.  
  105. From dshayer@netcom.com (David Shayer)
  106. Date: Sat, 28 May 1994 03:13:44 GMT
  107. Organization: NETCOM On-line Communication Services (408 261-4700 guest)
  108.  
  109. jerry halstead (Jerry.Halstead@launchpad.unc.edu) wrote:
  110. : I am writing a program that uses GetVInfo to get a list of drives the Mac
  111. : sees (and snarf information about them) and then a lower level SCSI
  112. : routine to go out and find out what drives are on the SCSI chain.  After
  113. : getting this info I would like to be able to match the GetVInfo with the
  114. : device info I found, determining which drives are Mac supported drives and
  115. : which are unformatted or other types of SCSI devices.  Any ideas how to
  116. : accomplish this?  
  117.  
  118. You can match the driver refnum against the scsi id.
  119. See IM 2 p 191 for the formula for calculating the unit table slot
  120. for a driver if you know it's refnum.  See IM 4 p 215 for a list of which
  121. drivers go where in the unit table.  Another case of its obvious if you
  122. had only known to look there.
  123.  
  124. To summarize IM, scsi drivers go in slots 32-40 in the unit table in
  125. order, so the dirver for scsi 0 is in slot 32, scsi 1 is in slot 1, etc.
  126. slot number = -(refnum-1)
  127. So the driver for scsi 0 has refnum -33, scsi 1 has refnum -34, etc.
  128.  
  129. : Oh, btw, the data below productRev is from reading sector zero on the
  130. : drive: is there signifigance to the "45 52 02"? I found it on a couple of
  131. : Mac drives I was peeking at.
  132.  
  133. $4552 is 'ER', the signature in block 0, the driver map.  See IM 5 p 577
  134. for the format of the driver map.  I'd advise against modifying the driver
  135. map, unless you have a backup of your drive, and you intend on testing
  136. the restore option of your backup software.   :-)
  137.  
  138. David Shayer
  139. shayer@applelink.apple.com
  140. Freelance Hacker
  141.  
  142.  
  143. +++++++++++++++++++++++++++
  144.  
  145. From tzs@u.washington.edu (Tim Smith)
  146. Date: 28 May 1994 11:37:15 GMT
  147. Organization: University of Washington School of Law, Class of '95
  148.  
  149. David Shayer <dshayer@netcom.com> wrote:
  150. >You can match the driver refnum against the scsi id.
  151. >See IM 2 p 191 for the formula for calculating the unit table slot
  152. >for a driver if you know it's refnum.  See IM 4 p 215 for a list of which
  153. >drivers go where in the unit table.  Another case of its obvious if you
  154. >had only known to look there.
  155.  
  156. Here's another way, that has the advantage of working even if Apple
  157. stops using a straightforward mapping between refnum and SCSI ID.
  158. Do an illegal command via the SCSI Manager on the SCSI drive whose
  159. Mac driver you wish to find (reading block 0xFFFFFFFF is a good
  160. command here, unless it's a really big drive).  Do not do a
  161. REQUEST SENSE command.  Then, read a block through one of the Mac
  162. drivers.  Now do a REQUEST SENSE via the SCSI Manager to the
  163. disk.  If there is no sense data, then your access through the
  164. Mac driver must have issued a command to that drive, thus wiping
  165. out the sense data from the failed command, and you know that was
  166. the Mac driver for that SCSI device.  If the sense data is still
  167. there, repeat the process, using a different Mac driver next time,
  168. and so on, until you find the right one.
  169.  
  170. Drawback: this assumes SCSI devices that follow the SCSI spec.  There
  171. are some popular disks out there that don't quite get this right.  In
  172. particular, I seem to recall seeing one that does not clear the sense
  173. data for a failed command when it gets a subsequent command.
  174.  
  175. Drawback: this is the kind of thing someone might do on DOS (in fact,
  176. that's how some DOS SCSI drivers that load from config.sys determine
  177. what mapping the SCSI BIOS set up from SCSI disks to INT 13h drives),
  178. so your reputation might suffer.
  179.  
  180. Drawback: this assumes you can control all I/O.  If someone can come in
  181. and do a file access (e.g., perhaps through file shareing?), they may
  182. confuse things.
  183.  
  184. --Tim Smith
  185.  
  186. +++++++++++++++++++++++++++
  187.  
  188. From rang@winternet.com (Anton Rang)
  189. Date: 03 Jun 1994 00:04:59 GMT
  190. Organization: Minnesota Angsters
  191.  
  192. In article <dshayerCqHsyw.A1L@netcom.com> dshayer@netcom.com (David Shayer) writes:
  193. > [ about ways to get the scsi id given a volume ]
  194. >
  195. >You can match the driver refnum against the scsi id.
  196. >See IM 2 p 191 for the formula for calculating the unit table slot
  197. >for a driver if you know it's refnum.  See IM 4 p 215 for a list of which
  198. >drivers go where in the unit table.  Another case of its obvious if you
  199. >had only known to look there.
  200.  
  201.   This works with the old SCSI Manager.  If SCSI Manager 4.3 is
  202. installed, you should call one of its routines instead, as the old
  203. mapping only works for devices visible to the virtual SCSI bus.  I
  204. think it's a "LookupRefNumXref", but haven't got my docs here.
  205. --
  206. Anton Rang (rang@winternet.com)
  207.  
  208. ---------------------------
  209.  
  210. From mpcline@cats.ucsc.edu (Matthew Paul Cline)
  211. Subject: How to tell which volume was booted from?
  212. Date: 3 Jun 1994 23:55:02 GMT
  213. Organization: University of California, Santa Cruz
  214.  
  215.  
  216.     The subject says it all.  Thanks in advance.
  217. -- 
  218. Poodles have no honor.               Have you hugged your shoggoth today?
  219. GE d? -p+ c++(+++) l++ u++ e+ m+ s/- n+(-) h+ f !g w+ t+ r y+
  220.  
  221. +++++++++++++++++++++++++++
  222.  
  223. From mclow@coyote.csusm.edu (Marshall Clow)
  224. Date: 3 Jun 1994 17:31:48 -0700
  225. Organization: California State University San Marcos
  226.  
  227. Matthew Paul Cline (mpcline@cats.ucsc.edu) wrote:
  228.  
  229. >    The subject says it all.  Thanks in advance.
  230.  
  231. Depends how esoteric you want to get. If you want the current
  232. system volume (almost always the same volume that you booted
  233. from), call SysEnvirons and resolve the wdRefNum for the system
  234. folder into a vRefNum/DirID using GetWDInfo.
  235.  
  236. If you really want to know what volume was booted from, I think
  237. that you are out of luck. Suppose (System 6, now), you booted from
  238. a floppy, switch-launched to a RAM disk, and unmounted the floppy.
  239.  
  240. Marshall Clow
  241. Aladdin Systems
  242. mclow@san_marcos.csusm.edu
  243.  
  244.  
  245. +++++++++++++++++++++++++++
  246.  
  247. From ivanski@world.std.com (Ivan M CaveroBelaunde)
  248. Date: Sat, 4 Jun 1994 01:56:27 GMT
  249. Organization: The World Public Access UNIX, Brookline, MA
  250.  
  251. mclow@coyote.csusm.edu (Marshall Clow) writes:
  252. >Matthew Paul Cline (mpcline@cats.ucsc.edu) wrote:
  253. >>    The subject says it all.  Thanks in advance.
  254. >Depends how esoteric you want to get. If you want the current
  255. >system volume (almost always the same volume that you booted
  256. >from), call SysEnvirons and resolve the wdRefNum for the system
  257. >folder into a vRefNum/DirID using GetWDInfo.
  258. >If you really want to know what volume was booted from, I think
  259. >that you are out of luck. Suppose (System 6, now), you booted from
  260. >a floppy, switch-launched to a RAM disk, and unmounted the floppy.
  261.  
  262. Actually, that's not quite right. I believe that the vRefNum of the boot
  263. volumes is *always* -1 (it's in a technote somewhere - the same one that
  264. states that the dirID for the root directory of a volumes is always 2).
  265.  
  266. Hope this helps,
  267.  
  268. -Ivan
  269. - -
  270. Ivan Cavero Belaunde (ivanski@world.std.com)
  271. Avid VideoShop Project Lead
  272. Avid Technology, Inc.
  273.  
  274.  
  275. +++++++++++++++++++++++++++
  276.  
  277. From grobbins@apple.com (Grobbins)
  278. Date: 3 Jun 1994 20:07:46 -0700
  279. Organization: Skunkworks
  280.  
  281. In article <2sofsm$fsh@darkstar.UCSC.EDU>,
  282. Matthew Paul Cline <mpcline@cats.ucsc.edu> wrote:
  283. >The subject says it all.
  284.  
  285. No, it doesn't.  At present, the boot disk has a vRefNum of -1.  
  286. But that may not be true down the road; indeed, the system may use
  287. some more complex boot mechanisms, perhaps including the use of
  288. servers, volumes in ROM, temporary volumes, or disks made of toasted
  289. raisin bread.  Applications should not generally assume anything about
  290. the boot volume; in particular, it may not be local, may not be
  291. writable, and may not have all of its raisins.
  292.  
  293. So what is it you are trying to do?  If you can use the call FindFolder
  294. or the application's file spec (from the GetProcessInformation call)
  295. those may provide more reliable information.  For general information
  296. on booting and disk organization, take a look at Inside Mac:Files
  297. p 2-54 and following, and Inside Mac:Devices, ch 4.
  298.  
  299. Grobbins              grobbins@apple.com
  300.  
  301. Usual disclaimers apply.
  302.  
  303.  
  304. +++++++++++++++++++++++++++
  305.  
  306. From blob@apple.com (Brian Bechtel)
  307. Date: 4 Jun 1994 07:09:13 -0700
  308. Organization: Apple Computer, Inc., Cupertino, California
  309.  
  310. grobbins@apple.com (Grobbins) writes:
  311.  
  312. >In article <2sofsm$fsh@darkstar.UCSC.EDU>,
  313. >Matthew Paul Cline <mpcline@cats.ucsc.edu> wrote:
  314. >>The subject says it all.
  315.  
  316. >No, it doesn't.  At present, the boot disk has a vRefNum of -1.  
  317. >But that may not be true down the road; indeed, the system may use
  318. >some more complex boot mechanisms, perhaps including the use of
  319. >servers, volumes in ROM, temporary volumes, or disks made of toasted
  320. >raisin bread.  Applications should not generally assume anything about
  321. >the boot volume; in particular, it may not be local, may not be
  322. >writable, and may not have all of its raisins.
  323.  
  324. Augh!  First the Caffeine Manager, now the Toasted Raisin Bread
  325. Manager.... when will it all stop?
  326.  
  327.  
  328. Greg's right.  Use FindFolder.
  329.  
  330. --Brian Bechtel     blob@apple.com     "My opinion, not Apple's"
  331.  
  332. +++++++++++++++++++++++++++
  333.  
  334. From omh@cs.brown.edu (Owen M. Hartnett)
  335. Date: Sat, 4 Jun 1994 17:47:36 GMT
  336. Organization: Brown University Department of Computer Science
  337.  
  338. In article <2sq1u9$c3p@apple.com> blob@apple.com (Brian Bechtel) writes:
  339. >grobbins@apple.com (Grobbins) writes:
  340. >
  341. >Augh!  First the Caffeine Manager, now the Toasted Raisin Bread
  342. >Manager.... when will it all stop?
  343.  
  344. In the new Universal Headers, both the Caffeine Manager and the Toasted
  345. Raisin Bread Manager fall under the direction of the Grocery Manager.
  346.  
  347. -Owen
  348.  
  349.  
  350. -- 
  351. Owen Hartnett                omh@cs.brown.edu
  352. "FAITH, n. Belief without evidence in what is told by one who speaks
  353.         without knowledge, of things without parallel."
  354.             -Ambrose Bierce - The Devil's Dictionary
  355.  
  356. +++++++++++++++++++++++++++
  357.  
  358. From mpcline@cats.ucsc.edu (Matthew Paul Cline)
  359. Date: 4 Jun 1994 20:20:39 GMT
  360. Organization: University of California, Santa Cruz
  361.  
  362.  
  363. In <2sor62$rqh@apple.com> grobbins@apple.com (Grobbins) writes:
  364.  
  365. >In article <2sofsm$fsh@darkstar.UCSC.EDU>,
  366. >Matthew Paul Cline <mpcline@cats.ucsc.edu> wrote:
  367. >>The subject says it all.
  368.  
  369.  
  370. >So what is it you are trying to do?  If you can use the call FindFolder
  371. >or the application's file spec (from the GetProcessInformation call)
  372. >those may provide more reliable information.  For general information
  373. >on booting and disk organization, take a look at Inside Mac:Files
  374. >p 2-54 and following, and Inside Mac:Devices, ch 4.
  375.  
  376. I am looking for a way to uniquely identify a Mac.  One idea was to  to
  377. use the format time of the boot disk as the Macs ID number.  However,
  378. if identifying a suitable drive will become that complicated, I'll figure
  379. out another way.
  380. -- 
  381. Poodles have no honor.               Have you hugged your shoggoth today?
  382. GE d? -p+ c++(+++) l++ u++ e+ m+ s/- n+(-) h+ f !g w+ t+ r y+
  383.  
  384. +++++++++++++++++++++++++++
  385.  
  386. From mclow@coyote.csusm.edu (Marshall Clow)
  387. Date: 4 Jun 1994 14:28:59 -0700
  388. Organization: California State University San Marcos
  389.  
  390. Matthew Paul Cline (mpcline@cats.ucsc.edu) wrote:
  391.  
  392. >In <2sor62$rqh@apple.com> grobbins@apple.com (Grobbins) writes:
  393.  
  394. >>In article <2sofsm$fsh@darkstar.UCSC.EDU>,
  395. >>Matthew Paul Cline <mpcline@cats.ucsc.edu> wrote:
  396. >>>The subject says it all.
  397.  
  398.  
  399. >>So what is it you are trying to do?  
  400.  
  401. >I am looking for a way to uniquely identify a Mac.  One idea was to  to
  402. >use the format time of the boot disk as the Macs ID number.  However,
  403. >if identifying a suitable drive will become that complicated, I'll figure
  404. >out another way.
  405.  
  406. Why not use the format time for the current system volume? (instead of
  407. the boot volume) It's a lot easier to get!
  408.  
  409. If the mac has built-in ethernet, then the (hardware) ethernet address
  410. is unique to that machine (NOT the IP address).
  411.  
  412. Other than that, there is NO foolproof method to uniquely identify a
  413. Macintosh. The creation date for the system disk is a reasonable way
  414. to distinguish macintoshes, but you should plan for failure. In a lab
  415. environment, some sysadmins use disk-cloning software to keep a bunch of
  416. machines' configuration identical. Some of these programs just use SCSI
  417. commands to completely replicate a disk. Every bit. Imagine your software
  418. seeing 50 macs with identical disks, down to the volume's creation date.
  419.  
  420. Marshall Clow
  421. Aladdin Software
  422. mclow@san_marcos.csusm.edu
  423.  
  424.  
  425.  
  426. +++++++++++++++++++++++++++
  427.  
  428. From jumplong@aol.com (Jump Long)
  429. Date: 4 Jun 1994 23:35:03 -0400
  430. Organization: America Online, Inc. (1-800-827-6364)
  431.  
  432. In article <2sofsm$fsh@darkstar.UCSC.EDU>, mpcline@cats.ucsc.edu
  433. (Matthew Paul Cline) writes:
  434.  
  435. > How to tell which volume was booted from?
  436.  
  437. This will give you the name and vRefNum of the current system disk
  438. which (as many have noted) may or may not be the boot volume:
  439.  
  440.  OSErr result;
  441.  short foundVRefNum;
  442.  long foundDirID;
  443.  Str255 systemDiskName = "\p";
  444.  long freeBytes;
  445.  
  446.  result = FindFolder(kOnSystemDisk, kSystemFolderType,
  447. kDontCreateFolder,
  448.       &foundVRefNum, &foundDirID);
  449.  if ( result == noErr )
  450.  {
  451.   result = GetVInfo(foundVRefNum, systemDiskName, &foundVRefNum,
  452. &freeBytes);
  453.   if ( result == noErr )
  454.    printf("%#s\n",systemDiskName);
  455.  }
  456.  
  457. - Jim Luther
  458.  
  459.  
  460. ---------------------------
  461.  
  462. From Steve Ethier <ethier@novell.com>
  463. Subject: Open Transport & ASLM (Was: Re: ASLM)
  464. Date: Wed, 25 May 1994 19:49:08 GMT
  465. Organization: Novell, Inc.
  466.  
  467. In article <CqDBHC.FA9@world.std.com> John McEnerney,
  468. johnmce@world.std.com writes:
  469. >Jim.Matthews@dartmouth.edu (Jim Matthews) writes:
  470. >
  471. >>Me too; fortunately they don't.  OpenTransport has a procedural
  472. interface
  473. >>that can be called from any development system that supports Pascal
  474. >>calling conventions (i.e. any development system that can call the Mac
  475. >>Toolbox).  So I believe it's a true statement that anything you can do
  476. >>today with the driver-based network APIs (.mpp, .atp, .xpp, .ipp) will
  477. be
  478. >>possible under OpenTransport from CodeWarrior.  I don't see any reason
  479. why
  480. >>I shouldn't be able to build an OpenTransport/TCP version of Fetch in
  481. >>CodeWarrior.
  482. >
  483. >If OpenTransport uses a 'pascal' procedural interface and uses ASLM only 
  484. >as a DLL solution, then the calling convention/runtime representation 
  485. >issue go away. It may be possible to get this to work with CodeWarrior 
  486. >with a modest amount of effort. Can someone point me to the proper 
  487. >documentation for building for OpenTransport?
  488.  
  489. Jim and John (and whoever else if following this thread), maybe I don't
  490. understand what is going on with these interfaces, but this is my take on
  491. it.
  492.  
  493. Apple's implementation of AppleTalk and TCP for Open Transport will
  494. support the old "paramblock" style APIs for backwards compatibility with
  495. existing applications.  In this case, having Open Transport in the ASLM
  496. architecture is really a non-issue.  As far as I know, Open Transport
  497. itself doesn't support the "paramblock" APIs, it is up to the protocol
  498. developer to provide that support (i.e., when I port MacIPX over to Open
  499. Transport, I will have to write additional code in order to support the
  500. existing "paramblock" style MacIPX APIs). 
  501.  
  502. Then, Open Transport provides the X/Open APIs in the following forms:
  503. standard XTI APIs which are procedural interfaces (and really are
  504. synchronous APIs), Apple's superset of the XTI APIs with a procedural
  505. interface (I believe their superset provides async operation, probably
  506. turns them into Pascal interfaces, etc.), and finally, Apple's superset
  507. of the XTI APIs in an object-oriented form.
  508.  
  509. As I understand it, *all* of the XTI Open Transport interfaces are only
  510. available via ASLM.  Even if you use the procedural XTI interface, you'll
  511. still need to communicate with the ASLM.  Also, from my perspective, I
  512. don't need the OO APIs at this time.  If I could get Metrowerks and
  513. Symantec support of procedural interfaces into Open Transport and the
  514. ASLM, this would make me happy for a while.  At least developers would be
  515. able to use some of the new Open Transport APIs with Metrowerks and
  516. Symantec.
  517.  
  518. I believe Garry Hornbuckle of Apple is acutely aware of all these issues
  519. and is working on getting them resolved.
  520.  
  521. Steve Ethier
  522. ethier@wc.novell.com
  523.  
  524. +++++++++++++++++++++++++++
  525.  
  526. From johnmce@world.std.com (John McEnerney)
  527. Date: Thu, 26 May 1994 02:49:36 GMT
  528. Organization: The World Public Access UNIX, Brookline, MA
  529.  
  530.  
  531. >As I understand it, *all* of the XTI Open Transport interfaces are only
  532. >available via ASLM.  Even if you use the procedural XTI interface, you'll
  533. >still need to communicate with the ASLM.  Also, from my perspective, I
  534. >don't need the OO APIs at this time.  If I could get Metrowerks and
  535. >Symantec support of procedural interfaces into Open Transport and the
  536. >ASLM, this would make me happy for a while.  At least developers would be
  537. >able to use some of the new Open Transport APIs with Metrowerks and
  538. >Symantec.
  539.  
  540. Someone has kindly volunteered to look into this for me. If there are no 
  541. OOP issues and the 'pascal' calling conventions are used, it may be 
  542. possible to use the OpenTransport interface from CodeWarrior. (In that 
  543. case, although OpenTransport is using ASLM, your program isn't except to 
  544. initialize/terminate it) This leaves only issues of importing the 
  545. OpenTransport and ASLM .o files--it may not work the first time, but this 
  546. is easier to fix than the C++ calling conventions.
  547.  
  548. Everyone should feel free to keep me posted with new developments.
  549.  
  550. -- John McEnerney, Metrowerks PowerPC Product Architect
  551.  
  552.  
  553. +++++++++++++++++++++++++++
  554.  
  555. From Steve Ethier <ethier@novell.com>
  556. Date: Thu, 26 May 1994 17:13:54 GMT
  557. Organization: Novell, Inc.
  558.  
  559. In article <CqE2Ip.3Kn@world.std.com> John McEnerney,
  560. johnmce@world.std.com writes:
  561. >Someone has kindly volunteered to look into this for me. If there are no 
  562. >OOP issues and the 'pascal' calling conventions are used, it may be 
  563.  
  564. I didn't volunteer because I don't have the cycles at this time, but if
  565. the kind soul helping you out isn't already familiar with XTI/TLI code, I
  566. do have some test code that I would be willing to share with that person
  567. to jump start the effort.  This code uses TLI (which is very similar to
  568. XTI), so it would take some work to move over to Apple's Open Transport
  569. APIs, but I think Open Transport also supports the XTI APIs, so maybe
  570. this person could just try those interfaces.
  571.  
  572. The only other drawback to this code is that I think the server side of
  573. it was a NetWare NLM I had also put together.  Of course, this code is 3
  574. years old, so I don't remember exactly how it went together.
  575.  
  576. Anyway, if this person is interested in seeing this code, please contact
  577. me.
  578.  
  579. Steve Ethier
  580. Internet: ethier@wc.novell.com
  581. Phone: 510-975-4518
  582. AppleLink: NOVELL.WCENG (Put [SLE] in the subject so that it'll get
  583. routed to me)
  584.  
  585. +++++++++++++++++++++++++++
  586.  
  587. From garryh@seeding.apple.com (Garry Hornbuckle)
  588. Date: 4 Jun 1994 01:06:54 GMT
  589. Organization: Apple Computer
  590.  
  591. In article <CqE2Ip.3Kn@world.std.com>, johnmce@world.std.com (John
  592. McEnerney) wrote:
  593.  
  594. > Someone has kindly volunteered to look into this for me. If there are no 
  595. > OOP issues and the 'pascal' calling conventions are used, it may be 
  596. > possible to use the OpenTransport interface from CodeWarrior. (In that 
  597. > case, although OpenTransport is using ASLM, your program isn't except to 
  598. > initialize/terminate it) This leaves only issues of importing the 
  599. > OpenTransport and ASLM .o files--it may not work the first time, but this 
  600. > is easier to fix than the C++ calling conventions. 
  601.  
  602. DISCLAIMER: I'm an programmer/software engineer turned marketing guy. I've
  603. written a lot of code in my life, but compilers, linkers, or dynamic
  604. loading architectures are not on my resume. The following comments are
  605. based on someone else's (informed) explanation to me of what the issues are
  606. here. If I screw-up or misstate something here, it's my error. 
  607.  
  608. Apple Shared Library Manager is one of several dynamic link and load
  609. architectures in the Mac OS today (others include the Code Fragment
  610. Manager, the upcoming implementation of System Object Model, the QuickTime
  611. component manager, and the Comm ToolBox). The differences between each of
  612. these, and when to use what, are important discussions...but not for this
  613. thread.
  614.  
  615. If you possibly can, you should get access to a video or audio tape of the
  616. '94 WWDC session titled "DLLs and Shared Objects on Macintosh" - the first
  617. 20-30 minutes of the session was spent explaining key differences between
  618. these technologies and looking at how to pick which one to use for the
  619. specific job at hand.
  620.  
  621. Almost by definition, DLL architectures need to have some knowledge of code
  622. internals and runtime "stuff". (SOM avoids many of these problems, but
  623. requires you to describe things first in an IDL). During the design and
  624. implementation of ASLM, when it came time to "know things and stuff", ASLM
  625. engineers looked at MPW's behavior as a reference model. Whether this is
  626. good or bad probably depends on what you think about MPW (which is also not
  627. the point of this thread). What is important to know, however, is that
  628. other compiler/linker developers have made choices, for their own very good
  629. and important reasons, to do "things" and store "stuff" differently than
  630. MPW does.
  631.  
  632. As a result, today ASLM is straightforward to use with MPW, but difficult
  633. or even impossible to use with other compiler/linker tools such as the
  634. MetroWerks or Symantec environments. This is an issue of concern for all
  635. ASLM developers. 
  636. Based on what I've been able to understand about this, I believe that there
  637. are five key things that must be true to state that "Compiler XXXX supports
  638. ASLM" or conversely, that "ASLM supports Compiler XXXX". And there are four
  639. different levels of interoperability possible.
  640.  
  641. Level One Compatiblity
  642. - --------------------
  643. At this level, I can build C or Pascal language programs that use the
  644. services of ASLM and load ASLM shared libaries. The C or Pascal language
  645. programs can be built with the compiler/linker of my choice. The shared
  646. libraries must be built with MPW, or with a compiler/linker that conforms
  647. to all of MPW's "stuff". (A MetroWerks C or Pascal app could use ASLM to
  648. load and share a MPW shared library).
  649.  
  650. To reach Level One Compatibility, 3 things must be true:
  651.  
  652. • the Compiler/Linker chosen must be able to import the 'LibraryMgr.o' file
  653. supplied in the ASLM developer kit. 
  654.  
  655. • the Compiler/Linker chosen and ASLM must agree on data representation
  656. issues such as insertion of padding bytes, struct alignment, etc.
  657.  
  658. This agreement could come because the compiler handles these things the
  659. same way as does MPW (and thus conforms to ASLM's expectation), or possibly
  660. because the compiler offers a switch to conform to MPW conventions as an
  661. option. By itself, having ASLM offer a switch to conform to the compiler's
  662. expectations would not be sufficient to achieve this level of compatibility
  663. (I don't think), because the shared libaries would have been built with MPW
  664. and thus there would potentially be disagreement on this fundamental issue.
  665.  
  666. •    the Compiler/Linker chosen and ASLM must agree on calling conventions; Is
  667. it going to be C for C, Pascal for Pascal? Pascal for everything?
  668.  
  669. Again, this agreement could come because the compiler handles these things
  670. the same way as does MPW (and thus conforms to ASLM's expectation), or
  671. because the compiler offers a switch to conform to MPW conventions as an
  672. option. By itself, having ASLM offer a switch to conform to the compiler's
  673. expectations would not be sufficient to achieve this level of compatibility
  674. (I don't think), because the shared libaries would have been built with MPW
  675. and thus there would potentially be disagreement on this fundamental issue.
  676.  
  677. Level Two Compatibility
  678. - ---------------------
  679. At this level, I can also build C++ programs that use the services of ASLM
  680. and load ASLM shared libaries. The C++ programs can be built with the
  681. compiler/linker of my choice. The shared libraries must be built with MPW,
  682. or with a compiler/linker that conforms to all of MPW's "stuff". (A
  683. MetroWerks C++ app could use ASLM to load and share a MPW shared library).
  684.  
  685. To reach Level Two Compatibility, all three conditions from Level One must
  686. be satisfied. In addition, the following condition must also be true:
  687.  
  688. • the Compiler/Linker chosen and ASLM must agree on the V-table format in
  689. use.
  690.  
  691. This agreement could come because the compiler handles these things the
  692. same way as does MPW (and thus conforms to ASLM's expectation), or because
  693. the compiler offers a switch to conform to MPW conventions. By itself,
  694. having ASLM offer a switch to conform to the compiler's expectations would
  695. not be sufficient to achieve this level of compatibility (I don't think),
  696. because the shared libaries would have been built with MPW and thus there
  697. would potentially be disagreement on this fundamental issue.
  698.  
  699. Level Three Compatibility
  700. - -----------------------
  701. At this level, I can also build shared libraries that can be loaded by ASLM
  702. upon direction from a client application. The client application and the
  703. shared libaries can be built with THE SINGLE compiler/linker of my choice.
  704. (A MetroWerks C, Pascal, or C++ application could use ASLM to load a
  705. MetroWerks shared library).
  706.  
  707. To reach Level Three Compatibility, all four conditions from Level One and
  708. Level Two must be satisfied. In addition, the following condition must also
  709. be true:
  710.  
  711. • the Compiler/Linker chosen and ASLM must agree on the format of the
  712. object file.
  713.  
  714. This agreement could come because the compiler handles these things the
  715. same way as does MPW (and thus conforms to ASLM's expectation), or because
  716. the compiler offers a switch to conform to MPW conventions, _or_ by having
  717. an ASLM switch that directs ASLM to conform to the compiler's expectations
  718. for "stuff".
  719.  
  720. Level Four Compatibility
  721. - ----------------------
  722. At this level I can build C, Pascal or C++ client applications, as well as
  723. shared libraries that can be loaded by ASLM upon direction from a client
  724. application. The client application and the shared libaries can be built
  725. with a MIX-AND-MATCH set of compilers/linkers of my choice. Libraries, both
  726. procedural and object-oriented, from multiple compilers could be
  727. dynamically loaded and shared. (A MetroWerks main could load a shared
  728. library that had been built with Symantec tools, for example).
  729.  
  730. To reach Level Four Compatibility, all five conditions from Level One
  731. through Level Three must be satisfied. In addition, the following condition
  732. must also be true:
  733.  
  734. • ALL Compilers/Linkers and ASLM must agree on ALL the "stuff" outlined
  735. above.
  736.  
  737. This agreement, I believe, could only come through an industry or defacto
  738. standard representation and format for data, calling conventions, V-table
  739. formats, and object file formats. To my knowledge, no such single format
  740. agreement, spanning MPW, MetroWerks, and Symantec tools, exists (I'd love
  741. to be wrong on this). 
  742.  
  743. - ----------------------
  744.  
  745. I really appreciate the support for and interest in ASLM by applications
  746. and tool developers such as the great folks at MetroWerks and Symantec. I'm
  747. interested in working out multi-tool support for ASLM, and am willing to
  748. seriously investigate changes to ASLM if there is a real possibility of
  749. getting to Level Four compatibility!
  750.  
  751. Comments and corrections are welcome. But please, no technical flames. I'm
  752. only the marketing guy. ;)
  753.  
  754.  
  755. Garry "also the ASLM guy" Hornbuckle
  756.  
  757. - ---------------------------------------------------------------------
  758. Garry Hornbuckle        Product Manager, Communications & Collaboration
  759. - ---------------------------------------------------------------------
  760. "If I told you that I   | email      garryh@seeding.apple.com
  761.  spoke only for myself  | applelink  HORNBUCKLE1
  762.  would you believe me?" | fax        (408) 974-1211
  763. - ---------------------------------------------------------------------
  764.  
  765. ---------------------------
  766.  
  767. From jc@vivitech.com (John Cooper)
  768. Subject: Symantec at WWDC (Was: Symantec vs. Metrowerks? What to do?)
  769. Date: Sun, 22 May 1994 13:55:55 GMT
  770. Organization: Vivid Technologies Inc.
  771.  
  772. In article <2ren5c$f12@news.delphi.com> thundero@news.delphi.com (THUNDERONE@DELPHI.COM) writes:
  773. >> A couple of more things.  First, today, Symantec has announced some 
  774. >> new tools -- a subscription CD that has development versions of 
  775. >> compilers and such on it.
  776. >Hehehe...  I wonder where they got *that* idea.  But are Symantec's 
  777. >prereleases as stable as Metrowerks? Can you post some more details, 
  778. >or at least the month of the MacTech issue reviewing this CD? Symantec 
  779. >folks, you guys want to post some details? Phil? Tom?
  780.  
  781.    I heard from a friend who attended WWDC that Symantec was boo'ed and
  782. hissed at by a room full of developers during a seminar. Such a reception
  783. is usually reserved for Microsoft alone...
  784.  
  785.    This same friend also characterized Symantec's tools announcements as
  786. mostly: "We'll have that too, someday..." I guess developers weren't too
  787. impressed with Symantec this year.
  788.  
  789.    Can anyone else who attended offer their observations/opinions/insights?
  790.  
  791. -John
  792.  
  793. +--------------------------+------------------------------------------+
  794. | John R. Cooper           | Internet: jc@vivitech.com,               |
  795. | Vivid Technologies, Inc. |           jcooper@world.std.com          |
  796. | Waltham, MA 02154        | AOL:      JRCooper (jrcooper@aol.com)    |
  797. +--------------------------+------------------------------------------+
  798. | "God split himself into a myriad parts that he might have friends." |
  799. | This may not be true, but it sounds good and is no sillier than any |
  800. | other theology.                                                     |
  801. |                        -- Long's Notes --                           |
  802. +---------------------------------------------------------------------+
  803.  
  804. +++++++++++++++++++++++++++
  805.  
  806. From mikel@intercon.com (Michael W. Wellman)
  807. Date: Mon, 23 May 1994 13:38:57 -0500
  808. Organization: InterCon Systems Corp., Herndon, VA, USA
  809.  
  810. In article <1994May22.135555.5162@vivitech.com>, jc@vivitech.com (John 
  811. Cooper) writes:
  812. >    I heard from a friend who attended WWDC that Symantec was boo'ed and 
  813. > hissed at by a room full of developers during a seminar. Such a 
  814. > reception is usually reserved for Microsoft alone... 
  815. >  
  816. >    This same friend also characterized Symantec's tools announcements 
  817. > as mostly: "We'll have that too, someday..." I guess developers 
  818. > weren't too impressed with Symantec this year. 
  819. >  
  820. >    Can anyone else who attended offer their observations/opinions/
  821. > insights? 
  822.  
  823. Symantec was repeatedly hissed at WWDC.  Essentially, every time Apple 
  824. mentioned their respective names during the "Developer Tools State of the 
  825. Union", Symantec was hissed and Metrowerks was applauded.
  826.  
  827. When it came time to do their presentations, Metrowerks blew everyone away.  
  828. Their demo consisted of their compiling the 68k version of Metrowerks, the 
  829. PowerPC version of Metrowerks, and MacApp 3.1; some 1.4 million lines of code 
  830. in some 11 minutes (in fact, the talking portion of the presentation finished 
  831. first so they stopped the compile before it all finished, but they were only 
  832. a few files from the end of MacApp).  This was followed by testimonials from 
  833. people from Adobe, Apple, Claris, and other companies.  Summary of the 
  834. testimonials:  Metrowerks not only cures cancer, it causes world peace.
  835.  
  836. By the time Symantec took the stage, no one was booing anymore simply because 
  837. everyone felt sorry for them.  They decided not to compile, not to show the 
  838. debugger, and when they went to show some of their "cool" stuff, it 
  839. repeatedly crashed.
  840.  
  841. To be fair, Symantec had added some nifty features to both their 7.0.1 
  842. release and their next generation environment.  You can finally open a file 
  843. without a project being open; you can open multiple projects; projects can be 
  844. nested nicely in the project window and double-clicking them opens another 
  845. project window; they support descending sub-projects and automatically 
  846. rebuilding them if necessary; they've got multiple-paned windows; etc.
  847.  
  848. The consensus seemed to be too little too late.
  849.  
  850. Personally, three of the five people I was with left immediately after the 
  851. Metrowerks demo to buy a copy of Metrowerks and see if we could get some 
  852. things compiled before dinner... ;-)
  853.  
  854. I'm personally disappointed that both Metrowerks and Symantec seem pretty 
  855. dedicated to not supporting Apple's Shared Library Manager since you can't 
  856. use Open Transport without such support.
  857.  
  858. mikel
  859.  
  860.  
  861.  
  862.  
  863.  
  864. +++++++++++++++++++++++++++
  865.  
  866. From mxmora@unix.sri.com (Matt Mora)
  867. Date: 23 May 94 23:10:26 GMT
  868. Organization: SRI International, Menlo Park, CA
  869.  
  870. In article <9405231338.AA57725@mikel.intercon.com> mikel@intercon.com 
  871. (Michael W. Wellman) writes:
  872.  
  873. >I'm personally disappointed that both Metrowerks and Symantec seem pretty 
  874. >dedicated to not supporting Apple's Shared Library Manager since you can't 
  875. >use Open Transport without such support.
  876.  
  877.  
  878. Or that the OpenTransport team decided to use ASLM.
  879.  
  880.  
  881.  
  882. Xavier
  883.  
  884.  
  885.  
  886.  
  887.  
  888. -- 
  889. ___________________________________________________________
  890. Matthew Xavier Mora                       Matt_Mora@sri.com
  891. SRI International                       mxmora@unix.sri.com
  892. 333 Ravenswood Ave                    Menlo Park, CA. 94025
  893.  
  894. +++++++++++++++++++++++++++
  895.  
  896. From d88-jwa@dront.nada.kth.se (Jon W‰tte)
  897. Date: 24 May 1994 06:17:50 GMT
  898. Organization: The Royal Institute of Technology
  899.  
  900. >>I'm personally disappointed that both Metrowerks and Symantec seem pretty 
  901. >>dedicated to not supporting Apple's Shared Library Manager since you can't 
  902. >>use Open Transport without such support.
  903.  
  904. >Or that the OpenTransport team decided to use ASLM.
  905.  
  906. Won't ASLM come on top of the CFM? And both MW and SC will of course
  907. support the CFM. The only thing left is making the name mangling
  908. conform to CFront standards.
  909.  
  910. Cheers,
  911.  
  912.                     / h+
  913. -- 
  914.  -- Jon W{tte, h+@nada.kth.se, Mac Software Engineer Deluxe --
  915.  
  916.   "From now on I will re-label the EQ on the deck as Fizz and Wobble
  917.    instead of HF and LF."
  918.  
  919. +++++++++++++++++++++++++++
  920.  
  921. From Chris Hanson <chanson@mtlookitthat.chi.il.us>
  922. Date: Mon, 23 May 94 22:53:26 -0600
  923. Organization: Green Dragon Creations, Inc.
  924.  
  925.  
  926. In article <9405231338.AA57725@mikel.intercon.com>, Michael W. Wellman 
  927. writes:
  928.  
  929. > I'm personally disappointed that both Metrowerks and Symantec seem pretty 
  930. > dedicated to not supporting Apple's Shared Library Manager since you can't 
  931. > use Open Transport without such support.
  932.  
  933. I think it's more Apple's fault, actually.  Shared Library Manager is designed 
  934. to work with MPW C++ (which is CFront 2.something, I think).  This is because 
  935. it explicitly supports only C++, and relies on the structure of MPW's virtual 
  936. tables and the way MPW munges method names.  Of course, since Apple has 
  937. committed to SOM I think they'd be stupid not to support Open Transport on it 
  938. also.  My bet is that they will; until SOM support is formally integrated into 
  939. the OS, we'll probably rely on ASLM for such matters.
  940.  
  941. TTFN,
  942. Chris
  943.  
  944. +++++++++++++++++++++++++++
  945.  
  946. From mikel@intercon.com (Michael W. Wellman)
  947. Date: Tue, 24 May 1994 09:37:02 -0500
  948. Organization: InterCon Systems Corp., Herndon, VA, USA
  949.  
  950. I wrote:
  951. > > I'm personally disappointed that both Metrowerks and Symantec 
  952. > > seem pretty dedicated to not supporting Apple's Shared Library 
  953. > > Manager since you can't use Open Transport without such support. 
  954.  
  955. Chris Hanson <chanson@mtlookitthat.chi.il.us> wrote:
  956. > I think it's more Apple's fault, actually.  Shared Library Manager is 
  957. > designed to work with MPW C++ (which is CFront 2.something, I 
  958. > think).  This is because it explicitly supports only C++, and relies 
  959. > on the structure of MPW's virtual tables and the way MPW munges 
  960. > method names.  Of course, since Apple has committed to SOM I think 
  961. > they'd be stupid not to support Open Transport on it also.  My bet is 
  962. > that they will; until SOM support is formally integrated into the 
  963. > OS, we'll probably rely on ASLM for such matters. 
  964.  
  965. I vaguely recall something about SOM not being capable of dealing with issues 
  966. such as interrupts (you pay some prices for platform independence).  If this 
  967. memory is correct, it'd be very hard to build a networking structure on top 
  968. of it.
  969.  
  970. Also; in Apple's defense (or, more directly, in the Open Transport team's 
  971. defense), I don't believe SOM was available as an option when ASLM was 
  972. implemented.
  973.  
  974. Both Metrowerks and Symantec stated that it was the vtable dependencies that 
  975. made them not want to do the work, that they've spent a lot of time 
  976. optimizing their compilers to generate more efficient vtables, and that they 
  977. didn't want to spend still more time making them less efficient.
  978.  
  979. All of the issues make sense; but it's inconvenient having to give up 
  980. Metrowerks because of this (clearly, if Open Transport needs ASLM, I'm not 
  981. giving up ASLM).
  982.  
  983. mikel
  984.  
  985.  
  986.  
  987.  
  988.  
  989. +++++++++++++++++++++++++++
  990.  
  991. From woody@alumni.caltech.edu (William Edward Woody)
  992. Date: 24 May 1994 18:08:55 GMT
  993. Organization: California Institute of Technology, Alumni Association
  994.  
  995. Michael W. Wellman <mikel@intercon.com> wrote:
  996. >I'm personally disappointed that both Metrowerks and Symantec seem pretty 
  997. >dedicated to not supporting Apple's Shared Library Manager since you can't 
  998. >use Open Transport without such support.
  999.  
  1000. Call me stupid (having zero experience with ASLM), but on my E.T.O. #14
  1001. disk there's this directory (E.T.O.:Tools - Objects:Apple Shared Libary
  1002. Manager:ASLM 1.1.GM:ASLM Symantec Support) containing stuff which reportedly
  1003. allow you to develop and use ASLM with both Symantec C++ for MPW and
  1004. Symantec C++ for Macintosh v6.0.1.
  1005.  
  1006.                         - Bill
  1007. -- 
  1008.  "A secret face--a touch of grace        William Edward Woody
  1009.   A man must learn to give a little space    woody@alumni.cco.caltech.edu
  1010.   A peaceful state--a submissive trait
  1011.   A man must learn to gently dominate" -- Rush, "Animate"
  1012.  
  1013. +++++++++++++++++++++++++++
  1014.  
  1015. From johnmce@world.std.com (John McEnerney)
  1016. Date: Tue, 24 May 1994 21:11:09 GMT
  1017. Organization: The World Public Access UNIX, Brookline, MA
  1018.  
  1019. mikel@intercon.com (Michael W. Wellman) writes:
  1020.  
  1021. >Both Metrowerks and Symantec stated that it was the vtable dependencies that 
  1022. >made them not want to do the work, that they've spent a lot of time 
  1023. >optimizing their compilers to generate more efficient vtables, and that they 
  1024. >didn't want to spend still more time making them less efficient.
  1025.  
  1026. In order to support ASLM, every aspect of our C++ implementation would 
  1027. need to be identical to MPW cfront (on 68K) and PPCC (on PowerPC). This 
  1028. gives us very little latitude in improving calling conventions, vtables 
  1029. formats, name mangling, etc. all to support an interface which makes up 
  1030. at most 1% of your program. Seems like a heavy price to pay. (Which is 
  1031. not to say our current implementation is more efficient at the moment, 
  1032. but we'd certainly like it to continue optimizing it)
  1033.  
  1034. Furthermore, we'd need to generate MPW .o files on 68K and XCOFF files on 
  1035. PowerPC so that the ASLM tools could do their pre- and post-processing.
  1036. This would require again a substantial amount of work which is better 
  1037. spent improving our code generation, implementing templates, etc.
  1038.  
  1039. SOM solves many of these issues because it reduces the C++ interface to a 
  1040. C interface, and it is much easier to be compatible with that (we already 
  1041. are on PowerPC, will be soon on 68K)
  1042.  
  1043. >All of the issues make sense; but it's inconvenient having to give up 
  1044. >Metrowerks because of this (clearly, if Open Transport needs ASLM, I'm not 
  1045. >giving up ASLM).
  1046.  
  1047. Take this up with the Open Transport engineers. It was a shortsighted 
  1048. decision to use a technology supported only by Apple's tools. I can't 
  1049. believe that it was impossible to implement the necessary functionality 
  1050. without component C++ objects in ASLM shared libs.
  1051.  
  1052. We are working closely with Apple to support SOM and CFM (PowerPC and 68K).
  1053.  
  1054. -- John McEnerney, Metrowerks PowerPC Product Architect
  1055.  
  1056.  
  1057. +++++++++++++++++++++++++++
  1058.  
  1059. From mxmora@unix.sri.com (Matt Mora)
  1060. Date: 24 May 1994 16:07:01 -0700
  1061. Organization: SRI International, Menlo Park, CA
  1062.  
  1063. In article <CqBs6M.D20@world.std.com> johnmce@world.std.com (John McEnerney) 
  1064. writes:
  1065.  
  1066. >Take this up with the Open Transport engineers. It was a shortsighted 
  1067.  
  1068. I did and he wasn't very happy about it. I guess I touched a raw nerve
  1069. but Garry Honbukle was very defensive about it. Oh well, looks
  1070. like I won't be doing any opentransport stuff anytime soon. Good
  1071. thing they are not going to break the old API.
  1072.  
  1073.  
  1074. >We are working closely with Apple to support SOM and CFM (PowerPC and 68K).
  1075.  
  1076. I agree with John. It seem like a much better way to go.
  1077.  
  1078.  
  1079.  
  1080. Xavier
  1081.  
  1082.  
  1083.  
  1084. -- 
  1085. ___________________________________________________________
  1086. Matthew Xavier Mora                       Matt_Mora@sri.com
  1087. SRI International                       mxmora@unix.sri.com
  1088. 333 Ravenswood Ave                    Menlo Park, CA. 94025
  1089.  
  1090. +++++++++++++++++++++++++++
  1091.  
  1092. From zstern@adobe.com (Zalman Stern)
  1093. Date: Wed, 25 May 1994 01:52:08 GMT
  1094. Organization: Adobe Systems Incorporated
  1095.  
  1096. Jon W tte writes
  1097. > Won't ASLM come on top of the CFM? And both MW and SC will of course
  1098. > support the CFM. The only thing left is making the name mangling
  1099. > conform to CFront standards.
  1100.  
  1101. Does ASLM depend on vtable layout? Perhaps the real answer is to standardize  
  1102. the whole C++ runtime to such a level that objects created by different  
  1103. compilers can be linked together. (What? Don't make you laugh so hard? MY  
  1104. apologies :-))
  1105. --
  1106. Zalman Stern           zalman@adobe.com            (415) 962 3824
  1107. Adobe Systems, 1585 Charleston Rd., POB 7900, Mountain View, CA 94039-7900
  1108.    Never let a "final candidate" subscript get above the age of consent.
  1109.  
  1110. +++++++++++++++++++++++++++
  1111.  
  1112. From johnmce@world.std.com (John McEnerney)
  1113. Date: Wed, 25 May 1994 07:06:07 GMT
  1114. Organization: The World Public Access UNIX, Brookline, MA
  1115.  
  1116. zstern@adobe.com (Zalman Stern) writes:
  1117.  
  1118. >Does ASLM depend on vtable layout? Perhaps the real answer is to standardize  
  1119. >the whole C++ runtime to such a level that objects created by different  
  1120. >compilers can be linked together. (What? Don't make you laugh so hard? MY  
  1121. >apologies :-))
  1122.  
  1123. While at Symantec I spent some time looking into all of the issues 
  1124. involved in supporting ASLM in the THINK compilers. I recall that ASLM 
  1125. exports an OOP interface to the many worthwhile features that it 
  1126. provides. This means that if you need to use any of these features, the 
  1127. code on the client side had better have the same naming conventions, 
  1128. vtable formats, and calling sequences as the code in the ASLM library.
  1129.  
  1130. There are other problems, such as tools which process the .o files output 
  1131. from the MPW compiler, though these may go away once CFM is universally 
  1132. supported.
  1133.  
  1134. However, the issue of compatible conventions doesn't go away. If a 
  1135. library exports an OOP interface, via ASLM or CFM, it would require that 
  1136. all compilers use the same conventions. SOM works around this by 
  1137. generating C++ wrappers to a C interface--your source code is in C++, but 
  1138. by the time a vtable is constructed or a virtual function is called, it 
  1139. has been reduced to simple C data structures and calling conventions.
  1140.  
  1141. I admit to never having looked into the exact requirements of Open 
  1142. Transport. I'll try to do some reading on it to see if a solution 
  1143. specific to Open Transport is possible.
  1144.  
  1145. -- John McEnerney, Metrowerks PowerPC Product Architect
  1146.  
  1147.  
  1148. +++++++++++++++++++++++++++
  1149.  
  1150. From lambert_l@measurex.com (Leon Lambert)
  1151. Date: Wed, 25 May 1994 19:16:13 GMT
  1152. Organization: measurex
  1153.  
  1154. I'd like to thank John McEnerney from Metrowerks for taking
  1155. an interest in this discussion. I haven't noticed Symantec even
  1156. talking about it.
  1157.  
  1158.  
  1159. Let's all just get along :)
  1160.  
  1161. +++++++++++++++++++++++++++
  1162.  
  1163. From d88-jwa@dront.nada.kth.se (Jon W‰tte)
  1164. Date: 26 May 1994 17:56:45 GMT
  1165. Organization: The Royal Institute of Technology
  1166.  
  1167. >> I'm personally disappointed that both Metrowerks and Symantec seem pretty 
  1168. >> dedicated to not supporting Apple's Shared Library Manager...
  1169.  
  1170. >Can you expand on this?  What stands in the way of using Metrowerks to
  1171. >do ASLM work?  (Particular language features?).  
  1172.  
  1173. ASLM relies on CFronts name mangling and vtable formats.
  1174.  
  1175. Case closed. :-)
  1176.  
  1177. >meantime I'd like to get some small OpenDoc parts built and the only
  1178. >compiler I have here is CodeWarrior.  (I've also own the current rev of
  1179.  
  1180. No Can Do unless you a) replace ASLM or b) wait for the CFM/SOM version
  1181. due Any Year Now.
  1182.  
  1183. -- 
  1184.  -- Jon W{tte, h+@nada.kth.se, Mac Software Engineer Deluxe --
  1185.    This sig is less than 3 lines: Improve the UseNet S/N ratio!
  1186.  
  1187. +++++++++++++++++++++++++++
  1188.  
  1189. From peter@ncrpda.curtin.edu.au (Peter N Lewis)
  1190. Date: 27 May 1994 07:42:43 +0800
  1191. Organization: NCRPDA, Curtin University
  1192.  
  1193. johnmce@world.std.com (John McEnerney) writes:
  1194.  
  1195. >zstern@adobe.com (Zalman Stern) writes:
  1196.  
  1197. >I admit to never having looked into the exact requirements of Open 
  1198. >Transport. I'll try to do some reading on it to see if a solution 
  1199. >specific to Open Transport is possible.
  1200.  
  1201.  
  1202. Garry says that SOM can't be used for Open Transport.  I don't know why,
  1203. but I do know that one of thse has to happen:
  1204.  
  1205. - Metrowerks supports ASLM in their Pascal compiler (seems quite unlikely).
  1206. - Symantec supports ASLM in THINK Pascal (fat chance!)
  1207. - Open Transport moves to SOM (Garry says this is impossible)
  1208. - Dylan supportsd ASLM and I move to it.
  1209.  
  1210. Or I could just find a new area on the Mac to work on....
  1211.     Peter.
  1212. -- 
  1213. I'm at a conference (WWDC) and on holiday until June 1, so my messages
  1214. will be short, delayed, imprecise, and less helpful than usual.  Sorry!
  1215. Peter N Lewis <peter.lewis@info.curtin.edu.au>       Ph: +61 9 368 2055
  1216.  
  1217. +++++++++++++++++++++++++++
  1218.  
  1219. From phixus@netcom.com (Chris DeSalvo)
  1220. Date: Sat, 28 May 1994 06:43:16 GMT
  1221. Organization: NETCOM On-line Communication Services (408 261-4700 guest)
  1222.  
  1223. Back the original thread:  No, Symantec wasn't booed and hissed that
  1224. badly.  There was a little, but it wasn't TOO much.  Yes, their TCL
  1225. 2.0 Demo (which was very simple) crashed.  But so did the first demo
  1226. of OpenDoc during the opening Keynote address.
  1227.  
  1228. In Symantec's favor:  They threw the most awesome party of the
  1229. convention!  It was at Gordon Biersch, a local bar/brewery.  The
  1230. fresh-brewed beer and the food were all awesome.
  1231.  
  1232. In regards to ASLM and it's dependency on CFront conventions:
  1233. I just read today that Apple has made an agreement with Symantec to do
  1234. a technology trade and get their compiler front-end, abandoning the
  1235. CFront stuff in the process.
  1236.  
  1237. Anyone wanna venture a speculation of what this means for future
  1238. development?  Also, I do recal in one of the WWDC sessions Apple
  1239. saying something to the effect that althrough a lot of the libraries
  1240. for the new technologies was OO-oriented, you didn't have to use an
  1241. OOPL to utilize them.  Anyone recall this, or was I too hung-over?
  1242.  
  1243. L8R
  1244. Chris
  1245. -- 
  1246. +-----------------------------------------------------------------+
  1247. | phixus@netcom.com           |   Macintosh:  Changing the world, |
  1248. | Chris De Salvo              |        one person at a time!      |
  1249. | Professional Mac Geek       |    -----------------------------  |
  1250. | for MacPlay, Inc.           |      (I wish they'd hurry up!)    |
  1251. +-----------------------------------------------------------------+
  1252.  
  1253. Any opinions expressed, or implied, are my own!  They should not be
  1254. considered representative of the opinions or policies of my employer,
  1255. MacPlay, a division of Interplay Productions, Inc.
  1256.  
  1257. +++++++++++++++++++++++++++
  1258.  
  1259. From somogyi@ziff.com (Stephan Somogyi)
  1260. Date: Mon, 30 May 1994 20:37:18 GMT
  1261. Organization: Digital Media
  1262.  
  1263. In article <2s3c5j$a03@ncrpda.curtin.edu.au>, peter@ncrpda.curtin.edu.au
  1264. (Peter N Lewis) wrote:
  1265.  
  1266. > Garry says that SOM can't be used for Open Transport.  I don't know why,
  1267. > but I do know that one of thse has to happen:
  1268.  
  1269. If memory serves, the reasons are that SOM isn't interrupt-safe and the
  1270. overhead incurred by SOM makes it unsuitable for time-critical code such
  1271. as a protocol stack.
  1272.  
  1273. ____________________________________________________________________________
  1274. Stephan Somogyi             Vorsprung durch Technik            Digital Media
  1275.  
  1276. +++++++++++++++++++++++++++
  1277.  
  1278. From somogyi@ziff.com (Stephan Somogyi)
  1279. Date: Mon, 30 May 1994 20:45:16 GMT
  1280. Organization: Digital Media
  1281.  
  1282. In article <9405240937.AA02456@mikel.intercon.com>, mikel@intercon.com
  1283. (Michael W. Wellman) wrote:
  1284.  
  1285. > All of the issues make sense; but it's inconvenient having to give up 
  1286. > Metrowerks because of this (clearly, if Open Transport needs ASLM, I'm
  1287. > not  giving up ASLM).
  1288.  
  1289. After talking to several people at WWDC about this, I'm not convinced that
  1290. things are quite this bleak.
  1291.  
  1292. OpenTransport will have a C-based procedural interface that one could
  1293. (theoretically -- I haven't looked into this yet myself) write one's own
  1294. C++ wrappers around. However, I don't know whether there are any penalties
  1295. for using the C-based interfaces rather than the C++ interfaces.
  1296.  
  1297. To the best of my knowledge, the issues surrounding support of ASLM (and
  1298. the resultant requirements for compatible name mangling and vtable
  1299. formats) are only relevant if one wants to use OpenTransport's C++
  1300. interfaces.
  1301.  
  1302. ____________________________________________________________________________
  1303. Stephan Somogyi             Vorsprung durch Technik            Digital Media
  1304.  
  1305. +++++++++++++++++++++++++++
  1306.  
  1307. From amanda@intercon.com (Amanda Walker)
  1308. Date: Thu,  2 Jun 1994 15:48:32 -0500
  1309. Organization: InterCon Systems Corporation, Herndon, VA  USA
  1310.  
  1311. somogyi@ziff.com (Stephan Somogyi) writes:
  1312. > OpenTransport will have a C-based procedural interface that one 
  1313. > could (theoretically -- I haven't looked into this yet myself) write 
  1314. > one's own C++ wrappers around. However, I don't know whether there are 
  1315. > any penalties for using the C-based interfaces rather than the 
  1316. > C++ interfaces. 
  1317.  
  1318. The C++ class is, in fact, simply a wrapper around the C interface, as far as 
  1319. I can tell.
  1320.  
  1321. > To the best of my knowledge, the issues surrounding support of ASLM 
  1322. > (and the resultant requirements for compatible name mangling and 
  1323. > vtable formats) are only relevant if one wants to use OpenTransport's 
  1324. > C++ interfaces. 
  1325.  
  1326. You still need at least minimal ASLM support in order to use the C API, since 
  1327. it's an ASLM function set, not a statically linked library.  Also, the 
  1328. LibraryManager.o library needs to have its vtables set up and constructors 
  1329. called, which necessitates at least a simulacrum of the MPW C++ initialization
  1330. code.
  1331.  
  1332. The basic problem is that the ASLM is a hack (albeit a very clever hack).  It 
  1333. will thus require a hack to access it from Code Warrior.  The only question is 
  1334. how twisted such a hack will turn out to be.  Also note that this is only a 
  1335. big problem on the 68K side.  The PPC ASLM is built on top of CFM, which 
  1336. should help a lot.  Unfortunately, Open Transport seeds have been 68K-only 
  1337. builds so far.
  1338.  
  1339. None of this is intractable by any means.  It's just annoying :).
  1340.  
  1341.  
  1342. Amanda Walker
  1343. InterCon Systems Corporation
  1344.  
  1345.  
  1346.  
  1347.  
  1348.  
  1349. +++++++++++++++++++++++++++
  1350.  
  1351. From seaquest@netcom.com (Pete Mackie)
  1352. Date: Sat, 4 Jun 1994 15:52:56 GMT
  1353. Organization: Seaquest Software
  1354.  
  1355. In Article <somogyi-3005941337180001@lre2.macuser.ziff.com>,
  1356. somogyi@ziff.com (Stephan Somogyi) wrote:
  1357. >In article <2s3c5j$a03@ncrpda.curtin.edu.au>, peter@ncrpda.curtin.edu.au
  1358. >(Peter N Lewis) wrote:
  1359. >
  1360. >> Garry says that SOM can't be used for Open Transport.  I don't know why,
  1361. >> but I do know that one of thse has to happen:
  1362. >
  1363. >If memory serves, the reasons are that SOM isn't interrupt-safe and the
  1364. >overhead incurred by SOM makes it unsuitable for time-critical code such
  1365. >as a protocol stack.
  1366. >
  1367.  
  1368. I also heard that SOM isn't interrupt-safe at WWDC therefore cannot be used
  1369. for Open Transport.  However, Apple states that my not always be true.  See
  1370. Apple's DDL Statement of Direction following.  This may help you, or confuse
  1371. you even more.   ;-)
  1372.  
  1373. ==========================================
  1374. Macintosh Dynamic Linked Libraries (DLLs)
  1375. ==========================================
  1376. ETO #14 (March '1994) Update
  1377.  
  1378. Apple has developed a complete technology solution for shared code, shared
  1379. objects, and dynamic linked libraries (DLLs) on the Macintosh. Parts of this
  1380. solution are available today, with additional parts becoming available in
  1381. the coming months.
  1382.  
  1383. There are three key components to Macintosh DLL strategy:
  1384.     o Apple's Shared Library Manager (ASLM),
  1385.     o Apple's Code Fragment Manager (CFM), and
  1386.     o IBM's System Object Model (SOM).
  1387.  
  1388. Here is a brief summary of ASLM, CFM, and SOM ...
  1389.  
  1390. ASLM
  1391. - ----------
  1392. Apple Shared Library Manager is the first component of Apple's DLL solution
  1393. to be available, and is an integral part of our overall DLL offering.  ASLM
  1394. supports shared code libraries for both procedural and object oriented
  1395. development efforts. A number of Apple products have already been based on
  1396. ASLM, including MacSNMP and the GeoPort communications pod technology. Third
  1397. parties such as Microsoft (OLE for Macintosh), Novell (AppWare), and Aldus
  1398. have also adopted ASLM to support their DLL needs.
  1399.  
  1400. In the future, additonal functionality will be added to the Macintosh
  1401. operating system as ASLM libraries, including our next generation
  1402. networking, the Open Transport Communications Architecture.
  1403.  
  1404. ASLM v1.1.1 is the currently shipping release. ASLM v2.0 is under
  1405. development, to provide support for native code shared libraries on Power
  1406. Macintosh (An alpha release is available on this ETO). ASLM 2.x sits on top
  1407. of (is based on) the Code Fragment Manager. This work is expected to produce
  1408. final product in 2Q CY94.
  1409.  
  1410. As CFM becomes available on 68K Macintosh (see below), ASLM version 2.1 will
  1411. support CFM on 68K as well, while continuing to support current 68K-style
  1412. shared libraries. Thus, 
  1413. ASLM v2.x will provide compatibility for ASLM v1.1 and v1.1.1 applications.
  1414.  
  1415. ASLM adds higher-level object-oriented capabilities to the environment that
  1416. are not a part of the Code Fragment Manager itself. ASLM is the technology
  1417. of choice when you:
  1418.  
  1419.     o need DLLs on 68K today ... ASLM is shipping
  1420.     o want simplicity and elegance with C++
  1421.     o want a simple but powerful extension mechanism using C, Pascal, or ASM
  1422.     o have performance sensitive (i.e., interrupt time) needs like networking
  1423.     o want run-time transparent dynamic loading and unloading of code
  1424.     o DON'T need transparent access to per-context global data
  1425.     o DON'T need to solve the "fragile base class" problem for C++
  1426.  
  1427. CFM
  1428. - ----------
  1429. As a second key step in our DLL strategy, Apple has developed a new
  1430. foundation layer for dynamic linking on the Macintosh known as the Code
  1431. Fragment Manager (CFM). CFM will be a core part of System Software on the
  1432. PowerPC Macintosh.
  1433.  
  1434. CFM is also being developed for the Macintosh on 68K. This work is expected
  1435. to produce final product in 3Q CY94.
  1436.  
  1437. The Code Fragment Manager provides code sharing and dynamic linking, with
  1438. features supporting per-context globals. CFM will be fully supported by
  1439. development tools on Macintosh.
  1440.  
  1441. CFM is the best bet when your application:
  1442.     o runs on PowerPC Macintosh first, and 68K Macintosh later
  1443.     o needs only basic dynamic loading and unloading of shared code
  1444.     o needs to reduce system overhead to the minimum amount
  1445.     o needs transparent access to per-context global data
  1446.     o DOES NOT need system-level OOP support
  1447.  
  1448.  
  1449. SOM
  1450. - ----------
  1451. Apple is in the process of licensing and porting IBM's System's Object Model
  1452. (SOM) technology to Macintosh. SOM is a multi-platform standard providing
  1453. for system-level sharable objects in a language-neutral way. SOM also solves
  1454. the "fragile base class" problem, avoiding the need for client libraries to
  1455. be recompiled when the base class they inherit from is in a different
  1456. library and is changed.
  1457.  
  1458. To offer these benefits (multi-platform support and fragile base-class
  1459. resolution) SOM requires the use of an IDL as a first step in the
  1460. development process.
  1461.  
  1462. SOM runs on top of CFM, and thus will become available on both 68K and
  1463. PowerPC Macintosh.
  1464.  
  1465. SOM is a foundation technology for OpenDoc. 
  1466.  
  1467.  
  1468. Integration
  1469. - ----------
  1470. SOM and ASLM will both live in a CFM run-time environment, and will both be
  1471. available on both 68K and PowerPC Macintosh. Thus there will be no
  1472. impediment to co-existence of ASLM and SOM, or to applications that use both
  1473. ASLM and SOM. In fact, a SOM class could easily call an ASLM class or
  1474. vice-versa.
  1475.  
  1476. Over time, some of the functionality provided by ASLM may be supplanted by
  1477. SOM. However, ASLM APIs will be preserved. As a result, applications written
  1478. to the ASLM API may have some functionality transparently migrated to SOM in
  1479. the future. 
  1480.  
  1481.  
  1482.  
  1483.  
  1484. ___________________________________________________________________
  1485. Pete Mackie                  |       Internet: seaquest@netcom.com   
  1486. Seaquest Software            |      AppleLink: D0937 
  1487. Portland, Oregon  USA        | America Online: Seaquest1
  1488. Voice: (503) 531-0252        |         eWorld: Seaquest
  1489. Fax:   (503) 629-8442        |               
  1490. _____________________________|_____________________________________
  1491.  
  1492. ---------------------------
  1493.  
  1494. From rkwee@ee.pdx.edu (Roland Kwee)
  1495. Subject: [Q] Finding out if volume is locked
  1496. Date: 2 Jun 1994 19:13:15 -0700
  1497. Organization: (none)
  1498.  
  1499.  
  1500. How do I quickly check if the volume is locked? New Inside Mac, Files,
  1501. p2-8 says I should check that before opening a file for write access,
  1502. because the file open call would return OK even on locked volumes.
  1503. They recommend calling PBHGetVInvo() (what a user-friendly system...)
  1504. which is described on p. 2-144, but I can't find the description
  1505. of the volume attributes ioVAtrb.
  1506.  
  1507. Does anybody know?
  1508.  
  1509. Thanks, Roland Kwee
  1510. (please send email directly to: RolandKwee@ACM.org)
  1511.  
  1512. +++++++++++++++++++++++++++
  1513.  
  1514. From mclow@coyote.csusm.edu (Marshall Clow)
  1515. Date: 2 Jun 1994 19:26:29 -0700
  1516. Organization: California State University San Marcos
  1517.  
  1518. Roland Kwee (rkwee@ee.pdx.edu) wrote:
  1519.  
  1520. >How do I quickly check if the volume is locked? New Inside Mac, Files,
  1521. >p2-8 says I should check that before opening a file for write access,
  1522. >because the file open call would return OK even on locked volumes.
  1523. >They recommend calling PBHGetVInvo() (what a user-friendly system...)
  1524. >which is described on p. 2-144, but I can't find the description
  1525. >of the volume attributes ioVAtrb.
  1526.  
  1527. >Does anybody know?
  1528.  
  1529. Here's my routine:
  1530.  
  1531. Boolean    VIsLocked ( short vRefNum ) {
  1532. #define    softLockBit        0x8000
  1533. #define hardLockBit        0x0080
  1534.     
  1535.     OSErr            err = noErr;
  1536.     HParamBlockRec    pb;
  1537.     Str255             vName;
  1538.     
  1539.     if ( vRefNum == kOnSystemDisk )
  1540.         vRefNum = FindSystemVolume ();
  1541.  
  1542.     vName [ 0 ] = '\0';
  1543.     pb.volumeParam.ioCompletion    = nil;
  1544.     pb.volumeParam.ioNamePtr    = vName;
  1545.     pb.volumeParam.ioVRefNum    = vRefNum;
  1546.     pb.volumeParam.ioVolIndex    = 0;
  1547.     err = PBHGetVInfoSync ( &pb );
  1548.     AssertStr ( err == noErr, "\pPBHGetVInfoSync in VIsLocked" );
  1549.     
  1550.     return ( pb.volumeParam.ioVAtrb & ( softLockBit | hardLockBit )) != 0;
  1551.     }
  1552.  
  1553. Marshall Clow
  1554. Aladdin Systems
  1555. mclow@san_marcos.csusm.edu
  1556.  
  1557.  
  1558. +++++++++++++++++++++++++++
  1559.  
  1560. From jumplong@aol.com (Jump Long)
  1561. Date: 4 Jun 1994 23:28:02 -0400
  1562. Organization: America Online, Inc. (1-800-827-6364)
  1563.  
  1564. In article <2sm3jr$cjn@cruella.ee.pdx.edu>, rkwee@ee.pdx.edu (Roland
  1565. Kwee) writes:
  1566.  
  1567. >How do I quickly check if the volume is locked? New Inside Mac,
  1568. Files,
  1569. >p2-8 says I should check that before opening a file for write
  1570. access,
  1571. >because the file open call would return OK even on locked volumes.
  1572. >They recommend calling PBHGetVInvo() (what a user-friendly
  1573. system...)
  1574. >which is described on p. 2-144, but I can't find the description
  1575. >of the volume attributes ioVAtrb.
  1576.  
  1577. >Does anybody know?
  1578.  
  1579. Funny you should ask. I added CheckVolLock to MoreFiles (the DTS File
  1580. Manager sample) this afternoon.  Here's the prototype, documentation,
  1581. and function. The only code not included here is the pcpy function
  1582. which I'm sure you can come up with (or grab it from MoreFiles).
  1583.  
  1584. /********************************************************************
  1585. *********/
  1586.  
  1587. pascal OSErr CheckVolLock(StringPtr pathname,
  1588.         short vRefNum);
  1589. /* Use CheckVolLock to determine if a volume is locked - either by
  1590.  hardware or by software. If CheckVolLock returns noErr, then the
  1591. volume
  1592.  is not locked.
  1593.  
  1594.  pathName input: Pointer to a full pathname or nil.  If you pass in a
  1595.  
  1596.       partial pathname, it is ignored. A full pathname to a
  1597.       volume must end with a colon character (:).
  1598.  vRefNum  input: Volume specification (volume reference number,
  1599. working
  1600.       directory number, drive number, or 0).
  1601. */
  1602.  
  1603. /********************************************************************
  1604. *********/
  1605.  
  1606. pascal OSErr CheckVolLock(StringPtr pathname,
  1607.         short vRefNum)
  1608. {
  1609.  HParamBlockRec pb;
  1610.  Str255 tempPathname;
  1611.  OSErr error;
  1612.  
  1613.  pb.volumeParam.ioVRefNum = vRefNum;
  1614.  if (pathname == nil) {
  1615.   pb.volumeParam.ioNamePtr = nil;
  1616.   pb.volumeParam.ioVolIndex = 0;  /* use ioVRefNum only */
  1617.  }
  1618.  else {
  1619.   pcpy((StringPtr)tempPathname, pathname); /* make a copy of the
  1620. string and */
  1621.   pb.volumeParam.ioNamePtr = (StringPtr)tempPathname; /* use the copy
  1622. so original isn't trashed */
  1623.   pb.volumeParam.ioVolIndex = -1; /* use ioNamePtr/ioVRefNum
  1624. combination */
  1625.  }
  1626.  error = PBHGetVInfoSync(&pb);
  1627.  
  1628.  if ( error == noErr )
  1629.  {
  1630.   if ( (pb.volumeParam.ioVAtrb & 0x0080) != 0 )
  1631.    error = wPrErr;  /* volume locked by hardware */
  1632.   else if ( (pb.volumeParam.ioVAtrb & 0x8000) != 0 )
  1633.    error = vLckdErr; /* volume locked by software */
  1634.  }
  1635.  
  1636.  return (error);
  1637. }
  1638.  
  1639. /********************************************************************
  1640. *********/
  1641.  
  1642. - Jim Luther
  1643.  
  1644.  
  1645. ---------------------------
  1646.  
  1647. End of C.S.M.P. Digest
  1648. **********************
  1649.  
  1650.