home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / progrmng / intcdvpc.sit / RegisterMySignature.c < prev    next >
MacBinary  |  1990-09-16  |  16.8 KB  |  [TEXT/MPS ]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Sun Sep 16 18:11:42 1990, modified Sun Sep 16 18:11:42 1990, creator 'MPS ', type ASCII, 16567 bytes "RegisterMySignature.c" , at 0x4137 382 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MPS ]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 15 52 65 67 69 73 74 | 65 72 4d 79 53 69 67 6e |..Regist|erMySign|
|00000010| 61 74 75 72 65 2e 63 00 | 00 00 00 00 00 00 00 00 |ature.c.|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 01 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 40 b7 00 | 00 01 7e a3 19 a9 1e a3 |.....@..|..~.....|
|00000060| 19 a9 1e 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 63 98 00 00 |........|....c...|
|00000080| 2f 2a 20 20 52 65 67 69 | 73 74 65 72 4d 79 53 69 |/* Regi|sterMySi|
|00000090| 67 6e 61 74 75 72 65 2e | 63 20 09 56 65 72 73 69 |gnature.|c .Versi|
|000000a0| 6f 6e 20 32 2e 30 0d 2a | 20 20 a9 20 43 6f 70 79 |on 2.0.*| . Copy|
|000000b0| 72 69 67 68 74 20 31 39 | 39 30 20 4a 65 72 65 6d |right 19|90 Jerem|
|000000c0| 79 20 47 72 6f 64 62 65 | 72 67 2e 20 20 41 6c 6c |y Grodbe|rg. All|
|000000d0| 20 52 69 67 68 74 73 20 | 52 65 73 65 72 76 65 64 | Rights |Reserved|
|000000e0| 0d 2a 0d 2a 09 44 65 76 | 65 6c 6f 70 6d 65 6e 74 |.*.*.Dev|elopment|
|000000f0| 20 73 79 73 74 65 6d 3a | 20 4d 50 57 20 33 2e 31 | system:| MPW 3.1|
|00000100| 20 0d 2a 20 43 6f 6d 70 | 69 6c 65 20 77 69 74 68 | .* Comp|ile with|
|00000110| 3a 20 43 20 2d 62 32 20 | 52 65 67 69 73 74 65 72 |: C -b2 |Register|
|00000120| 4d 79 53 69 67 6e 61 74 | 75 72 65 2e 63 20 20 23 |MySignat|ure.c #|
|00000130| 2d 62 32 20 70 75 74 73 | 20 73 74 72 69 6e 67 20 |-b2 puts| string |
|00000140| 63 6f 6e 73 74 61 6e 74 | 73 20 69 6e 20 74 68 65 |constant|s in the|
|00000150| 20 63 6f 64 65 20 73 65 | 67 6d 65 6e 74 0d 2a 0d | code se|gment.*.|
|00000160| 2a 20 55 6e 6d 6f 64 69 | 66 69 65 64 20 63 6f 70 |* Unmodi|fied cop|
|00000170| 69 65 73 20 6f 66 20 74 | 68 69 73 20 73 6f 75 72 |ies of t|his sour|
|00000180| 63 65 20 61 6e 64 20 6f | 62 6a 65 63 74 20 63 6f |ce and o|bject co|
|00000190| 64 65 20 6d 61 79 20 62 | 65 20 64 69 73 74 72 69 |de may b|e distri|
|000001a0| 62 75 74 65 64 20 66 72 | 65 65 20 6f 66 20 63 68 |buted fr|ee of ch|
|000001b0| 61 72 67 65 2e 0d 2a 20 | 41 64 61 70 74 61 74 69 |arge..* |Adaptati|
|000001c0| 6f 6e 73 20 6f 66 20 74 | 68 69 73 20 63 6f 64 65 |ons of t|his code|
|000001d0| 20 66 6f 72 20 6f 74 68 | 65 72 20 64 65 76 65 6c | for oth|er devel|
|000001e0| 6f 70 6d 65 6e 74 20 73 | 79 73 74 65 6d 73 20 6d |opment s|ystems m|
|000001f0| 61 79 20 62 65 20 6d 61 | 64 65 20 61 6e 64 20 64 |ay be ma|de and d|
|00000200| 69 73 74 72 69 62 75 74 | 65 64 0d 2a 20 61 73 20 |istribut|ed.* as |
|00000210| 70 61 72 74 20 6f 66 20 | 73 61 69 64 20 64 65 76 |part of |said dev|
|00000220| 65 6c 6f 70 6d 65 6e 74 | 20 73 79 73 74 65 6d 2c |elopment| system,|
|00000230| 20 6f 74 68 65 72 77 69 | 73 65 2c 20 6e 65 69 74 | otherwi|se, neit|
|00000240| 68 65 72 20 74 68 69 73 | 20 63 6f 64 65 20 6e 6f |her this| code no|
|00000250| 74 20 61 64 61 70 74 61 | 74 69 6f 6e 73 20 6f 66 |t adapta|tions of|
|00000260| 0d 2a 20 69 74 20 6d 61 | 79 20 62 65 20 64 69 73 |.* it ma|y be dis|
|00000270| 74 72 69 62 75 74 65 64 | 20 61 6c 6f 6e 67 20 77 |tributed| along w|
|00000280| 69 74 68 20 6f 74 68 65 | 72 20 70 72 6f 64 75 63 |ith othe|r produc|
|00000290| 74 73 20 66 6f 72 20 77 | 68 69 63 68 20 61 20 66 |ts for w|hich a f|
|000002a0| 65 65 20 69 73 20 63 68 | 61 72 67 65 64 2e 0d 2a |ee is ch|arged..*|
|000002b0| 0d 2a 20 41 70 70 6c 65 | 20 43 6f 6d 70 75 74 65 |.* Apple| Compute|
|000002c0| 72 2c 20 49 6e 63 2e 20 | 69 73 20 73 70 65 63 69 |r, Inc. |is speci|
|000002d0| 66 69 63 61 6c 6c 79 20 | 67 72 61 6e 74 65 64 20 |fically |granted |
|000002e0| 6e 6f 6e 2d 65 78 63 6c | 75 73 69 76 65 20 70 65 |non-excl|usive pe|
|000002f0| 72 6d 69 73 73 69 6f 6e | 20 74 6f 20 64 69 73 74 |rmission| to dist|
|00000300| 72 69 62 75 74 65 20 0d | 2a 20 74 68 69 73 20 63 |ribute .|* this c|
|00000310| 6f 64 65 20 62 79 20 61 | 6e 79 20 6d 65 61 6e 73 |ode by a|ny means|
|00000320| 2c 20 65 69 74 68 65 72 | 20 66 6f 72 20 66 72 65 |, either| for fre|
|00000330| 65 2c 20 6f 72 20 77 69 | 74 68 20 6f 74 68 65 72 |e, or wi|th other|
|00000340| 20 63 6f 64 65 20 66 6f | 72 20 77 68 69 63 68 20 | code fo|r which |
|00000350| 61 20 66 65 65 20 69 73 | 20 0d 2a 20 63 68 61 72 |a fee is| .* char|
|00000360| 67 65 64 2c 20 70 72 6f | 76 69 64 65 64 20 74 68 |ged, pro|vided th|
|00000370| 65 79 20 64 6f 20 6e 6f | 74 20 69 6d 70 6f 73 65 |ey do no|t impose|
|00000380| 20 66 75 72 74 68 65 72 | 20 72 65 73 74 72 69 63 | further| restric|
|00000390| 74 69 6f 6e 73 20 6f 6e | 20 69 74 73 20 75 73 65 |tions on| its use|
|000003a0| 2c 20 61 6e 64 20 74 68 | 65 79 0d 2a 20 69 6e 63 |, and th|ey.* inc|
|000003b0| 6c 75 64 65 20 74 68 69 | 73 20 65 6e 74 69 72 65 |lude thi|s entire|
|000003c0| 20 63 6f 70 79 72 69 67 | 68 74 20 6e 6f 74 69 63 | copyrig|ht notic|
|000003d0| 65 2e 0d 2a 20 0d 2a 20 | 54 68 69 73 20 73 6f 75 |e..* .* |This sou|
|000003e0| 72 63 65 20 69 73 20 70 | 72 6f 76 69 64 65 64 20 |rce is p|rovided |
|000003f0| 74 6f 20 6d 61 6b 65 20 | 77 72 69 74 69 6e 67 20 |to make |writing |
|00000400| 49 4e 49 54 73 20 61 6e | 64 20 63 64 65 76 73 20 |INITs an|d cdevs |
|00000410| 61 20 6c 69 74 74 6c 65 | 20 65 61 73 69 65 72 2e |a little| easier.|
|00000420| 20 20 0d 2a 20 52 65 67 | 69 73 74 65 72 4d 79 53 | .* Reg|isterMyS|
|00000430| 69 67 6e 61 74 75 72 65 | 20 63 61 6e 20 61 6c 73 |ignature| can als|
|00000440| 6f 20 62 65 20 68 65 6c | 70 66 75 6c 20 74 6f 20 |o be hel|pful to |
|00000450| 61 6e 79 6f 6e 65 20 77 | 68 6f 20 77 61 6e 74 73 |anyone w|ho wants|
|00000460| 20 74 6f 20 69 6e 73 74 | 61 6c 6c 20 61 20 44 52 | to inst|all a DR|
|00000470| 56 52 2e 0d 2a 20 49 66 | 20 79 6f 75 20 66 69 6e |VR..* If| you fin|
|00000480| 64 20 69 74 20 68 65 6c | 70 66 75 6c 2c 20 70 6c |d it hel|pful, pl|
|00000490| 65 61 73 65 20 73 65 6e | 64 20 6d 65 20 61 20 63 |ease sen|d me a c|
|000004a0| 6f 70 79 20 6f 66 20 79 | 6f 75 72 20 66 69 6e 69 |opy of y|our fini|
|000004b0| 73 68 65 64 20 70 72 6f | 64 75 63 74 2e 0d 2a 0d |shed pro|duct..*.|
|000004c0| 2a 20 54 48 49 53 20 53 | 4f 55 52 43 45 20 49 53 |* THIS S|OURCE IS|
|000004d0| 20 50 52 4f 56 49 44 45 | 20 41 53 20 49 53 2c 20 | PROVIDE| AS IS, |
|000004e0| 41 4e 44 20 41 4c 4c 20 | 57 41 52 52 41 4e 54 49 |AND ALL |WARRANTI|
|000004f0| 45 53 20 41 52 45 20 45 | 58 50 4c 49 43 49 54 59 |ES ARE E|XPLICITY|
|00000500| 20 44 49 53 43 4c 41 49 | 4d 45 44 2e 0d 2a 20 42 | DISCLAI|MED..* B|
|00000510| 59 20 55 53 49 4e 47 20 | 54 48 49 53 20 57 4f 52 |Y USING |THIS WOR|
|00000520| 4b 2c 20 54 48 45 20 55 | 53 45 52 20 41 47 52 45 |K, THE U|SER AGRE|
|00000530| 45 53 20 54 4f 20 41 53 | 53 55 4d 45 20 41 4c 4c |ES TO AS|SUME ALL|
|00000540| 20 52 45 53 50 4f 4e 53 | 49 42 49 4c 49 54 59 20 | RESPONS|IBILITY |
|00000550| 46 4f 52 20 0d 2a 20 44 | 41 4d 41 47 45 53 20 54 |FOR .* D|AMAGES T|
|00000560| 48 41 54 20 4d 41 59 20 | 41 52 49 53 45 20 41 53 |HAT MAY |ARISE AS|
|00000570| 20 41 20 52 45 53 55 4c | 54 2c 20 41 4e 44 20 54 | A RESUL|T, AND T|
|00000580| 4f 20 50 52 4f 54 45 43 | 54 20 46 52 4f 4d 20 48 |O PROTEC|T FROM H|
|00000590| 41 52 4d 20 41 4c 4c 20 | 45 4e 54 49 54 49 45 53 |ARM ALL |ENTITIES|
|000005a0| 0d 2a 20 49 4e 56 4f 4c | 56 45 44 20 49 4e 20 54 |.* INVOL|VED IN T|
|000005b0| 48 45 20 43 52 45 41 54 | 49 4f 4e 20 41 4e 44 20 |HE CREAT|ION AND |
|000005c0| 44 49 53 54 52 49 42 55 | 54 49 4f 4e 20 4f 46 20 |DISTRIBU|TION OF |
|000005d0| 54 48 49 53 20 57 4f 52 | 4b 2e 0d 2a 0d 2a 20 4a |THIS WOR|K..*.* J|
|000005e0| 65 72 65 6d 79 20 47 72 | 6f 64 62 65 72 67 2e 20 |eremy Gr|odberg. |
|000005f0| 20 53 65 70 74 65 6d 62 | 65 72 2c 20 31 39 39 30 | Septemb|er, 1990|
|00000600| 0d 2a 20 6a 67 72 6f 40 | 6c 69 61 2e 63 6f 6d 20 |.* jgro@|lia.com |
|00000610| 20 28 76 69 61 20 41 70 | 70 6c 65 4c 69 6e 6b 3a | (via Ap|pleLink:|
|00000620| 20 6a 67 72 6f 40 6c 69 | 61 2e 63 6f 6d 40 49 4e | jgro@li|a.com@IN|
|00000630| 54 45 52 4e 45 54 23 29 | 0d 2a 20 41 6d 65 72 69 |TERNET#)|.* Ameri|
|00000640| 63 61 20 4f 6e 6c 69 6e | 65 3a 20 6a 67 72 6f 20 |ca Onlin|e: jgro |
|00000650| 28 49 20 64 6f 6e 27 74 | 20 72 65 61 64 20 74 68 |(I don't| read th|
|00000660| 69 73 20 76 65 72 79 20 | 6f 66 74 65 6e 29 0d 0d |is very |often)..|
|00000670| 0d 2a 20 54 68 69 73 20 | 69 73 20 61 20 6c 69 62 |.* This |is a lib|
|00000680| 72 61 72 79 20 6f 66 20 | 63 6f 64 65 20 77 68 69 |rary of |code whi|
|00000690| 63 68 20 79 6f 75 20 63 | 61 6e 20 75 73 65 20 74 |ch you c|an use t|
|000006a0| 6f 20 73 68 61 72 65 20 | 6d 65 6d 6f 72 79 20 61 |o share |memory a|
|000006b0| 63 72 6f 73 73 20 70 72 | 6f 63 65 73 73 65 73 2e |cross pr|ocesses.|
|000006c0| 0d 2a 20 57 68 69 6c 65 | 20 79 6f 75 20 63 6f 75 |.* While| you cou|
|000006d0| 6c 64 20 75 73 65 20 74 | 68 69 73 20 66 6f 72 20 |ld use t|his for |
|000006e0| 61 6e 79 20 6b 69 6e 64 | 20 6f 66 20 69 6e 74 65 |any kind| of inte|
|000006f0| 72 2d 70 72 6f 63 65 73 | 73 20 63 6f 6d 6d 75 6e |r-proces|s commun|
|00000700| 69 63 61 74 69 6f 6e 2c | 20 69 74 20 69 73 0d 2a |ication,| it is.*|
|00000710| 20 65 73 70 65 63 69 61 | 6c 6c 79 20 69 6e 74 65 | especia|lly inte|
|00000720| 6e 64 65 64 20 74 6f 20 | 61 6c 6c 6f 77 20 61 20 |nded to |allow a |
|00000730| 63 6f 6e 74 72 6f 6c 20 | 70 61 6e 65 6c 20 28 63 |control |panel (c|
|00000740| 64 65 76 29 20 74 6f 20 | 61 6c 74 65 72 20 74 68 |dev) to |alter th|
|00000750| 65 20 62 65 68 61 76 69 | 6f 72 0d 2a 20 6f 66 20 |e behavi|or.* of |
|00000760| 61 20 73 74 61 72 74 75 | 70 20 64 6f 63 75 6d 65 |a startu|p docume|
|00000770| 6e 74 20 28 49 4e 49 54 | 29 20 77 68 69 6c 65 20 |nt (INIT|) while |
|00000780| 74 68 65 20 6c 61 74 74 | 65 72 20 69 73 20 72 75 |the latt|er is ru|
|00000790| 6e 6e 69 6e 67 20 28 74 | 68 61 74 20 69 73 2c 20 |nning (t|hat is, |
|000007a0| 77 69 74 68 6f 75 74 0d | 2a 20 72 65 73 74 61 72 |without.|* restar|
|000007b0| 74 69 6e 67 20 74 68 65 | 20 63 6f 6d 70 75 74 65 |ting the| compute|
|000007c0| 72 29 2e 20 20 45 6e 74 | 72 79 20 70 6f 69 6e 74 |r). Ent|ry point|
|000007d0| 73 20 61 72 65 20 64 65 | 66 69 6e 65 64 20 61 73 |s are de|fined as|
|000007e0| 20 61 20 50 61 73 63 61 | 6c 20 66 75 6e 63 74 69 | a Pasca|l functi|
|000007f0| 6f 6e 73 20 73 6f 20 0d | 2a 20 79 6f 75 20 63 61 |ons so .|* you ca|
|00000800| 6e 20 63 61 6c 6c 20 69 | 74 20 66 72 6f 6d 20 61 |n call i|t from a|
|00000810| 6e 20 41 70 70 6c 69 63 | 61 74 69 6f 6e 20 69 66 |n Applic|ation if|
|00000820| 20 79 6f 75 20 77 61 6e | 74 20 74 6f 2e 0d 2a 0d | you wan|t to..*.|
|00000830| 2a 20 54 68 65 20 74 68 | 65 6f 72 79 20 62 65 68 |* The th|eory beh|
|00000840| 69 6e 64 20 74 68 69 73 | 20 69 73 20 74 68 61 74 |ind this| is that|
|00000850| 20 79 6f 75 72 20 49 4e | 49 54 20 77 69 6c 6c 20 | your IN|IT will |
|00000860| 68 61 76 65 20 61 20 62 | 6c 6f 63 6b 20 6f 66 20 |have a b|lock of |
|00000870| 76 61 72 69 61 62 6c 65 | 73 20 77 68 69 63 68 20 |variable|s which |
|00000880| 0d 2a 20 69 74 20 6e 65 | 65 64 73 20 74 6f 20 75 |.* it ne|eds to u|
|00000890| 73 65 20 66 6f 72 20 76 | 61 72 69 6f 75 73 20 70 |se for v|arious p|
|000008a0| 75 72 70 6f 73 65 73 2c | 20 69 6e 63 6c 75 64 69 |urposes,| includi|
|000008b0| 6e 67 20 73 74 6f 72 69 | 6e 67 20 75 73 65 72 20 |ng stori|ng user |
|000008c0| 6f 70 74 69 6f 6e 73 2e | 0d 2a 20 54 68 65 20 75 |options.|.* The u|
|000008d0| 73 65 72 20 6f 70 74 69 | 6f 6e 73 20 77 6f 75 6c |ser opti|ons woul|
|000008e0| 64 20 62 65 20 73 74 6f | 72 65 64 20 69 6e 20 61 |d be sto|red in a|
|000008f0| 20 72 65 73 6f 75 72 63 | 65 20 77 68 69 63 68 20 | resourc|e which |
|00000900| 69 73 20 61 20 63 6f 70 | 79 20 6f 66 20 74 68 65 |is a cop|y of the|
|00000910| 0d 2a 20 49 4e 49 54 27 | 73 20 76 61 72 69 61 62 |.* INIT'|s variab|
|00000920| 6c 65 73 2c 20 61 6e 64 | 20 63 6f 75 6c 64 20 62 |les, and| could b|
|00000930| 65 20 65 64 69 74 65 64 | 20 62 79 20 61 20 43 6f |e edited| by a Co|
|00000940| 6e 74 72 6f 6c 20 50 61 | 6e 65 6c 20 44 65 76 69 |ntrol Pa|nel Devi|
|00000950| 63 65 20 28 63 64 65 76 | 29 2e 0d 2a 20 41 74 20 |ce (cdev|)..* At |
|00000960| 49 4e 49 54 20 74 69 6d | 65 2c 20 74 68 65 20 28 |INIT tim|e, the (|
|00000970| 65 64 69 74 65 64 29 20 | 72 65 73 6f 75 72 63 65 |edited) |resource|
|00000980| 20 69 73 20 63 6f 70 69 | 65 64 20 69 6e 74 6f 20 | is copi|ed into |
|00000990| 74 68 65 20 49 4e 49 54 | 27 73 20 76 61 72 69 61 |the INIT|'s varia|
|000009a0| 62 6c 65 73 20 66 6f 72 | 20 0d 2a 20 74 68 65 20 |bles for| .* the |
|000009b0| 49 4e 49 54 20 74 6f 20 | 75 73 65 2e 20 20 49 6e |INIT to |use. In|
|000009c0| 20 6f 74 68 65 72 20 77 | 6f 72 64 73 2c 20 74 6f | other w|ords, to|
|000009d0| 20 63 68 61 6e 67 65 20 | 74 68 65 20 75 73 65 72 | change |the user|
|000009e0| 20 6f 70 74 69 6f 6e 73 | 2c 20 74 68 65 20 75 73 | options|, the us|
|000009f0| 65 72 20 75 73 65 73 0d | 2a 20 74 68 65 20 63 64 |er uses.|* the cd|
|00000a00| 65 76 20 74 6f 20 65 64 | 69 74 20 74 68 65 20 72 |ev to ed|it the r|
|00000a10| 65 73 6f 75 72 63 65 2c | 20 77 68 69 63 68 20 77 |esource,| which w|
|00000a20| 69 6c 6c 20 63 68 61 6e | 67 65 20 74 68 65 20 6f |ill chan|ge the o|
|00000a30| 70 74 69 6f 6e 73 20 74 | 68 65 20 6e 65 78 74 20 |ptions t|he next |
|00000a40| 74 69 6d 65 20 74 68 65 | 0d 2a 20 49 4e 49 54 20 |time the|.* INIT |
|00000a50| 69 73 20 6c 6f 61 64 65 | 64 2e 0d 2a 20 0d 2a 20 |is loade|d..* .* |
|00000a60| 54 68 69 73 20 69 73 20 | 68 6f 77 20 6d 6f 73 74 |This is |how most|
|00000a70| 20 49 4e 49 54 73 20 61 | 72 65 20 77 72 69 74 74 | INITs a|re writt|
|00000a80| 65 6e 2c 20 61 6e 64 20 | 74 68 69 73 20 69 73 20 |en, and |this is |
|00000a90| 77 68 79 20 6d 6f 73 74 | 20 49 4e 49 54 73 20 72 |why most| INITs r|
|00000aa0| 65 71 75 69 72 65 20 61 | 20 0d 2a 20 72 65 62 6f |equire a| .* rebo|
|00000ab0| 6f 74 20 66 6f 72 20 63 | 68 61 6e 67 65 73 20 74 |ot for c|hanges t|
|00000ac0| 6f 20 74 61 6b 65 20 65 | 66 66 65 63 74 2e 20 20 |o take e|ffect. |
|00000ad0| 42 65 66 6f 72 65 20 6e | 6f 77 2c 20 74 68 65 72 |Before n|ow, ther|
|00000ae0| 65 20 77 61 73 20 6e 6f | 20 73 69 6d 70 6c 65 20 |e was no| simple |
|00000af0| 77 61 79 0d 2a 20 66 6f | 72 20 61 20 63 64 65 76 |way.* fo|r a cdev|
|00000b00| 20 74 6f 20 67 65 74 20 | 61 20 68 6f 6c 64 20 6f | to get |a hold o|
|00000b10| 66 20 74 68 65 20 49 4e | 49 54 73 20 76 61 72 69 |f the IN|ITs vari|
|00000b20| 61 62 6c 65 73 2c 20 73 | 6f 20 69 74 20 63 6f 75 |ables, s|o it cou|
|00000b30| 6c 64 20 6f 6e 6c 79 20 | 63 6f 6d 6d 75 6e 69 63 |ld only |communic|
|00000b40| 61 74 65 20 62 79 0d 2a | 20 63 68 61 6e 67 69 6e |ate by.*| changin|
|00000b50| 67 20 74 68 65 20 72 65 | 73 6f 75 72 63 65 20 61 |g the re|source a|
|00000b60| 6e 64 20 74 68 65 6e 20 | 72 65 69 6e 69 74 69 61 |nd then |reinitia|
|00000b70| 6c 69 7a 69 6e 67 20 74 | 68 65 20 49 4e 49 54 2e |lizing t|he INIT.|
|00000b80| 0d 2a 0d 2a 20 4e 6f 77 | 20 77 69 74 68 20 52 65 |.*.* Now| with Re|
|00000b90| 67 69 73 74 65 72 4d 79 | 53 69 67 6e 61 74 75 72 |gisterMy|Signatur|
|00000ba0| 65 2c 20 79 6f 75 72 20 | 49 4e 49 54 20 63 61 6e |e, your |INIT can|
|00000bb0| 20 72 65 67 69 73 74 65 | 72 20 69 74 73 65 6c 66 | registe|r itself|
|00000bc0| 20 61 6e 64 20 70 72 6f | 76 69 64 65 20 61 20 70 | and pro|vide a p|
|00000bd0| 6f 69 6e 74 65 72 20 74 | 6f 20 0d 2a 20 61 6e 79 |ointer t|o .* any|
|00000be0| 6f 6e 65 20 74 68 61 74 | 20 77 61 6e 74 73 20 69 |one that| wants i|
|00000bf0| 74 2e 20 20 52 65 67 69 | 73 74 65 72 4d 79 53 69 |t. Regi|sterMySi|
|00000c00| 67 6e 61 74 75 72 65 20 | 74 61 6b 65 73 20 61 20 |gnature |takes a |
|00000c10| 73 65 6c 65 63 74 6f 72 | 20 77 68 69 63 68 20 69 |selector| which i|
|00000c20| 73 20 61 6e 20 4f 53 54 | 79 70 65 2c 20 61 6e 64 |s an OST|ype, and|
|00000c30| 0d 2a 20 72 65 74 75 72 | 6e 73 20 61 20 6c 6f 6e |.* retur|ns a lon|
|00000c40| 67 69 6e 74 2e 20 20 46 | 6f 72 20 79 6f 75 72 20 |gint. F|or your |
|00000c50| 49 4e 49 54 2c 20 79 6f | 75 20 72 65 67 69 73 74 |INIT, yo|u regist|
|00000c60| 65 72 20 79 6f 75 72 20 | 49 4e 49 54 27 73 20 63 |er your |INIT's c|
|00000c70| 72 65 61 74 6f 72 20 62 | 79 74 65 73 20 0d 2a 20 |reator b|ytes .* |
|00000c80| 28 77 68 69 63 68 20 79 | 6f 75 20 68 61 76 65 20 |(which y|ou have |
|00000c90| 63 6c 65 61 72 65 64 20 | 77 69 74 68 20 41 70 70 |cleared |with App|
|00000ca0| 6c 65 20 62 79 20 72 65 | 67 69 73 74 65 72 69 6e |le by re|gisterin|
|00000cb0| 67 20 77 69 74 68 20 4d | 61 63 44 54 53 29 20 61 |g with M|acDTS) a|
|00000cc0| 6e 64 20 77 68 61 74 65 | 76 65 72 0d 2a 20 6c 6f |nd whate|ver.* lo|
|00000cd0| 6e 67 69 6e 74 20 79 6f | 75 20 77 61 6e 74 2c 20 |ngint yo|u want, |
|00000ce0| 70 72 65 73 75 6d 61 62 | 6c 79 20 74 68 65 20 70 |presumab|ly the p|
|00000cf0| 6f 69 6e 74 65 72 20 74 | 6f 20 79 6f 75 72 20 49 |ointer t|o your I|
|00000d00| 4e 49 54 27 73 20 76 61 | 72 69 61 62 6c 65 73 2e |NIT's va|riables.|
|00000d10| 20 4c 61 74 65 72 2c 0d | 2a 20 79 6f 75 72 20 63 | Later,.|* your c|
|00000d20| 64 65 76 20 77 69 6c 6c | 20 63 61 6c 6c 20 4c 6f |dev will| call Lo|
|00000d30| 6f 6b 75 70 4d 79 53 69 | 67 6e 61 74 75 72 65 20 |okupMySi|gnature |
|00000d40| 77 69 74 68 20 79 6f 75 | 72 20 49 4e 49 54 73 20 |with you|r INITs |
|00000d50| 63 72 65 61 74 6f 72 20 | 62 79 74 65 73 2c 20 61 |creator |bytes, a|
|00000d60| 6e 64 20 67 65 74 20 62 | 61 63 6b 0d 2a 20 74 68 |nd get b|ack.* th|
|00000d70| 65 20 70 6f 69 6e 74 65 | 72 20 74 6f 20 74 68 65 |e pointe|r to the|
|00000d80| 20 76 61 72 69 61 62 6c | 65 73 2c 20 73 6f 20 74 | variabl|es, so t|
|00000d90| 68 65 79 20 63 61 6e 20 | 62 65 20 63 68 61 6e 67 |hey can |be chang|
|00000da0| 65 64 20 69 6e 20 72 65 | 61 6c 20 74 69 6d 65 2e |ed in re|al time.|
|00000db0| 20 20 49 74 20 77 69 6c | 6c 0d 2a 20 61 6c 73 6f | It wil|l.* also|
|00000dc0| 20 62 65 20 61 62 6c 65 | 20 74 6f 20 74 65 6c 6c | be able| to tell|
|00000dd0| 20 69 66 20 74 68 65 20 | 49 4e 49 54 20 77 61 73 | if the |INIT was|
|00000de0| 20 6e 6f 74 20 69 6e 73 | 74 61 6c 6c 65 64 2c 20 | not ins|talled, |
|00000df0| 62 65 63 61 75 73 65 20 | 74 68 65 20 63 72 65 61 |because |the crea|
|00000e00| 74 6f 72 20 62 79 74 65 | 73 0d 2a 20 77 69 6c 6c |tor byte|s.* will|
|00000e10| 20 6e 6f 74 20 62 65 20 | 72 65 67 69 73 74 65 72 | not be |register|
|00000e20| 65 64 2e 20 20 53 65 65 | 20 74 68 65 20 61 63 63 |ed. See| the acc|
|00000e30| 6f 6d 70 61 6e 79 69 6e | 67 20 53 61 6d 70 6c 65 |ompanyin|g Sample|
|00000e40| 4c 6f 6f 6b 75 70 2e 63 | 20 66 6f 72 20 61 6e 20 |Lookup.c| for an |
|00000e50| 65 78 61 6d 70 6c 65 2e | 0d 2a 0d 2a 20 4f 6e 20 |example.|.*.* On |
|00000e60| 73 79 73 74 65 6d 73 20 | 74 68 61 74 20 73 75 70 |systems |that sup|
|00000e70| 70 6f 72 74 20 47 65 73 | 74 61 6c 74 20 28 53 79 |port Ges|talt (Sy|
|00000e80| 73 74 65 6d 20 36 2e 30 | 2e 34 20 61 6e 64 20 6c |stem 6.0|.4 and l|
|00000e90| 61 74 65 72 29 2c 20 47 | 65 73 74 61 6c 74 20 69 |ater), G|estalt i|
|00000ea0| 73 20 75 73 65 64 20 74 | 6f 20 0d 2a 20 64 6f 20 |s used t|o .* do |
|00000eb0| 74 68 65 20 61 63 74 75 | 61 6c 20 72 65 67 69 73 |the actu|al regis|
|00000ec0| 74 72 61 74 69 6f 6e 20 | 61 6e 64 20 6c 6f 6f 6b |tration |and look|
|00000ed0| 75 70 2e 20 20 4f 6e 20 | 6f 6c 64 65 72 20 73 79 |up. On |older sy|
|00000ee0| 73 74 65 6d 73 2c 20 61 | 20 64 72 69 76 65 72 20 |stems, a| driver |
|00000ef0| 28 44 52 56 52 29 20 69 | 73 20 0d 2a 20 69 6e 73 |(DRVR) i|s .* ins|
|00000f00| 74 61 6c 6c 65 64 20 77 | 68 69 63 68 20 77 69 6c |talled w|hich wil|
|00000f10| 6c 20 64 6f 20 74 68 65 | 20 72 65 67 69 73 74 72 |l do the| registr|
|00000f20| 61 74 69 6f 6e 2e 20 20 | 54 68 65 20 64 72 69 76 |ation. |The driv|
|00000f30| 65 72 27 73 20 73 6f 75 | 72 63 65 20 63 6f 64 65 |er's sou|rce code|
|00000f40| 20 69 73 20 6e 6f 74 0d | 2a 20 69 6e 63 6c 75 64 | is not.|* includ|
|00000f50| 65 64 2c 20 62 75 74 20 | 74 68 65 20 44 52 56 52 |ed, but |the DRVR|
|00000f60| 20 72 65 73 6f 75 72 63 | 65 20 69 73 2e 20 59 6f | resourc|e is. Yo|
|00000f70| 75 20 64 6f 6e 27 74 20 | 6e 65 65 64 20 74 6f 20 |u don't |need to |
|00000f80| 64 6f 20 61 6e 79 74 68 | 69 6e 67 20 77 69 74 68 |do anyth|ing with|
|00000f90| 20 74 68 65 20 64 72 69 | 76 65 72 0d 2a 20 62 75 | the dri|ver.* bu|
|00000fa0| 74 20 69 6e 63 6c 75 64 | 65 20 69 74 20 69 6e 20 |t includ|e it in |
|00000fb0| 79 6f 75 72 20 49 4e 49 | 54 2e 20 20 52 65 67 69 |your INI|T. Regi|
|00000fc0| 73 74 65 72 4d 79 53 69 | 67 6e 61 74 75 72 65 20 |sterMySi|gnature |
|00000fd0| 61 6e 64 20 4c 6f 6f 6b | 75 70 4d 79 53 69 67 6e |and Look|upMySign|
|00000fe0| 61 74 75 72 65 20 74 61 | 6b 65 0d 2a 20 63 61 72 |ature ta|ke.* car|
|00000ff0| 65 20 6f 66 20 65 76 65 | 72 79 74 68 69 6e 67 20 |e of eve|rything |
|00001000| 61 75 74 6f 6d 61 74 69 | 63 61 6c 6c 79 2e 0d 2a |automati|cally..*|
|00001010| 2f 0d 0d 23 69 6e 63 6c | 75 64 65 20 3c 4d 61 63 |/..#incl|ude <Mac|
|00001020| 48 65 61 64 65 72 73 3e | 09 09 2f 2a 20 77 68 61 |Headers>|../* wha|
|00001030| 74 65 76 65 72 20 68 65 | 61 64 65 72 73 20 79 6f |tever he|aders yo|
|00001040| 75 20 6e 65 65 64 20 2a | 2f 0d 23 69 66 6e 64 65 |u need *|/.#ifnde|
|00001050| 66 20 4e 69 6c 0d 23 64 | 65 66 69 6e 65 20 4e 69 |f Nil.#d|efine Ni|
|00001060| 6c 20 30 4c 0d 23 65 6e | 64 69 66 0d 0d 70 61 73 |l 0L.#en|dif..pas|
|00001070| 63 61 6c 20 73 68 6f 72 | 74 20 46 69 6e 64 41 53 |cal shor|t FindAS|
|00001080| 6c 6f 74 28 76 6f 69 64 | 29 3b 20 2f 2a 20 46 69 |lot(void|); /* Fi|
|00001090| 6e 64 73 20 61 6e 20 65 | 6d 70 74 79 20 73 6c 6f |nds an e|mpty slo|
|000010a0| 74 2c 20 65 78 70 61 6e | 64 69 6e 67 20 74 68 65 |t, expan|ding the|
|000010b0| 20 55 6e 69 74 20 54 61 | 62 6c 65 20 69 66 20 6e | Unit Ta|ble if n|
|000010c0| 65 65 64 65 64 20 2a 2f | 0d 70 61 73 63 61 6c 20 |eeded */|.pascal |
|000010d0| 73 68 6f 72 74 20 47 65 | 74 44 72 76 72 52 65 66 |short Ge|tDrvrRef|
|000010e0| 4e 75 6d 28 53 74 72 32 | 35 35 20 64 72 69 76 65 |Num(Str2|55 drive|
|000010f0| 72 4e 61 6d 65 29 3b 20 | 2f 2a 20 46 69 6e 64 73 |rName); |/* Finds|
|00001100| 20 61 20 64 72 69 76 65 | 72 20 61 6c 72 65 61 64 | a drive|r alread|
|00001110| 79 20 69 6e 73 74 61 6c | 6c 65 64 20 2a 2f 0d 70 |y instal|led */.p|
|00001120| 61 73 63 61 6c 20 73 68 | 6f 72 74 20 20 49 6e 73 |ascal sh|ort Ins|
|00001130| 74 61 6c 6c 31 44 72 69 | 76 65 72 28 53 74 72 32 |tall1Dri|ver(Str2|
|00001140| 35 35 20 64 72 69 76 65 | 72 4e 61 6d 65 29 3b 20 |55 drive|rName); |
|00001150| 2f 2a 20 49 6e 73 74 61 | 6c 6c 73 20 61 20 64 72 |/* Insta|lls a dr|
|00001160| 69 76 65 72 20 28 48 69 | 67 68 20 6c 65 76 65 6c |iver (Hi|gh level|
|00001170| 29 20 2a 2f 0d 0d 2f 2a | 20 54 68 65 20 66 6f 6c |) */../*| The fol|
|00001180| 6c 6f 77 69 6e 67 20 61 | 72 65 20 69 6e 20 52 65 |lowing a|re in Re|
|00001190| 67 69 73 74 65 72 57 69 | 74 68 47 65 73 74 61 6c |gisterWi|thGestal|
|000011a0| 74 2e 61 20 2a 2f 0d 2f | 2a 20 52 65 67 69 73 74 |t.a */./|* Regist|
|000011b0| 65 72 57 69 74 68 47 65 | 73 74 61 6c 74 20 75 73 |erWithGe|stalt us|
|000011c0| 65 73 20 67 65 73 74 61 | 6c 74 20 74 6f 20 72 65 |es gesta|lt to re|
|000011d0| 67 69 73 74 65 72 20 61 | 20 73 69 67 6e 61 74 75 |gister a| signatu|
|000011e0| 72 65 20 61 6e 64 20 6c | 6f 6e 67 20 2a 2f 0d 70 |re and l|ong */.p|
|000011f0| 61 73 63 61 6c 20 4f 53 | 45 72 72 20 52 65 67 69 |ascal OS|Err Regi|
|00001200| 73 74 65 72 57 69 74 68 | 47 65 73 74 61 6c 74 28 |sterWith|Gestalt(|
|00001210| 4f 53 54 79 70 65 20 53 | 69 67 6e 61 74 75 72 65 |OSType S|ignature|
|00001220| 2c 20 6c 6f 6e 67 20 74 | 68 65 50 74 72 29 3b 20 |, long t|hePtr); |
|00001230| 0d 0d 2f 2a 20 44 52 56 | 52 49 6e 73 74 61 6c 6c |../* DRV|RInstall|
|00001240| 20 69 73 20 67 6c 75 65 | 20 63 6f 64 65 20 66 72 | is glue| code fr|
|00001250| 6f 6d 20 54 65 63 68 6e | 6f 74 65 20 23 31 30 38 |om Techn|ote #108|
|00001260| 20 66 6f 72 20 6f 74 68 | 65 72 77 69 73 65 20 75 | for oth|erwise u|
|00001270| 6e 64 6f 63 75 6d 65 6e | 74 65 64 20 73 79 73 74 |ndocumen|ted syst|
|00001280| 65 6d 20 63 61 6c 6c 20 | 2a 2f 0d 2f 2a 20 41 6e |em call |*/./* An|
|00001290| 20 61 6c 74 65 72 6e 61 | 74 65 20 6d 65 74 68 6f | alterna|te metho|
|000012a0| 64 20 77 6f 75 6c 64 20 | 62 65 20 64 65 63 6c 61 |d would |be decla|
|000012b0| 72 69 6e 67 20 44 52 56 | 52 49 6e 73 74 61 6c 6c |ring DRV|RInstall|
|000012c0| 20 49 6e 6c 69 6e 65 20 | 61 73 3a 0d 09 09 70 61 | Inline |as:...pa|
|000012d0| 73 63 61 6c 20 4f 53 45 | 72 72 20 44 52 56 52 49 |scal OSE|rr DRVRI|
|000012e0| 6e 73 74 61 6c 6c 28 48 | 61 6e 64 6c 65 20 64 72 |nstall(H|andle dr|
|000012f0| 76 72 48 61 6e 64 6c 65 | 2c 20 73 68 6f 72 74 20 |vrHandle|, short |
|00001300| 72 65 66 4e 75 6d 29 0d | 09 09 09 3d 20 30 78 33 |refNum).|...= 0x3|
|00001310| 30 31 46 2c 20 30 78 32 | 30 35 46 2c 20 30 78 32 |01F, 0x2|05F, 0x2|
|00001320| 30 35 30 2c 20 30 78 41 | 30 33 44 2c 20 30 78 33 |050, 0xA|03D, 0x3|
|00001330| 45 38 30 3b 0d 2a 2f 0d | 70 61 73 63 61 6c 20 4f |E80;.*/.|pascal O|
|00001340| 53 45 72 72 20 44 52 56 | 52 49 6e 73 74 61 6c 6c |SErr DRV|RInstall|
|00001350| 28 48 61 6e 64 6c 65 20 | 64 72 76 72 48 61 6e 64 |(Handle |drvrHand|
|00001360| 6c 65 2c 20 73 68 6f 72 | 74 20 72 65 66 4e 75 6d |le, shor|t refNum|
|00001370| 29 3b 20 2f 2a 20 49 6e | 73 74 61 6c 6c 73 20 61 |); /* In|stalls a|
|00001380| 20 44 72 69 76 65 72 20 | 28 4c 6f 77 20 4c 65 76 | Driver |(Low Lev|
|00001390| 65 6c 29 20 2a 2f 0d 0d | 0d 23 64 65 66 69 6e 65 |el) */..|.#define|
|000013a0| 20 47 65 73 74 61 6c 74 | 54 72 61 70 09 09 09 30 | Gestalt|Trap...0|
|000013b0| 78 41 31 41 44 09 09 2f | 2a 20 54 72 61 70 20 77 |xA1AD../|* Trap w|
|000013c0| 6f 72 64 20 66 6f 72 20 | 47 65 73 74 61 6c 74 20 |ord for |Gestalt |
|000013d0| 2a 2f 0d 23 64 65 66 69 | 6e 65 20 55 6e 69 6d 70 |*/.#defi|ne Unimp|
|000013e0| 6c 65 6d 65 6e 74 65 64 | 09 09 30 78 41 38 39 46 |lemented|..0xA89F|
|000013f0| 09 09 2f 2a 20 54 72 61 | 70 20 77 6f 72 64 20 66 |../* Tra|p word f|
|00001400| 6f 72 20 55 6e 69 6d 70 | 6c 65 6d 65 6e 74 65 64 |or Unimp|lemented|
|00001410| 20 74 72 61 70 20 2a 2f | 0d 0d 23 64 65 66 69 6e | trap */|..#defin|
|00001420| 65 20 20 20 20 20 20 20 | 20 55 6e 69 74 4e 74 72 |e | UnitNtr|
|00001430| 79 43 6e 74 41 64 64 72 | 20 20 20 20 30 78 31 64 |yCntAddr| 0x1d|
|00001440| 32 09 09 2f 2a 20 41 64 | 64 72 65 73 73 20 6f 66 |2../* Ad|dress of|
|00001450| 20 6e 75 6d 62 65 72 20 | 6f 66 20 73 6c 6f 74 73 | number |of slots|
|00001460| 20 69 6e 20 55 6e 69 74 | 20 54 61 62 6c 65 20 2a | in Unit| Table *|
|00001470| 2f 0d 23 64 65 66 69 6e | 65 09 09 09 09 20 55 54 |/.#defin|e.... UT|
|00001480| 61 62 6c 65 42 61 73 65 | 41 64 64 72 09 09 09 30 |ableBase|Addr...0|
|00001490| 78 31 31 43 09 09 2f 2a | 20 41 64 64 72 65 73 73 |x11C../*| Address|
|000014a0| 20 6f 66 20 70 6f 69 6e | 74 65 72 20 74 6f 20 55 | of poin|ter to U|
|000014b0| 6e 69 74 20 54 61 62 6c | 65 20 2a 2f 0d 0d 23 64 |nit Tabl|e */..#d|
|000014c0| 65 66 69 6e 65 20 20 20 | 20 20 20 20 20 20 20 64 |efine | d|
|000014d0| 52 61 6d 42 61 73 65 64 | 20 20 20 20 20 36 20 20 |RamBased| 6 |
|000014e0| 20 2f 2a 62 69 74 20 69 | 6e 20 64 43 74 6c 46 6c | /*bit i|n dCtlFl|
|000014f0| 61 67 73 20 77 68 69 63 | 68 20 69 73 20 73 65 74 |ags whic|h is set|
|00001500| 20 66 6f 72 20 52 61 6d | 20 62 61 73 65 64 20 64 | for Ram| based d|
|00001510| 72 69 76 65 72 73 2a 2f | 0d 0d 23 64 65 66 69 6e |rivers*/|..#defin|
|00001520| 65 20 63 73 44 72 76 72 | 56 65 72 73 09 09 09 20 |e csDrvr|Vers... |
|00001530| 39 39 09 09 2f 2a 20 4f | 75 72 20 64 72 69 76 65 |99../* O|ur drive|
|00001540| 72 20 63 6f 6e 74 72 6f | 6c 20 63 6f 64 65 20 74 |r contro|l code t|
|00001550| 6f 20 72 65 74 75 72 6e | 20 64 72 69 76 65 72 20 |o return| driver |
|00001560| 76 65 72 73 69 6f 6e 20 | 20 2a 2f 0d 23 64 65 66 |version | */.#def|
|00001570| 69 6e 65 20 63 73 49 6e | 73 74 61 6c 6c 09 09 09 |ine csIn|stall...|
|00001580| 09 31 30 30 09 09 2f 2a | 20 4f 75 72 20 64 72 69 |.100../*| Our dri|
|00001590| 76 65 72 20 63 6f 6e 74 | 72 6f 6c 20 63 6f 64 65 |ver cont|rol code|
|000015a0| 20 74 6f 20 69 6e 73 74 | 61 6c 6c 20 61 20 73 65 | to inst|all a se|
|000015b0| 6c 65 63 74 6f 72 20 20 | 20 20 20 2a 2f 0d 23 64 |lector | */.#d|
|000015c0| 65 66 69 6e 65 20 63 73 | 52 65 74 72 69 65 76 65 |efine cs|Retrieve|
|000015d0| 09 09 09 31 30 31 09 09 | 2f 2a 20 4f 75 72 20 64 |...101..|/* Our d|
|000015e0| 72 69 76 65 72 20 63 6f | 6e 74 72 6f 6c 20 63 6f |river co|ntrol co|
|000015f0| 64 65 20 74 6f 20 72 65 | 74 72 69 65 76 65 20 61 |de to re|trieve a|
|00001600| 20 73 65 6c 65 63 74 6f | 72 20 20 20 20 2a 2f 0d | selecto|r */.|
|00001610| 0d 0d 74 79 70 65 64 65 | 66 20 73 74 72 75 63 74 |..typede|f struct|
|00001620| 20 20 7b 20 20 2f 2a 20 | 74 68 65 20 63 6f 6e 74 | { /* |the cont|
|00001630| 72 6f 6c 20 6d 65 73 73 | 61 67 65 20 77 65 20 77 |rol mess|age we w|
|00001640| 69 6c 6c 20 70 61 73 73 | 20 74 6f 20 6f 75 72 20 |ill pass| to our |
|00001650| 49 50 43 20 64 72 69 76 | 65 72 20 2a 2f 0d 09 73 |IPC driv|er */..s|
|00001660| 68 6f 72 74 20 09 63 6f | 6e 74 72 6f 6c 43 6f 64 |hort .co|ntrolCod|
|00001670| 65 3b 0d 09 4f 53 54 79 | 70 65 09 53 65 6c 65 63 |e;..OSTy|pe.Selec|
|00001680| 74 6f 72 3b 20 20 09 2f | 2a 20 61 2e 6b 2e 61 2e |tor; ./|* a.k.a.|
|00001690| 20 53 69 67 6e 61 74 75 | 72 65 20 2a 2f 0d 09 6c | Signatu|re */..l|
|000016a0| 6f 6e 67 09 20 09 56 61 | 6c 75 65 3b 20 20 09 09 |ong. .Va|lue; ..|
|000016b0| 2f 2a 20 61 2e 6b 2e 61 | 2e 20 74 68 65 50 74 72 |/* a.k.a|. thePtr|
|000016c0| 20 09 09 2a 2f 0d 09 7d | 20 44 72 69 76 65 72 43 | ..*/..}| DriverC|
|000016d0| 6f 6e 74 72 6f 6c 50 61 | 72 61 6d 65 74 65 72 73 |ontrolPa|rameters|
|000016e0| 3b 0d 0d 23 64 65 66 69 | 6e 65 20 49 50 43 44 72 |;..#defi|ne IPCDr|
|000016f0| 69 76 65 72 4e 61 6d 65 | 20 22 5c 70 2e 2e 69 70 |iverName| "\p..ip|
|00001700| 63 20 62 79 20 6a 67 72 | 6f 22 0d 0d 0d 2f 2a 2a |c by jgr|o".../**|
|00001710| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001720| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001730| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001740| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001750| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001760| 2a 2a 0d 2a 09 09 09 09 | 09 09 09 09 09 09 09 09 |**.*....|........|
|00001770| 09 09 09 09 09 09 09 09 | 09 09 09 09 09 09 09 09 |........|........|
|00001780| 09 09 09 09 09 09 09 09 | 09 09 09 09 09 09 2a 0d |........|......*.|
|00001790| 2a 09 09 46 55 4e 43 54 | 49 4f 4e 20 52 65 67 69 |*..FUNCT|ION Regi|
|000017a0| 73 74 65 72 4d 79 53 69 | 67 6e 61 74 75 72 65 28 |sterMySi|gnature(|
|000017b0| 53 69 67 6e 61 74 75 72 | 65 3a 20 4f 53 54 79 70 |Signatur|e: OSTyp|
|000017c0| 65 3b 20 09 09 09 09 09 | 09 09 09 09 09 09 09 09 |e; .....|........|
|000017d0| 09 09 09 2a 0d 2a 09 09 | 09 09 09 09 09 09 09 09 |...*.*..|........|
|000017e0| 09 09 09 09 09 09 74 68 | 65 50 74 72 3a 20 55 4e |......th|ePtr: UN|
|000017f0| 49 56 20 4c 4f 4e 47 49 | 4e 54 29 09 09 09 09 09 |IV LONGI|NT).....|
|00001800| 09 09 09 09 09 09 09 09 | 09 09 09 2a 0d 2a 09 09 |........|...*.*..|
|00001810| 09 09 09 09 09 09 09 09 | 09 09 09 09 09 09 3a 20 |........|......: |
|00001820| 4f 53 45 72 72 3b 20 45 | 58 54 45 52 4e 41 4c 3b |OSErr; E|XTERNAL;|
|00001830| 09 09 09 09 09 09 09 09 | 09 09 09 09 09 09 09 09 |........|........|
|00001840| 09 2a 0d 2a 09 09 09 09 | 09 09 09 09 09 09 09 09 |.*.*....|........|
|00001850| 09 09 09 09 09 09 09 09 | 09 09 09 09 09 09 09 09 |........|........|
|00001860| 09 09 09 09 09 09 09 09 | 09 09 09 09 09 09 2a 0d |........|......*.|
|00001870| 2a 09 09 70 61 73 63 61 | 6c 20 4f 53 45 72 72 20 |*..pasca|l OSErr |
|00001880| 52 65 67 69 73 74 65 72 | 4d 79 53 69 67 6e 61 74 |Register|MySignat|
|00001890| 75 72 65 28 4f 53 54 79 | 70 65 20 53 69 67 6e 61 |ure(OSTy|pe Signa|
|000018a0| 74 75 72 65 2c 20 6c 6f | 6e 67 20 74 68 65 50 74 |ture, lo|ng thePt|
|000018b0| 72 29 3b 20 09 09 09 09 | 09 09 09 09 2a 0d 2a 09 |r); ....|....*.*.|
|000018c0| 09 09 09 09 09 09 09 09 | 09 09 09 09 09 09 09 09 |........|........|
|000018d0| 09 09 09 09 09 09 09 09 | 09 09 09 09 09 09 09 09 |........|........|
|000018e0| 09 09 09 09 09 09 09 09 | 09 2a 0d 2a 09 09 09 09 |........|.*.*....|
|000018f0| 09 09 09 09 09 09 09 09 | 09 09 09 09 09 09 09 09 |........|........|
|00001900| 09 09 09 09 09 09 09 09 | 09 09 09 09 09 09 09 09 |........|........|
|00001910| 09 09 09 09 09 09 2a 0d | 2a 20 52 65 67 69 73 74 |......*.|* Regist|
|00001920| 65 72 4d 79 53 69 67 6e | 61 74 75 72 65 20 72 65 |erMySign|ature re|
|00001930| 67 69 73 74 65 72 73 20 | 53 69 67 6e 61 74 75 72 |gisters |Signatur|
|00001940| 65 20 73 6f 20 74 68 61 | 74 09 09 09 09 09 09 09 |e so tha|t.......|
|00001950| 09 09 09 09 09 09 09 09 | 09 09 09 2a 0d 2a 20 4c |........|...*.* L|
|00001960| 6f 6f 6b 75 70 4d 79 53 | 69 67 6e 61 74 75 72 65 |ookupMyS|ignature|
|00001970| 28 53 69 67 6e 61 74 75 | 72 65 2c 20 26 52 65 73 |(Signatu|re, &Res|
|00001980| 70 6f 6e 73 65 29 20 72 | 65 74 75 72 6e 73 20 74 |ponse) r|eturns t|
|00001990| 68 65 50 74 72 20 69 6e | 20 52 65 73 70 6f 6e 73 |hePtr in| Respons|
|000019a0| 65 2e 20 20 09 09 09 09 | 09 09 09 2a 0d 2a 20 4e |e. ....|...*.* N|
|000019b0| 6f 72 6d 61 6c 20 55 73 | 61 67 65 20 69 73 20 74 |ormal Us|age is t|
|000019c0| 6f 20 20 63 61 6c 6c 20 | 52 65 67 69 73 74 65 72 |o call |Register|
|000019d0| 4d 79 53 69 67 6e 61 74 | 75 72 65 20 77 69 74 68 |MySignat|ure with|
|000019e0| 20 74 68 65 20 63 61 6c | 6c 65 72 27 73 20 28 49 | the cal|ler's (I|
|000019f0| 4e 49 54 2c 20 44 52 56 | 52 2c 20 09 09 09 2a 0d |NIT, DRV|R, ...*.|
|00001a00| 2a 20 41 50 50 4c 2c 20 | 77 68 61 74 65 76 65 72 |* APPL, |whatever|
|00001a10| 29 20 63 72 65 61 74 6f | 72 09 62 79 74 65 73 20 |) creato|r.bytes |
|00001a20| 61 73 20 74 68 65 20 53 | 69 67 6e 61 74 75 72 65 |as the S|ignature|
|00001a30| 2c 20 61 6e 64 20 61 20 | 70 6f 69 6e 74 65 72 20 |, and a |pointer |
|00001a40| 74 6f 20 74 68 65 20 63 | 61 6c 6c 65 72 27 73 20 |to the c|aller's |
|00001a50| 09 09 2a 0d 2a 20 67 6c | 6f 62 61 6c 73 2c 20 73 |..*.* gl|obals, s|
|00001a60| 68 61 72 65 64 20 6d 65 | 6d 6f 72 79 2c 20 6f 72 |hared me|mory, or|
|00001a70| 20 63 61 6c 6c 20 62 61 | 63 6b 20 66 75 6e 63 74 | call ba|ck funct|
|00001a80| 69 6f 6e 20 61 73 20 74 | 68 65 50 74 72 2e 20 20 |ion as t|hePtr. |
|00001a90| 09 09 09 09 09 09 09 09 | 09 09 09 09 2a 09 09 09 |........|....*...|
|00001aa0| 09 09 09 09 09 09 09 09 | 09 09 2a 0d 2a 20 4e 6f |........|..*.* No|
|00001ab0| 74 65 3a 20 54 68 65 20 | 4e 69 6c 20 73 69 67 6e |te: The |Nil sign|
|00001ac0| 61 74 75 72 65 2c 20 28 | 69 2e 65 2e 20 53 69 67 |ature, (|i.e. Sig|
|00001ad0| 6e 61 74 75 72 65 20 3d | 3d 20 30 29 2c 20 69 73 |nature =|= 0), is|
|00001ae0| 20 72 65 73 65 72 76 65 | 64 2e 20 20 44 6f 6e 27 | reserve|d. Don'|
|00001af0| 74 20 74 72 79 20 74 6f | 09 09 09 09 2a 0d 2a 20 |t try to|....*.* |
|00001b00| 72 65 67 69 73 74 65 72 | 20 69 74 2e 09 09 09 09 |register| it.....|
|00001b10| 09 09 09 09 09 09 09 09 | 09 09 09 09 09 09 09 09 |........|........|
|00001b20| 09 09 09 09 09 09 09 09 | 09 09 09 09 09 09 09 2a |........|.......*|
|00001b30| 0d 2a 09 09 09 09 09 09 | 09 09 09 09 09 09 09 09 |.*......|........|
|00001b40| 09 09 09 09 09 09 09 09 | 09 09 09 09 09 09 09 09 |........|........|
|00001b50| 09 09 09 09 09 09 09 09 | 09 09 09 09 2a 0d 2a 09 |........|....*.*.|
|00001b60| 45 72 72 6f 72 52 65 74 | 75 72 6e 73 3a 20 4f 53 |ErrorRet|urns: OS|
|00001b70| 45 72 72 73 20 66 72 6f | 6d 20 4d 65 6d 6f 72 79 |Errs fro|m Memory|
|00001b80| 4d 61 6e 61 67 65 72 2c | 20 47 65 73 74 61 6c 74 |Manager,| Gestalt|
|00001b90| 2c 20 4f 70 65 6e 44 72 | 69 76 65 72 2c 20 65 74 |, OpenDr|iver, et|
|00001ba0| 63 2e 09 09 09 09 09 09 | 09 09 2a 0d 2a 09 09 09 |c.......|..*.*...|
|00001bb0| 09 09 09 09 09 09 09 09 | 09 09 09 09 09 09 09 09 |........|........|
|00001bc0| 09 09 09 09 09 09 09 09 | 09 09 09 09 09 09 09 09 |........|........|
|00001bd0| 09 09 09 09 09 09 09 2a | 0d 2a 2a 2a 2a 2a 2a 2a |.......*|.*******|
|00001be0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001bf0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001c00| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001c10| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001c20| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2f 0d 2f |********|*****/./|
|00001c30| 2a 20 52 65 67 69 73 74 | 65 72 4d 79 53 69 67 6e |* Regist|erMySign|
|00001c40| 61 74 75 72 65 20 61 73 | 73 6f 63 69 61 74 65 73 |ature as|sociates|
|00001c50| 20 61 20 6c 6f 6e 67 20 | 77 69 74 68 20 61 6e 20 | a long |with an |
|00001c60| 4f 53 54 79 70 65 2e 20 | 20 49 66 20 47 65 73 74 |OSType. | If Gest|
|00001c70| 61 6c 74 20 69 73 20 61 | 76 61 69 6c 61 62 6c 65 |alt is a|vailable|
|00001c80| 20 28 73 79 73 20 36 2e | 30 2e 34 0d 09 20 6f 72 | (sys 6.|0.4.. or|
|00001c90| 20 6c 61 74 65 72 29 20 | 74 68 65 6e 20 69 74 20 | later) |then it |
|00001ca0| 77 69 6c 6c 20 75 73 65 | 20 47 65 73 74 61 6c 74 |will use| Gestalt|
|00001cb0| 2e 20 20 4f 74 68 65 72 | 77 69 73 65 20 69 74 20 |. Other|wise it |
|00001cc0| 77 69 6c 6c 20 69 6e 73 | 74 61 6c 6c 20 6f 75 72 |will ins|tall our|
|00001cd0| 20 49 50 43 20 64 72 69 | 76 65 72 20 61 6e 64 20 | IPC dri|ver and |
|00001ce0| 75 73 65 20 74 68 61 74 | 2e 0d 09 20 49 66 20 47 |use that|... If G|
|00001cf0| 65 73 74 61 6c 74 20 69 | 73 20 70 72 65 73 65 6e |estalt i|s presen|
|00001d00| 74 20 62 75 74 20 74 68 | 65 72 65 20 69 73 20 61 |t but th|ere is a|
|00001d10| 6e 20 65 72 72 6f 72 20 | 72 65 67 69 73 74 65 72 |n error |register|
|00001d20| 69 6e 67 20 77 69 74 68 | 20 47 65 73 74 61 6c 74 |ing with| Gestalt|
|00001d30| 2c 20 6f 75 72 20 44 52 | 56 52 0d 09 20 77 69 6c |, our DR|VR.. wil|
|00001d40| 6c 20 2a 6e 6f 74 2a 20 | 62 65 20 75 73 65 64 2c |l *not* |be used,|
|00001d50| 20 62 75 74 20 72 61 74 | 68 65 72 20 61 6e 20 65 | but rat|her an e|
|00001d60| 72 72 6f 72 20 77 69 6c | 6c 20 62 65 20 72 65 74 |rror wil|l be ret|
|00001d70| 75 72 6e 65 64 2e 0d 20 | 2a 2f 0d 70 61 73 63 61 |urned.. |*/.pasca|
|00001d80| 6c 20 4f 53 45 72 72 20 | 52 65 67 69 73 74 65 72 |l OSErr |Register|
|00001d90| 4d 79 53 69 67 6e 61 74 | 75 72 65 28 4f 53 54 79 |MySignat|ure(OSTy|
|00001da0| 70 65 20 53 69 67 6e 61 | 74 75 72 65 2c 20 6c 6f |pe Signa|ture, lo|
|00001db0| 6e 67 20 74 68 65 50 74 | 72 29 0d 7b 0d 09 73 68 |ng thePt|r).{..sh|
|00001dc0| 6f 72 74 09 09 72 65 66 | 6e 75 6d 3b 0d 09 4f 53 |ort..ref|num;..OS|
|00001dd0| 45 72 72 09 09 74 68 65 | 45 72 72 3b 0d 09 44 72 |Err..the|Err;..Dr|
|00001de0| 69 76 65 72 43 6f 6e 74 | 72 6f 6c 50 61 72 61 6d |iverCont|rolParam|
|00001df0| 65 74 65 72 73 20 2a 74 | 68 65 4d 65 73 73 61 67 |eters *t|heMessag|
|00001e00| 65 3b 0d 09 50 61 72 61 | 6d 42 6c 6f 63 6b 52 65 |e;..Para|mBlockRe|
|00001e10| 63 20 70 62 3b 0d 09 0d | 09 0d 09 69 66 20 28 28 |c pb;...|...if ((|
|00001e20| 74 68 65 45 72 72 20 3d | 20 52 65 67 69 73 74 65 |theErr =| Registe|
|00001e30| 72 57 69 74 68 47 65 73 | 74 61 6c 74 28 53 69 67 |rWithGes|talt(Sig|
|00001e40| 6e 61 74 75 72 65 2c 20 | 74 68 65 50 74 72 29 29 |nature, |thePtr))|
|00001e50| 20 21 3d 20 2d 34 20 2f | 2a 20 75 6e 69 6d 70 45 | != -4 /|* unimpE|
|00001e60| 72 72 20 2a 2f 29 20 0d | 09 09 72 65 74 75 72 6e |rr */) .|..return|
|00001e70| 20 28 74 68 65 45 72 72 | 29 3b 09 2f 2a 20 55 73 | (theErr|);./* Us|
|00001e80| 65 20 47 65 73 74 61 6c | 74 20 74 6f 20 72 65 67 |e Gestal|t to reg|
|00001e90| 69 73 74 65 72 20 73 69 | 67 6e 61 74 75 72 65 20 |ister si|gnature |
|00001ea0| 2a 2f 0d 0d 09 2f 2a 20 | 47 65 73 74 61 6c 74 20 |*/.../* |Gestalt |
|00001eb0| 69 73 6e 27 74 20 61 76 | 61 69 6c 61 62 6c 65 2c |isn't av|ailable,|
|00001ec0| 20 73 6f 20 75 73 65 20 | 6f 75 72 20 49 50 43 20 | so use |our IPC |
|00001ed0| 64 72 69 76 65 72 20 2a | 2f 0d 09 72 65 66 6e 75 |driver *|/..refnu|
|00001ee0| 6d 20 3d 20 49 6e 73 74 | 61 6c 6c 31 44 72 69 76 |m = Inst|all1Driv|
|00001ef0| 65 72 28 49 50 43 44 72 | 69 76 65 72 4e 61 6d 65 |er(IPCDr|iverName|
|00001f00| 29 3b 09 09 09 09 09 2f | 2a 20 49 6e 73 74 61 6c |);...../|* Instal|
|00001f10| 6c 20 6f 75 72 20 49 50 | 43 20 44 72 69 76 65 72 |l our IP|C Driver|
|00001f20| 20 20 2a 2f 0d 0d 09 69 | 66 20 28 72 65 66 6e 75 | */...i|f (refnu|
|00001f30| 6d 20 3c 3d 20 30 29 09 | 09 09 2f 2a 20 47 65 73 |m <= 0).|../* Ges|
|00001f40| 74 61 6c 74 20 69 73 20 | 6e 6f 74 20 70 72 65 73 |talt is |not pres|
|00001f50| 65 6e 74 2c 20 61 6e 64 | 20 77 65 20 63 6f 75 6c |ent, and| we coul|
|00001f60| 64 20 6e 6f 74 20 69 6e | 73 74 61 6c 6c 20 6f 75 |d not in|stall ou|
|00001f70| 72 20 44 72 69 76 65 72 | 20 2a 2f 0d 09 09 72 65 |r Driver| */...re|
|00001f80| 74 75 72 6e 20 72 65 66 | 6e 75 6d 3b 20 0d 09 09 |turn ref|num; ...|
|00001f90| 0d 09 09 2f 2a 20 4f 70 | 65 6e 20 74 68 65 20 64 |.../* Op|en the d|
|00001fa0| 72 69 76 65 72 20 2a 2f | 0d 09 70 62 2e 69 6f 50 |river */|..pb.ioP|
|00001fb0| 61 72 61 6d 2e 69 6f 43 | 6f 6d 70 6c 65 74 69 6f |aram.ioC|ompletio|
|00001fc0| 6e 20 3d 20 6e 69 6c 3b | 0d 09 70 62 2e 69 6f 50 |n = nil;|..pb.ioP|
|00001fd0| 61 72 61 6d 2e 69 6f 4e | 61 6d 65 50 74 72 20 20 |aram.ioN|amePtr |
|00001fe0| 3d 20 49 50 43 44 72 69 | 76 65 72 4e 61 6d 65 3b |= IPCDri|verName;|
|00001ff0| 0d 09 70 62 2e 69 6f 50 | 61 72 61 6d 2e 69 6f 50 |..pb.ioP|aram.ioP|
|00002000| 65 72 6d 73 73 6e 20 3d | 20 30 3b 0d 09 74 68 65 |ermssn =| 0;..the|
|00002010| 45 72 72 20 3d 20 50 42 | 4f 70 65 6e 28 26 70 62 |Err = PB|Open(&pb|
|00002020| 2c 66 61 6c 73 65 29 3b | 0d 09 72 65 66 6e 75 6d |,false);|..refnum|
|00002030| 20 3d 20 70 62 2e 69 6f | 50 61 72 61 6d 2e 69 6f | = pb.io|Param.io|
|00002040| 52 65 66 4e 75 6d 3b 0d | 09 69 66 20 28 74 68 65 |RefNum;.|.if (the|
|00002050| 45 72 72 20 21 3d 20 6e | 6f 45 72 72 29 0d 09 09 |Err != n|oErr)...|
|00002060| 72 65 74 75 72 6e 20 28 | 74 68 65 45 72 72 29 3b |return (|theErr);|
|00002070| 0d 09 09 0d 09 09 2f 2a | 20 4e 6f 77 20 72 65 67 |....../*| Now reg|
|00002080| 69 73 74 65 72 20 77 69 | 74 68 20 6f 75 72 20 64 |ister wi|th our d|
|00002090| 72 69 76 65 72 20 2a 2f | 0d 09 70 62 2e 63 6e 74 |river */|..pb.cnt|
|000020a0| 72 6c 50 61 72 61 6d 2e | 69 6f 43 6f 6d 70 6c 65 |rlParam.|ioComple|
|000020b0| 74 69 6f 6e 20 3d 20 6e | 69 6c 3b 0d 09 70 62 2e |tion = n|il;..pb.|
|000020c0| 63 6e 74 72 6c 50 61 72 | 61 6d 2e 69 6f 56 52 65 |cntrlPar|am.ioVRe|
|000020d0| 66 4e 75 6d 20 3d 20 30 | 3b 0d 09 70 62 2e 63 6e |fNum = 0|;..pb.cn|
|000020e0| 74 72 6c 50 61 72 61 6d | 2e 69 6f 43 52 65 66 4e |trlParam|.ioCRefN|
|000020f0| 75 6d 20 3d 20 72 65 66 | 6e 75 6d 3b 0d 09 74 68 |um = ref|num;..th|
|00002100| 65 4d 65 73 73 61 67 65 | 20 3d 20 28 44 72 69 76 |eMessage| = (Driv|
|00002110| 65 72 43 6f 6e 74 72 6f | 6c 50 61 72 61 6d 65 74 |erContro|lParamet|
|00002120| 65 72 73 20 2a 29 20 26 | 70 62 2e 63 6e 74 72 6c |ers *) &|pb.cntrl|
|00002130| 50 61 72 61 6d 2e 63 73 | 43 6f 64 65 3b 0d 09 74 |Param.cs|Code;..t|
|00002140| 68 65 4d 65 73 73 61 67 | 65 2d 3e 63 6f 6e 74 72 |heMessag|e->contr|
|00002150| 6f 6c 43 6f 64 65 20 3d | 20 63 73 49 6e 73 74 61 |olCode =| csInsta|
|00002160| 6c 6c 3b 0d 09 74 68 65 | 4d 65 73 73 61 67 65 2d |ll;..the|Message-|
|00002170| 3e 53 65 6c 65 63 74 6f | 72 20 3d 20 53 69 67 6e |>Selecto|r = Sign|
|00002180| 61 74 75 72 65 3b 0d 09 | 74 68 65 4d 65 73 73 61 |ature;..|theMessa|
|00002190| 67 65 2d 3e 56 61 6c 75 | 65 20 3d 20 74 68 65 50 |ge->Valu|e = theP|
|000021a0| 74 72 3b 0d 09 72 65 74 | 75 72 6e 20 28 50 42 43 |tr;..ret|urn (PBC|
|000021b0| 6f 6e 74 72 6f 6c 28 26 | 70 62 2c 20 66 61 6c 73 |ontrol(&|pb, fals|
|000021c0| 65 29 29 3b 0d 7d 0d 0d | 2f 2a 20 49 6e 73 74 61 |e));.}..|/* Insta|
|000021d0| 6c 6c 31 44 72 69 76 65 | 72 20 69 6e 73 74 61 6c |ll1Drive|r instal|
|000021e0| 6c 73 20 61 20 64 72 69 | 76 65 72 20 69 6e 20 61 |ls a dri|ver in a|
|000021f0| 20 64 79 6e 61 6d 69 63 | 61 6c 6c 79 20 64 65 74 | dynamic|ally det|
|00002200| 65 72 6d 69 6e 65 64 20 | 73 6c 6f 74 20 0d 09 20 |ermined |slot .. |
|00002210| 69 6e 20 74 68 65 20 75 | 6e 69 74 20 74 61 62 6c |in the u|nit tabl|
|00002220| 65 2c 20 61 73 20 72 65 | 63 6f 6d 6d 65 6e 64 65 |e, as re|commende|
|00002230| 64 20 69 6e 20 74 68 65 | 20 64 72 61 66 74 20 74 |d in the| draft t|
|00002240| 65 63 68 6e 6f 74 65 20 | 22 46 69 6e 64 69 6e 67 |echnote |"Finding|
|00002250| 20 61 20 53 6c 6f 74 20 | 66 6f 72 20 61 0d 09 20 | a Slot |for a.. |
|00002260| 44 72 69 76 65 72 22 20 | 62 79 20 4d 61 72 6b 20 |Driver" |by Mark |
|00002270| 42 65 6e 6e 65 74 74 20 | 28 75 6e 72 65 6c 65 61 |Bennett |(unrelea|
|00002280| 73 65 64 29 2e 20 20 0d | 09 20 49 74 20 66 69 72 |sed). .|. It fir|
|00002290| 73 74 20 63 68 65 63 6b | 73 20 74 6f 20 73 65 65 |st check|s to see|
|000022a0| 20 69 66 20 74 68 65 20 | 64 72 69 76 65 72 20 69 | if the |driver i|
|000022b0| 73 20 61 6c 72 65 61 64 | 79 20 69 6e 73 74 61 6c |s alread|y instal|
|000022c0| 6c 65 64 2e 20 49 66 20 | 6e 6f 74 2c 20 69 74 20 |led. If |not, it |
|000022d0| 66 69 6e 64 73 20 61 6e | 20 65 6d 70 74 79 20 73 |finds an| empty s|
|000022e0| 6c 6f 74 0d 09 20 69 6e | 20 74 68 65 20 75 6e 69 |lot.. in| the uni|
|000022f0| 74 20 74 61 62 6c 65 20 | 3e 3d 20 75 6e 69 74 20 |t table |>= unit |
|00002300| 34 38 2e 20 20 49 66 20 | 74 68 65 72 65 20 61 72 |48. If |there ar|
|00002310| 65 6e 27 74 20 61 6e 79 | 20 65 6d 70 74 79 20 73 |en't any| empty s|
|00002320| 6c 6f 74 73 2c 20 69 74 | 20 65 78 70 61 6e 64 73 |lots, it| expands|
|00002330| 20 74 68 65 20 75 6e 69 | 74 0d 09 20 74 61 62 6c | the uni|t.. tabl|
|00002340| 65 20 74 6f 20 63 72 65 | 61 74 65 20 6f 6e 65 2e |e to cre|ate one.|
|00002350| 20 20 49 74 20 74 68 65 | 6e 20 6c 6f 61 64 73 20 | It the|n loads |
|00002360| 74 68 65 20 64 72 69 76 | 65 72 20 69 6e 74 6f 20 |the driv|er into |
|00002370| 74 68 61 74 20 73 6c 6f | 74 2e 0d 09 20 49 66 20 |that slo|t... If |
|00002380| 74 68 65 20 64 72 69 76 | 65 72 20 68 61 73 20 74 |the driv|er has t|
|00002390| 68 65 20 73 79 73 74 65 | 6d 20 68 65 61 70 20 72 |he syste|m heap r|
|000023a0| 65 73 6f 75 72 63 65 20 | 61 74 74 72 69 62 75 74 |esource |attribut|
|000023b0| 65 20 73 65 74 2c 20 69 | 74 20 77 69 6c 6c 20 62 |e set, i|t will b|
|000023c0| 65 20 69 6e 73 74 61 6c | 6c 65 64 20 0d 09 20 70 |e instal|led .. p|
|000023d0| 65 72 6d 61 6e 65 6e 74 | 6c 79 2e 20 20 49 6e 73 |ermanent|ly. Ins|
|000023e0| 74 61 6c 6c 31 44 72 69 | 76 65 72 20 72 65 74 75 |tall1Dri|ver retu|
|000023f0| 72 6e 73 20 74 68 65 20 | 75 6e 69 74 20 6e 75 6d |rns the |unit num|
|00002400| 62 65 72 20 28 3d 3d 20 | 2d 28 72 65 66 6e 75 6d |ber (== |-(refnum|
|00002410| 20 2b 20 31 29 29 20 77 | 68 69 63 68 0d 09 20 69 | + 1)) w|hich.. i|
|00002420| 73 20 61 6c 77 61 79 73 | 20 70 6f 73 69 74 69 76 |s always| positiv|
|00002430| 65 2c 20 6f 72 20 61 6e | 20 65 72 72 6f 72 2c 20 |e, or an| error, |
|00002440| 77 68 69 63 68 20 69 73 | 20 61 6c 77 61 79 73 20 |which is| always |
|00002450| 6e 65 67 61 74 69 76 65 | 2e 0d 09 20 2a 2f 0d 70 |negative|... */.p|
|00002460| 61 73 63 61 6c 20 73 68 | 6f 72 74 20 20 49 6e 73 |ascal sh|ort Ins|
|00002470| 74 61 6c 6c 31 44 72 69 | 76 65 72 28 64 72 69 76 |tall1Dri|ver(driv|
|00002480| 65 72 4e 61 6d 65 29 20 | 20 0d 53 74 72 32 35 35 |erName) | .Str255|
|00002490| 09 09 64 72 69 76 65 72 | 4e 61 6d 65 3b 20 20 2f |..driver|Name; /|
|000024a0| 2a 20 4e 61 6d 65 20 6f | 66 20 74 68 65 20 44 52 |* Name o|f the DR|
|000024b0| 56 52 20 74 6f 20 69 6e | 73 74 61 6c 6c 20 2a 2f |VR to in|stall */|
|000024c0| 0d 7b 0d 09 48 61 6e 64 | 6c 65 20 74 68 65 44 72 |.{..Hand|le theDr|
|000024d0| 69 76 65 72 3b 09 09 09 | 09 2f 2a 20 48 61 6e 64 |iver;...|./* Hand|
|000024e0| 6c 65 20 74 6f 20 74 68 | 65 20 61 63 74 75 61 6c |le to th|e actual|
|000024f0| 20 64 72 69 76 65 72 20 | 63 6f 64 65 20 2a 2f 0d | driver |code */.|
|00002500| 09 73 68 6f 72 74 20 74 | 68 65 49 44 3b 09 09 09 |.short t|heID;...|
|00002510| 09 09 09 2f 2a 20 54 68 | 65 20 44 72 69 76 65 72 |.../* Th|e Driver|
|00002520| 27 73 20 72 65 66 6e 75 | 6d 20 28 20 3c 20 30 20 |'s refnu|m ( < 0 |
|00002530| 29 20 2a 2f 0d 09 44 43 | 74 6c 48 61 6e 64 6c 65 |) */..DC|tlHandle|
|00002540| 20 2a 74 68 65 55 54 61 | 62 6c 65 3b 20 20 2f 2a | *theUTa|ble; /*|
|00002550| 20 74 68 65 20 75 6e 69 | 74 20 74 61 62 6c 65 20 | the uni|t table |
|00002560| 2a 2f 0d 09 44 43 74 6c | 48 61 6e 64 6c 65 20 2a |*/..DCtl|Handle *|
|00002570| 2a 55 54 61 62 6c 65 42 | 61 73 65 3b 2f 2a 20 70 |*UTableB|ase;/* p|
|00002580| 6f 69 6e 74 65 72 20 74 | 6f 20 55 54 61 62 6c 65 |ointer t|o UTable|
|00002590| 42 61 73 65 2c 20 77 68 | 69 63 68 20 3d 20 68 61 |Base, wh|ich = ha|
|000025a0| 6e 64 6c 65 20 74 6f 20 | 75 6e 69 74 20 74 61 62 |ndle to |unit tab|
|000025b0| 6c 65 20 2a 2f 0d 09 73 | 68 6f 72 74 20 74 68 65 |le */..s|hort the|
|000025c0| 53 6c 6f 74 3b 09 09 09 | 09 09 2f 2a 20 74 68 65 |Slot;...|../* the|
|000025d0| 20 44 72 69 76 65 72 27 | 73 20 75 6e 69 74 20 6e | Driver'|s unit n|
|000025e0| 75 6d 62 65 72 20 28 20 | 3e 20 30 20 29 20 2a 2f |umber ( |> 0 ) */|
|000025f0| 0d 09 44 43 74 6c 48 61 | 6e 64 6c 65 20 74 68 65 |..DCtlHa|ndle the|
|00002600| 44 43 45 3b 09 09 09 2f | 2a 20 68 61 6e 64 6c 65 |DCE;.../|* handle|
|00002610| 20 74 6f 20 74 68 65 20 | 44 72 69 76 65 72 27 73 | to the |Driver's|
|00002620| 20 44 65 76 69 63 65 20 | 43 6f 6e 74 72 6f 6c 20 | Device |Control |
|00002630| 45 6e 74 72 79 20 2a 2f | 0d 09 73 68 6f 72 74 20 |Entry */|..short |
|00002640| 2a 74 68 65 44 72 69 76 | 65 72 48 65 61 64 65 72 |*theDriv|erHeader|
|00002650| 3b 20 2f 2a 20 70 74 72 | 20 74 6f 20 74 68 65 20 |; /* ptr| to the |
|00002660| 44 72 69 76 65 72 27 73 | 20 68 65 61 64 65 72 20 |Driver's| header |
|00002670| 2a 2f 0d 09 0d 09 09 2f | 2a 20 46 69 72 73 74 2c |*/...../|* First,|
|00002680| 20 63 68 65 63 6b 20 74 | 6f 20 73 65 65 20 69 66 | check t|o see if|
|00002690| 20 74 68 65 20 64 72 69 | 76 65 72 20 68 61 73 20 | the dri|ver has |
|000026a0| 61 6c 72 65 61 64 79 20 | 62 65 65 6e 20 69 6e 73 |already |been ins|
|000026b0| 74 61 6c 6c 65 64 20 2a | 2f 0d 09 69 66 20 28 28 |talled *|/..if ((|
|000026c0| 74 68 65 49 44 20 3d 20 | 47 65 74 44 72 76 72 52 |theID = |GetDrvrR|
|000026d0| 65 66 4e 75 6d 28 64 72 | 69 76 65 72 4e 61 6d 65 |efNum(dr|iverName|
|000026e0| 29 29 20 21 3d 20 30 29 | 0d 09 09 72 65 74 75 72 |)) != 0)|...retur|
|000026f0| 6e 20 28 2d 28 74 68 65 | 49 44 20 2b 20 31 29 29 |n (-(the|ID + 1))|
|00002700| 3b 0d 09 0d 09 09 2f 2a | 20 49 6e 73 74 61 6c 6c |;...../*| Install|
|00002710| 20 74 68 65 20 64 72 69 | 76 65 72 20 2a 2f 0d 09 | the dri|ver */..|
|00002720| 74 68 65 44 72 69 76 65 | 72 20 3d 20 47 65 74 4e |theDrive|r = GetN|
|00002730| 61 6d 65 64 52 65 73 6f | 75 72 63 65 28 27 44 52 |amedReso|urce('DR|
|00002740| 56 52 27 2c 20 64 72 69 | 76 65 72 4e 61 6d 65 29 |VR', dri|verName)|
|00002750| 3b 20 20 2f 2a 20 6c 6f | 61 64 20 74 68 65 20 64 |; /* lo|ad the d|
|00002760| 72 69 76 65 72 20 72 65 | 73 6f 75 72 63 65 20 2a |river re|source *|
|00002770| 2f 0d 09 69 66 20 28 74 | 68 65 44 72 69 76 65 72 |/..if (t|heDriver|
|00002780| 20 3d 3d 20 6e 69 6c 29 | 0d 09 09 72 65 74 75 72 | == nil)|...retur|
|00002790| 6e 20 28 52 65 73 45 72 | 72 6f 72 28 29 29 3b 0d |n (ResEr|ror());.|
|000027a0| 09 0d 09 69 66 20 28 28 | 74 68 65 53 6c 6f 74 20 |...if ((|theSlot |
|000027b0| 3d 20 46 69 6e 64 41 53 | 6c 6f 74 28 29 29 20 3c |= FindAS|lot()) <|
|000027c0| 20 30 29 09 2f 2a 20 46 | 69 6e 64 20 61 6e 20 65 | 0)./* F|ind an e|
|000027d0| 6d 70 74 79 20 75 6e 69 | 74 20 69 6e 20 74 68 65 |mpty uni|t in the|
|000027e0| 20 75 6e 69 74 20 74 61 | 62 6c 65 20 2a 2f 0d 09 | unit ta|ble */..|
|000027f0| 09 72 65 74 75 72 6e 20 | 74 68 65 53 6c 6f 74 3b |.return |theSlot;|
|00002800| 0d 09 0d 09 09 2f 2a 20 | 69 6e 73 74 61 6c 6c 20 |...../* |install |
|00002810| 74 68 65 20 64 72 69 76 | 65 72 20 69 6e 20 74 68 |the driv|er in th|
|00002820| 65 20 75 6e 69 74 20 74 | 61 62 6c 65 20 2a 2f 0d |e unit t|able */.|
|00002830| 09 48 4c 6f 63 6b 28 74 | 68 65 44 72 69 76 65 72 |.HLock(t|heDriver|
|00002840| 29 3b 0d 09 74 68 65 49 | 44 20 3d 20 2d 28 74 68 |);..theI|D = -(th|
|00002850| 65 53 6c 6f 74 20 2b 20 | 31 29 3b 0d 09 69 66 20 |eSlot + |1);..if |
|00002860| 28 28 74 68 65 49 44 20 | 3d 20 44 52 56 52 49 6e |((theID |= DRVRIn|
|00002870| 73 74 61 6c 6c 28 74 68 | 65 44 72 69 76 65 72 2c |stall(th|eDriver,|
|00002880| 20 74 68 65 49 44 29 29 | 20 21 3d 20 6e 6f 45 72 | theID))| != noEr|
|00002890| 72 29 20 20 0d 09 09 72 | 65 74 75 72 6e 20 74 68 |r) ...r|eturn th|
|000028a0| 65 49 44 3b 0d 09 0d 09 | 09 2f 2a 20 63 6f 70 79 |eID;....|./* copy|
|000028b0| 20 6f 76 65 72 20 74 68 | 65 20 64 72 69 76 65 72 | over th|e driver|
|000028c0| 20 66 6c 61 67 73 20 69 | 6e 74 6f 20 74 68 65 20 | flags i|nto the |
|000028d0| 44 43 45 20 2a 2f 0d 09 | 55 54 61 62 6c 65 42 61 |DCE */..|UTableBa|
|000028e0| 73 65 20 3d 20 28 44 43 | 74 6c 48 61 6e 64 6c 65 |se = (DC|tlHandle|
|000028f0| 20 2a 2a 29 28 55 54 61 | 62 6c 65 42 61 73 65 41 | **)(UTa|bleBaseA|
|00002900| 64 64 72 29 3b 0d 09 74 | 68 65 55 54 61 62 6c 65 |ddr);..t|heUTable|
|00002910| 20 3d 20 2a 55 54 61 62 | 6c 65 42 61 73 65 3b 0d | = *UTab|leBase;.|
|00002920| 09 74 68 65 44 43 45 20 | 3d 20 74 68 65 55 54 61 |.theDCE |= theUTa|
|00002930| 62 6c 65 5b 74 68 65 53 | 6c 6f 74 5d 3b 0d 0d 09 |ble[theS|lot];...|
|00002940| 74 68 65 44 72 69 76 65 | 72 48 65 61 64 65 72 20 |theDrive|rHeader |
|00002950| 3d 20 2a 28 73 68 6f 72 | 74 20 2a 2a 29 20 74 68 |= *(shor|t **) th|
|00002960| 65 44 72 69 76 65 72 3b | 0d 09 28 2a 2a 74 68 65 |eDriver;|..(**the|
|00002970| 44 43 45 29 2e 64 43 74 | 6c 46 6c 61 67 73 20 3d |DCE).dCt|lFlags =|
|00002980| 20 74 68 65 44 72 69 76 | 65 72 48 65 61 64 65 72 | theDriv|erHeader|
|00002990| 5b 30 5d 20 7c 20 28 31 | 20 3c 3c 20 64 52 61 6d |[0] | (1| << dRam|
|000029a0| 42 61 73 65 64 29 3b 0d | 09 28 2a 2a 74 68 65 44 |Based);.|.(**theD|
|000029b0| 43 45 29 2e 64 43 74 6c | 44 65 6c 61 79 20 3d 20 |CE).dCtl|Delay = |
|000029c0| 74 68 65 44 72 69 76 65 | 72 48 65 61 64 65 72 5b |theDrive|rHeader[|
|000029d0| 31 5d 3b 0d 09 28 2a 2a | 74 68 65 44 43 45 29 2e |1];..(**|theDCE).|
|000029e0| 64 43 74 6c 45 4d 61 73 | 6b 20 3d 20 74 68 65 44 |dCtlEMas|k = theD|
|000029f0| 72 69 76 65 72 48 65 61 | 64 65 72 5b 32 5d 3b 0d |riverHea|der[2];.|
|00002a00| 09 28 2a 2a 74 68 65 44 | 43 45 29 2e 64 43 74 6c |.(**theD|CE).dCtl|
|00002a10| 4d 65 6e 75 20 3d 20 74 | 68 65 44 72 69 76 65 72 |Menu = t|heDriver|
|00002a20| 48 65 61 64 65 72 5b 33 | 5d 3b 0d 09 28 2a 2a 74 |Header[3|];..(**t|
|00002a30| 68 65 44 43 45 29 2e 64 | 43 74 6c 44 72 69 76 65 |heDCE).d|CtlDrive|
|00002a40| 72 20 3d 20 28 50 74 72 | 29 20 74 68 65 44 72 69 |r = (Ptr|) theDri|
|00002a50| 76 65 72 3b 0d 09 48 55 | 6e 6c 6f 63 6b 28 74 68 |ver;..HU|nlock(th|
|00002a60| 65 44 72 69 76 65 72 29 | 3b 0d 09 0d 09 09 2f 2a |eDriver)|;...../*|
|00002a70| 20 69 66 20 74 68 65 20 | 44 72 69 76 65 72 20 69 | if the |Driver i|
|00002a80| 73 20 69 6e 20 74 68 65 | 20 73 79 73 74 65 6d 20 |s in the| system |
|00002a90| 7a 6f 6e 65 2c 20 64 65 | 74 61 63 68 20 69 74 20 |zone, de|tach it |
|00002aa0| 73 6f 20 74 68 61 74 20 | 69 74 20 77 6f 6e 27 74 |so that |it won't|
|00002ab0| 20 62 65 20 75 6e 6c 6f | 61 64 65 64 20 2a 2f 0d | be unlo|aded */.|
|00002ac0| 09 69 66 20 28 48 61 6e | 64 6c 65 5a 6f 6e 65 28 |.if (Han|dleZone(|
|00002ad0| 74 68 65 44 72 69 76 65 | 72 29 20 3d 3d 20 53 79 |theDrive|r) == Sy|
|00002ae0| 73 74 65 6d 5a 6f 6e 65 | 28 29 29 0d 09 09 44 65 |stemZone|())...De|
|00002af0| 74 61 63 68 52 65 73 6f | 75 72 63 65 28 74 68 65 |tachReso|urce(the|
|00002b00| 44 72 69 76 65 72 29 3b | 0d 09 0d 09 72 65 74 75 |Driver);|....retu|
|00002b10| 72 6e 20 74 68 65 53 6c | 6f 74 3b 0d 7d 0d 0d 0d |rn theSl|ot;.}...|
|00002b20| 2f 2a 20 47 65 74 44 72 | 76 72 52 65 66 4e 75 6d |/* GetDr|vrRefNum|
|00002b30| 2e 20 41 64 61 70 74 65 | 64 20 66 72 6f 6d 20 54 |. Adapte|d from T|
|00002b40| 65 63 68 6e 6f 74 65 20 | 23 37 31 20 2a 2f 0d 2f |echnote |#71 */./|
|00002b50| 2a 20 4c 6f 6f 6b 73 20 | 66 6f 72 20 6f 75 72 20 |* Looks |for our |
|00002b60| 64 72 69 76 65 72 20 69 | 6e 20 73 6c 6f 74 20 28 |driver i|n slot (|
|00002b70| 75 6e 69 74 20 6e 75 6d | 62 65 72 29 20 3e 3d 20 |unit num|ber) >= |
|00002b80| 34 38 2c 20 77 68 69 63 | 68 20 69 73 20 72 65 66 |48, whic|h is ref|
|00002b90| 6e 75 6d 20 3c 3d 20 2d | 34 39 20 2a 2f 0d 70 61 |num <= -|49 */.pa|
|00002ba0| 73 63 61 6c 20 73 68 6f | 72 74 20 20 47 65 74 44 |scal sho|rt GetD|
|00002bb0| 72 76 72 52 65 66 4e 75 | 6d 28 64 72 69 76 65 72 |rvrRefNu|m(driver|
|00002bc0| 4e 61 6d 65 29 0d 53 74 | 72 32 35 35 09 09 64 72 |Name).St|r255..dr|
|00002bd0| 69 76 65 72 4e 61 6d 65 | 3b 0d 7b 20 20 0d 2f 2a |iverName|;.{ ./*|
|00002be0| 6c 65 6e 67 74 68 20 62 | 79 74 65 20 61 6e 64 20 |length b|yte and |
|00002bf0| 6e 61 6d 65 20 6f 66 20 | 64 72 69 76 65 72 20 5b |name of |driver [|
|00002c00| 73 74 72 69 6e 67 5d 2a | 2f 0d 23 64 65 66 69 6e |string]*|/.#defin|
|00002c10| 65 20 20 20 20 20 20 20 | 20 20 20 64 72 76 72 4e |e | drvrN|
|00002c20| 61 6d 65 20 20 20 20 20 | 20 30 78 31 32 20 20 20 |ame | 0x12 |
|00002c30| 20 20 20 0d 0d 20 20 20 | 20 73 68 6f 72 74 20 20 | .. | short |
|00002c40| 20 20 20 20 20 20 20 20 | 20 20 6e 65 67 43 6f 75 | | negCou|
|00002c50| 6e 74 2c 64 52 65 66 3b | 0d 20 20 20 20 44 43 74 |nt,dRef;|. DCt|
|00002c60| 6c 48 61 6e 64 6c 65 20 | 20 20 20 20 20 20 20 44 |lHandle | D|
|00002c70| 43 45 48 3b 0d 20 20 20 | 20 63 68 61 72 20 20 20 |CEH;. | char |
|00002c80| 20 20 20 20 20 20 20 20 | 20 2a 64 72 69 76 65 72 | | *driver|
|00002c90| 50 74 72 2c 2a 73 3b 0d | 0d 20 20 20 20 6e 65 67 |Ptr,*s;.|. neg|
|00002ca0| 43 6f 75 6e 74 20 3d 20 | 2a 28 73 68 6f 72 74 20 |Count = |*(short |
|00002cb0| 2a 29 28 55 6e 69 74 4e | 74 72 79 43 6e 74 41 64 |*)(UnitN|tryCntAd|
|00002cc0| 64 72 29 3b 20 2f 2a 67 | 65 74 20 74 61 62 6c 65 |dr); /*g|et table|
|00002cd0| 20 73 69 7a 65 2a 2f 0d | 09 09 69 66 20 28 6e 65 | size*/.|..if (ne|
|00002ce0| 67 43 6f 75 6e 74 20 3c | 3d 20 34 38 29 20 2f 2a |gCount <|= 48) /*|
|00002cf0| 20 6e 6f 20 70 6c 61 63 | 65 20 74 6f 20 6c 6f 6f | no plac|e to loo|
|00002d00| 6b 20 2a 2f 0d 09 09 09 | 72 65 74 75 72 6e 20 30 |k */....|return 0|
|00002d10| 3b 0d 20 20 20 20 6e 65 | 67 43 6f 75 6e 74 20 3d |;. ne|gCount =|
|00002d20| 20 2d 6e 65 67 43 6f 75 | 6e 74 3b 20 2f 2a 67 65 | -negCou|nt; /*ge|
|00002d30| 74 20 2d 28 74 61 62 6c | 65 20 73 69 7a 65 29 2a |t -(tabl|e size)*|
|00002d40| 2f 0d 20 20 20 20 20 20 | 20 20 0d 20 20 20 20 2f |/. | . /|
|00002d50| 2a 43 68 65 63 6b 20 74 | 6f 20 73 65 65 20 74 68 |*Check t|o see th|
|00002d60| 61 74 20 64 72 69 76 65 | 72 20 69 73 20 69 6e 73 |at drive|r is ins|
|00002d70| 74 61 6c 6c 65 64 2c 20 | 6f 62 74 61 69 6e 20 72 |talled, |obtain r|
|00002d80| 65 66 4e 75 6d 2e 2a 2f | 0d 20 20 20 20 20 20 20 |efNum.*/|. |
|00002d90| 20 0d 20 20 20 20 64 52 | 65 66 20 3d 20 2d 34 39 | . dR|ef = -49|
|00002da0| 20 2b 20 31 3b 20 20 2f | 2a 77 65 27 6c 6c 20 73 | + 1; /|*we'll s|
|00002db0| 74 61 72 74 20 77 69 74 | 68 20 64 72 69 76 65 72 |tart wit|h driver|
|00002dc0| 20 72 65 66 6e 75 6d 20 | 3d 3d 20 2d 34 39 2c 0d | refnum |== -49,.|
|00002dd0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002de0| 20 20 20 20 20 20 20 20 | 72 69 67 68 74 20 61 66 | |right af|
|00002df0| 74 65 72 20 72 65 73 65 | 72 76 65 64 20 65 6e 74 |ter rese|rved ent|
|00002e00| 72 69 65 73 2a 2f 0d 20 | 20 20 20 20 20 20 20 0d |ries*/. | .|
|00002e10| 20 20 20 20 2f 2a 4c 6f | 6f 6b 20 74 68 72 6f 75 | /*Lo|ok throu|
|00002e20| 67 68 20 75 6e 69 74 20 | 74 61 62 6c 65 20 75 6e |gh unit |table un|
|00002e30| 74 69 6c 20 77 65 20 66 | 69 6e 64 20 74 68 65 20 |til we f|ind the |
|00002e40| 64 72 69 76 65 72 20 6f | 72 20 72 65 61 63 68 20 |driver o|r reach |
|00002e50| 74 68 65 20 65 6e 64 2e | 2a 2f 0d 20 20 20 20 64 |the end.|*/. d|
|00002e60| 6f 0d 20 20 20 20 7b 0d | 20 20 20 20 20 20 20 20 |o. {.| |
|00002e70| 64 52 65 66 20 2d 3d 20 | 31 3b 20 2f 2a 62 75 6d |dRef -= |1; /*bum|
|00002e80| 70 20 74 6f 20 6e 65 78 | 74 20 72 65 66 6e 75 6d |p to nex|t refnum|
|00002e90| 2a 2f 0d 20 20 20 20 20 | 20 20 20 44 43 45 48 20 |*/. | DCEH |
|00002ea0| 3d 20 47 65 74 44 43 74 | 6c 45 6e 74 72 79 28 64 |= GetDCt|lEntry(d|
|00002eb0| 52 65 66 29 3b 20 2f 2a | 67 65 74 20 68 61 6e 64 |Ref); /*|get hand|
|00002ec0| 6c 65 20 74 6f 20 44 43 | 45 2a 2f 0d 20 20 20 20 |le to DC|E*/. |
|00002ed0| 20 20 20 20 20 20 20 20 | 0d 20 20 20 20 20 20 20 | |. |
|00002ee0| 20 73 20 3d 20 22 22 3b | 0d 09 09 09 0d 20 20 20 | s = "";|..... |
|00002ef0| 20 20 20 20 20 69 66 20 | 28 28 44 43 45 48 20 21 | if |((DCEH !|
|00002f00| 3d 20 6e 69 6c 29 20 26 | 26 20 28 20 28 2a 2a 44 |= nil) &|& ( (**D|
|00002f10| 43 45 48 29 2e 64 43 74 | 6c 44 72 69 76 65 72 20 |CEH).dCt|lDriver |
|00002f20| 21 3d 20 6e 69 6c 29 20 | 29 0d 20 20 20 20 20 20 |!= nil) |). |
|00002f30| 20 20 7b 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 | {. | |
|00002f40| 69 66 20 28 28 28 2a 2a | 44 43 45 48 29 2e 64 43 |if (((**|DCEH).dC|
|00002f50| 74 6c 46 6c 61 67 73 20 | 3e 3e 20 64 52 61 6d 42 |tlFlags |>> dRamB|
|00002f60| 61 73 65 64 29 20 26 20 | 31 29 20 20 2f 2a 20 74 |ased) & |1) /* t|
|00002f70| 65 73 74 20 64 52 61 6d | 42 61 73 65 64 20 62 69 |est dRam|Based bi|
|00002f80| 74 20 2a 2f 0d 20 20 20 | 20 20 20 20 20 20 20 20 |t */. | |
|00002f90| 20 20 20 20 20 64 72 69 | 76 65 72 50 74 72 20 3d | dri|verPtr =|
|00002fa0| 20 2a 28 48 61 6e 64 6c | 65 29 20 28 2a 2a 44 43 | *(Handl|e) (**DC|
|00002fb0| 45 48 29 2e 64 43 74 6c | 44 72 69 76 65 72 3b 20 |EH).dCtl|Driver; |
|00002fc0| 2f 2a 20 52 41 4d 20 28 | 68 61 6e 64 6c 65 29 20 |/* RAM (|handle) |
|00002fd0| 62 61 73 65 64 20 2a 2f | 0d 20 20 20 20 20 20 20 |based */|. |
|00002fe0| 20 20 20 20 20 65 6c 73 | 65 0d 20 20 20 20 20 20 | els|e. |
|00002ff0| 20 20 20 20 20 20 20 20 | 20 20 64 72 69 76 65 72 | | driver|
|00003000| 50 74 72 20 3d 20 28 2a | 2a 44 43 45 48 29 2e 64 |Ptr = (*|*DCEH).d|
|00003010| 43 74 6c 44 72 69 76 65 | 72 3b 20 2f 2a 20 52 4f |CtlDrive|r; /* RO|
|00003020| 4d 20 28 70 6f 69 6e 74 | 65 72 29 20 62 61 73 65 |M (point|er) base|
|00003030| 64 20 2a 2f 0d 20 20 20 | 20 20 20 20 20 20 20 20 |d */. | |
|00003040| 20 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 69 66 | . | if|
|00003050| 20 28 64 72 69 76 65 72 | 50 74 72 20 21 3d 20 6e | (driver|Ptr != n|
|00003060| 69 6c 29 20 20 0d 20 20 | 20 20 20 20 20 20 20 20 |il) . | |
|00003070| 20 20 20 20 20 20 73 20 | 3d 20 64 72 69 76 65 72 | s |= driver|
|00003080| 50 74 72 20 2b 20 64 72 | 76 72 4e 61 6d 65 3b 0d |Ptr + dr|vrName;.|
|00003090| 20 20 20 20 20 20 20 20 | 7d 0d 20 20 20 20 7d 20 | |}. } |
|000030a0| 77 68 69 6c 65 20 28 21 | 45 71 75 61 6c 53 74 72 |while (!|EqualStr|
|000030b0| 69 6e 67 28 73 2c 64 72 | 69 76 65 72 4e 61 6d 65 |ing(s,dr|iverName|
|000030c0| 2c 30 2c 30 29 20 26 26 | 20 28 64 52 65 66 20 21 |,0,0) &&| (dRef !|
|000030d0| 3d 20 6e 65 67 43 6f 75 | 6e 74 29 29 3b 0d 20 20 |= negCou|nt));. |
|000030e0| 20 20 2f 2a 4c 6f 6f 70 | 20 75 6e 74 69 6c 20 77 | /*Loop| until w|
|000030f0| 65 20 66 69 6e 64 20 69 | 74 20 6f 72 20 77 65 27 |e find i|t or we'|
|00003100| 76 65 20 6a 75 73 74 20 | 6c 6f 6f 6b 65 64 20 61 |ve just |looked a|
|00003110| 74 20 74 68 65 20 6c 61 | 73 74 20 73 6c 6f 74 2e |t the la|st slot.|
|00003120| 2a 2f 0d 20 20 20 20 20 | 20 20 20 0d 20 20 20 20 |*/. | . |
|00003130| 69 66 20 28 45 71 75 61 | 6c 53 74 72 69 6e 67 28 |if (Equa|lString(|
|00003140| 73 2c 64 72 69 76 65 72 | 4e 61 6d 65 2c 30 2c 30 |s,driver|Name,0,0|
|00003150| 29 29 20 20 7b 0d 20 20 | 20 20 20 20 20 20 72 65 |)) {. | re|
|00003160| 74 75 72 6e 20 64 52 65 | 66 3b 0d 09 7d 0d 20 20 |turn dRe|f;..}. |
|00003170| 20 20 65 6c 73 65 0d 20 | 20 20 20 20 20 20 20 72 | else. | r|
|00003180| 65 74 75 72 6e 20 30 3b | 20 2f 2a 63 61 6e 27 74 |eturn 0;| /*can't|
|00003190| 20 66 69 6e 64 20 64 72 | 69 76 65 72 2a 2f 0d 7d | find dr|iver*/.}|
|000031a0| 2f 2a 20 47 65 74 44 72 | 76 72 52 65 66 4e 75 6d |/* GetDr|vrRefNum|
|000031b0| 20 2a 2f 0d 0d 2f 2a 20 | 46 69 6e 64 41 53 6c 6f | */../* |FindASlo|
|000031c0| 74 20 66 69 6e 64 73 20 | 61 6e 20 65 6d 70 74 79 |t finds |an empty|
|000031d0| 20 73 6c 6f 74 20 69 6e | 20 74 68 65 20 75 6e 69 | slot in| the uni|
|000031e0| 74 20 74 61 62 6c 65 20 | 3e 3d 20 34 38 2c 20 65 |t table |>= 48, e|
|000031f0| 78 70 61 6e 64 69 6e 67 | 20 74 68 65 20 75 6e 69 |xpanding| the uni|
|00003200| 74 20 74 61 62 6c 65 20 | 61 73 20 6e 65 65 64 65 |t table |as neede|
|00003210| 64 2e 20 2a 2f 0d 2f 2a | 20 49 6d 70 6c 65 6d 65 |d. */./*| Impleme|
|00003220| 6e 74 65 64 20 61 73 20 | 73 75 67 67 65 73 74 65 |nted as |suggeste|
|00003230| 64 20 69 6e 20 44 72 61 | 66 74 20 54 65 63 68 6e |d in Dra|ft Techn|
|00003240| 6f 74 65 20 22 46 69 6e | 64 69 6e 67 20 61 20 73 |ote "Fin|ding a s|
|00003250| 6c 6f 74 20 66 6f 72 20 | 61 20 64 72 69 76 65 72 |lot for |a driver|
|00003260| 22 20 62 79 20 4d 61 72 | 6b 20 42 65 6e 6e 65 74 |" by Mar|k Bennet|
|00003270| 2e 20 2a 2f 0d 2f 2a 20 | 4e 65 77 50 74 72 53 79 |. */./* |NewPtrSy|
|00003280| 73 43 6c 65 61 72 28 29 | 20 69 73 20 61 6e 20 4d |sClear()| is an M|
|00003290| 50 57 20 63 61 6c 6c 20 | 77 68 69 63 68 20 63 61 |PW call |which ca|
|000032a0| 6c 6c 73 20 4e 65 77 50 | 74 72 20 77 69 74 68 20 |lls NewP|tr with |
|000032b0| 74 68 65 20 53 79 73 74 | 65 6d 48 65 61 70 20 61 |the Syst|emHeap a|
|000032c0| 6e 64 20 43 6c 65 61 72 | 20 66 6c 61 67 73 0d 09 |nd Clear| flags..|
|000032d0| 20 73 65 74 20 73 6f 20 | 74 68 61 74 20 74 68 65 | set so |that the|
|000032e0| 20 6e 65 77 20 70 6f 69 | 6e 74 65 72 20 69 73 20 | new poi|nter is |
|000032f0| 61 6c 6c 6f 63 61 74 65 | 64 20 69 6e 20 74 68 65 |allocate|d in the|
|00003300| 20 73 79 73 74 65 6d 20 | 68 65 61 70 20 61 6e 64 | system |heap and|
|00003310| 20 74 68 65 6e 20 63 6c | 65 61 72 65 64 20 74 6f | then cl|eared to|
|00003320| 20 7a 65 72 6f 65 73 2e | 0d 09 20 49 66 20 69 74 | zeroes.|.. If it|
|00003330| 20 69 73 20 6e 6f 74 20 | 64 65 66 69 6e 65 64 20 | is not |defined |
|00003340| 69 6e 20 79 6f 75 72 20 | 64 65 76 65 6c 6f 70 6d |in your |developm|
|00003350| 65 6e 74 20 73 79 73 74 | 65 6d 2c 20 49 20 62 65 |ent syst|em, I be|
|00003360| 6c 69 65 76 65 20 79 6f | 75 20 63 61 6e 20 64 65 |lieve yo|u can de|
|00003370| 66 69 6e 65 20 69 74 20 | 69 6e 6c 69 6e 65 20 61 |fine it |inline a|
|00003380| 73 3a 0d 09 20 70 61 73 | 63 61 6c 20 50 74 72 20 |s:.. pas|cal Ptr |
|00003390| 4e 65 77 50 74 72 53 79 | 73 43 6c 65 61 72 28 6c |NewPtrSy|sClear(l|
|000033a0| 6f 6e 67 20 73 69 7a 65 | 29 0d 09 20 09 3d 20 30 |ong size|).. .= 0|
|000033b0| 78 32 30 31 46 2c 20 30 | 78 41 37 31 45 2c 20 30 |x201F, 0|xA71E, 0|
|000033c0| 78 33 31 43 30 2c 20 30 | 78 30 32 32 30 2c 20 30 |x31C0, 0|x0220, 0|
|000033d0| 78 32 45 38 38 3b 20 20 | 20 20 2a 2f 0d 70 61 73 |x2E88; | */.pas|
|000033e0| 63 61 6c 20 73 68 6f 72 | 74 20 46 69 6e 64 41 53 |cal shor|t FindAS|
|000033f0| 6c 6f 74 28 76 6f 69 64 | 29 0d 7b 0d 09 48 61 6e |lot(void|).{..Han|
|00003400| 64 6c 65 20 2a 74 68 65 | 55 54 61 62 6c 65 3b 09 |dle *the|UTable;.|
|00003410| 20 09 2f 2a 20 70 6f 69 | 6e 74 65 72 20 74 6f 20 | ./* poi|nter to |
|00003420| 74 68 65 20 75 6e 69 74 | 20 74 61 62 6c 65 20 2a |the unit| table *|
|00003430| 2f 0d 09 48 61 6e 64 6c | 65 20 2a 6e 65 77 54 61 |/..Handl|e *newTa|
|00003440| 62 6c 65 3b 09 09 09 2f | 2a 20 70 6f 69 6e 74 65 |ble;.../|* pointe|
|00003450| 72 20 74 6f 20 65 78 70 | 61 6e 64 65 64 20 75 6e |r to exp|anded un|
|00003460| 69 74 20 74 61 62 6c 65 | 20 2a 2f 0d 09 48 61 6e |it table| */..Han|
|00003470| 64 6c 65 20 2a 2a 55 54 | 61 62 6c 65 42 61 73 65 |dle **UT|ableBase|
|00003480| 3b 09 2f 2a 20 70 6f 69 | 6e 74 65 72 20 74 6f 20 |;./* poi|nter to |
|00003490| 6c 6f 77 20 6d 65 6d 20 | 67 6c 6f 62 61 6c 20 55 |low mem |global U|
|000034a0| 54 61 62 6c 65 42 61 73 | 65 20 28 77 68 69 63 68 |TableBas|e (which|
|000034b0| 20 68 61 73 20 68 61 6e | 64 6c 65 20 74 6f 20 55 | has han|dle to U|
|000034c0| 54 61 62 6c 65 29 20 2a | 2f 0d 09 73 68 6f 72 74 |Table) *|/..short|
|000034d0| 20 2a 55 6e 69 74 4e 74 | 72 79 43 6e 74 3b 09 09 | *UnitNt|ryCnt;..|
|000034e0| 2f 2a 20 70 6f 69 6e 74 | 65 72 20 74 6f 20 6c 6f |/* point|er to lo|
|000034f0| 77 20 6d 65 6d 20 67 6c | 6f 62 61 6c 20 55 6e 69 |w mem gl|obal Uni|
|00003500| 74 4e 54 72 79 43 6e 74 | 20 28 77 68 69 63 68 20 |tNTryCnt| (which |
|00003510| 68 61 73 20 73 69 7a 65 | 20 6f 66 20 55 54 61 62 |has size| of UTab|
|00003520| 6c 65 29 20 2a 2f 0d 09 | 73 68 6f 72 74 20 74 68 |le) */..|short th|
|00003530| 65 53 6c 6f 74 2c 20 74 | 61 62 6c 65 53 69 7a 65 |eSlot, t|ableSize|
|00003540| 2c 20 6e 65 77 54 61 62 | 6c 65 53 69 7a 65 3b 0d |, newTab|leSize;.|
|00003550| 09 0d 09 0d 09 55 6e 69 | 74 4e 74 72 79 43 6e 74 |.....Uni|tNtryCnt|
|00003560| 20 3d 20 28 73 68 6f 72 | 74 20 2a 29 28 55 6e 69 | = (shor|t *)(Uni|
|00003570| 74 4e 74 72 79 43 6e 74 | 41 64 64 72 29 3b 0d 09 |tNtryCnt|Addr);..|
|00003580| 74 61 62 6c 65 53 69 7a | 65 20 3d 20 2a 55 6e 69 |tableSiz|e = *Uni|
|00003590| 74 4e 74 72 79 43 6e 74 | 3b 09 09 2f 2a 20 47 65 |tNtryCnt|;../* Ge|
|000035a0| 74 20 74 68 65 20 73 69 | 7a 65 20 6f 66 20 74 68 |t the si|ze of th|
|000035b0| 65 20 63 75 72 72 65 6e | 74 20 55 6e 69 74 20 74 |e curren|t Unit t|
|000035c0| 61 62 6c 65 20 2a 2f 0d | 09 55 54 61 62 6c 65 42 |able */.|.UTableB|
|000035d0| 61 73 65 20 3d 20 28 48 | 61 6e 64 6c 65 20 2a 2a |ase = (H|andle **|
|000035e0| 29 28 55 54 61 62 6c 65 | 42 61 73 65 41 64 64 72 |)(UTable|BaseAddr|
|000035f0| 29 3b 0d 09 74 68 65 55 | 54 61 62 6c 65 20 3d 20 |);..theU|Table = |
|00003600| 2a 55 54 61 62 6c 65 42 | 61 73 65 3b 20 20 09 2f |*UTableB|ase; ./|
|00003610| 2a 20 47 65 74 20 74 68 | 65 20 70 6f 69 6e 74 65 |* Get th|e pointe|
|00003620| 72 20 74 6f 20 74 68 65 | 20 63 75 72 72 65 6e 74 |r to the| current|
|00003630| 20 55 6e 69 74 20 74 61 | 62 6c 65 20 2a 2f 0d 09 | Unit ta|ble */..|
|00003640| 0d 09 09 2f 2a 20 41 70 | 70 6c 65 20 73 75 67 67 |.../* Ap|ple sugg|
|00003650| 65 73 74 73 20 74 68 61 | 74 20 69 66 20 74 68 65 |ests tha|t if the|
|00003660| 20 74 61 62 6c 65 20 73 | 69 7a 65 20 69 73 20 34 | table s|ize is 4|
|00003670| 38 2c 20 79 6f 75 20 65 | 78 70 61 6e 64 20 69 74 |8, you e|xpand it|
|00003680| 20 74 6f 20 36 34 2e 20 | 20 49 20 64 6f 6e 27 74 | to 64. | I don't|
|00003690| 20 6b 6e 6f 77 20 77 68 | 79 0d 09 20 09 74 68 65 | know wh|y.. .the|
|000036a0| 79 20 64 6f 6e 27 74 20 | 73 69 6d 70 6c 79 20 73 |y don't |simply s|
|000036b0| 75 67 67 65 73 74 20 74 | 68 61 74 20 69 66 20 69 |uggest t|hat if i|
|000036c0| 74 20 69 73 20 6c 65 73 | 73 20 74 68 61 6e 20 36 |t is les|s than 6|
|000036d0| 34 2c 20 79 6f 75 20 65 | 78 70 61 6e 64 20 69 74 |4, you e|xpand it|
|000036e0| 20 74 6f 20 36 34 2c 20 | 62 75 74 20 74 68 65 79 | to 64, |but they|
|000036f0| 0d 09 09 64 6f 6e 27 74 | 2c 20 73 6f 20 77 65 20 |...don't|, so we |
|00003700| 64 6f 6e 27 74 2e 20 20 | 49 74 20 73 65 65 6d 73 |don't. |It seems|
|00003710| 20 77 65 69 72 64 20 74 | 6f 20 6d 65 2c 20 74 68 | weird t|o me, th|
|00003720| 6f 75 67 68 2e 20 20 2a | 2f 0d 09 69 66 20 28 74 |ough. *|/..if (t|
|00003730| 61 62 6c 65 53 69 7a 65 | 20 3c 3d 20 34 38 29 20 |ableSize| <= 48) |
|00003740| 7b 0d 09 09 09 2f 2a 20 | 45 78 70 61 6e 64 20 74 |{..../* |Expand t|
|00003750| 68 65 20 74 61 62 6c 65 | 2e 20 20 53 69 6e 63 65 |he table|. Since|
|00003760| 20 74 68 69 73 20 72 6f | 75 74 69 6e 65 20 6d 69 | this ro|utine mi|
|00003770| 67 68 74 20 62 65 20 69 | 6e 74 65 72 72 75 70 74 |ght be i|nterrupt|
|00003780| 65 64 2c 20 61 6e 64 20 | 74 68 65 20 55 6e 69 74 |ed, and |the Unit|
|00003790| 20 74 61 62 6c 65 20 6d | 69 67 68 74 0d 09 09 09 | table m|ight....|
|000037a0| 62 65 20 63 6f 6e 73 75 | 6c 74 65 64 20 64 75 72 |be consu|lted dur|
|000037b0| 69 6e 67 20 74 68 65 20 | 69 6e 74 65 72 72 75 70 |ing the |interrup|
|000037c0| 74 2c 20 77 65 20 68 61 | 76 65 20 74 6f 20 62 65 |t, we ha|ve to be|
|000037d0| 20 63 61 72 65 66 75 6c | 20 77 69 74 68 20 74 68 | careful| with th|
|000037e0| 65 20 6f 72 64 65 72 20 | 6f 66 20 6f 70 65 72 61 |e order |of opera|
|000037f0| 74 69 6f 6e 73 0d 09 09 | 09 73 6f 20 74 68 61 74 |tions...|.so that|
|00003800| 20 77 65 20 6e 65 76 65 | 72 20 68 61 76 65 20 61 | we neve|r have a|
|00003810| 6e 20 69 6e 63 6f 6e 73 | 69 73 74 65 6e 74 20 55 |n incons|istent U|
|00003820| 6e 69 74 20 74 61 62 6c | 65 20 69 6e 73 74 61 6c |nit tabl|e instal|
|00003830| 6c 65 64 20 2a 2f 0d 09 | 09 09 20 0d 09 09 09 2f |led */..|.. ..../|
|00003840| 2a 20 41 6c 6c 6f 63 61 | 74 65 20 61 20 6e 65 77 |* Alloca|te a new|
|00003850| 20 74 61 62 6c 65 2c 20 | 61 6e 64 20 63 6c 65 61 | table, |and clea|
|00003860| 72 20 74 68 65 20 6e 65 | 77 20 65 6e 74 72 69 65 |r the ne|w entrie|
|00003870| 73 20 2a 2f 0d 09 09 69 | 66 20 28 28 6e 65 77 54 |s */...i|f ((newT|
|00003880| 61 62 6c 65 20 3d 20 28 | 48 61 6e 64 6c 65 20 2a |able = (|Handle *|
|00003890| 29 20 4e 65 77 50 74 72 | 53 79 73 43 6c 65 61 72 |) NewPtr|SysClear|
|000038a0| 28 28 53 69 7a 65 29 20 | 36 34 2a 34 29 29 20 3d |((Size) |64*4)) =|
|000038b0| 3d 20 4e 69 6c 29 0d 09 | 09 09 72 65 74 75 72 6e |= Nil)..|..return|
|000038c0| 20 4d 65 6d 45 72 72 6f | 72 28 29 3b 0d 09 09 0d | MemErro|r();....|
|000038d0| 09 09 2f 2a 20 43 6f 70 | 79 20 74 68 65 20 6f 6c |../* Cop|y the ol|
|000038e0| 64 20 74 61 62 6c 65 20 | 74 6f 20 74 68 65 20 6e |d table |to the n|
|000038f0| 65 77 20 74 61 62 6c 65 | 20 2a 2f 0d 09 09 42 6c |ew table| */...Bl|
|00003900| 6f 63 6b 4d 6f 76 65 28 | 28 50 74 72 29 20 74 68 |ockMove(|(Ptr) th|
|00003910| 65 55 54 61 62 6c 65 2c | 20 28 50 74 72 29 20 6e |eUTable,| (Ptr) n|
|00003920| 65 77 54 61 62 6c 65 2c | 20 74 61 62 6c 65 53 69 |ewTable,| tableSi|
|00003930| 7a 65 2a 34 29 3b 0d 09 | 09 0d 09 09 09 2f 2a 20 |ze*4);..|...../* |
|00003940| 57 65 20 6e 6f 77 20 68 | 61 76 65 20 32 20 63 6f |We now h|ave 2 co|
|00003950| 6e 73 69 73 74 65 6e 74 | 20 55 6e 69 74 20 74 61 |nsistent| Unit ta|
|00003960| 62 6c 65 73 2c 20 74 68 | 65 20 6f 6c 64 20 6f 6e |bles, th|e old on|
|00003970| 65 20 61 6e 64 20 74 68 | 65 20 6e 65 77 20 6f 6e |e and th|e new on|
|00003980| 65 2c 20 73 6f 20 69 74 | 20 64 6f 65 73 6e 27 74 |e, so it| doesn't|
|00003990| 0d 09 09 09 6d 61 74 74 | 65 72 20 77 68 69 63 68 |....matt|er which|
|000039a0| 20 6f 6e 65 20 69 73 20 | 69 6e 73 74 61 6c 6c 65 | one is |installe|
|000039b0| 64 2e 20 20 53 74 69 6c | 6c 2c 20 77 65 20 68 61 |d. Stil|l, we ha|
|000039c0| 76 65 20 74 6f 20 69 6e | 73 74 61 6c 6c 20 74 68 |ve to in|stall th|
|000039d0| 65 20 6e 65 77 20 6f 6e | 65 20 62 65 66 6f 72 65 |e new on|e before|
|000039e0| 20 77 65 20 63 68 61 6e | 67 65 0d 09 09 09 74 68 | we chan|ge....th|
|000039f0| 65 20 74 61 62 6c 65 20 | 73 69 7a 65 2c 20 6f 74 |e table |size, ot|
|00003a00| 68 65 72 77 69 73 65 20 | 73 6f 6d 65 6f 6e 65 20 |herwise |someone |
|00003a10| 63 6f 75 6c 64 20 73 65 | 61 72 63 68 20 70 61 73 |could se|arch pas|
|00003a20| 74 20 74 68 65 20 65 6e | 64 20 6f 66 20 74 68 65 |t the en|d of the|
|00003a30| 20 69 6e 73 74 61 6c 6c | 65 64 20 28 6f 6c 64 29 | install|ed (old)|
|00003a40| 0d 09 09 09 74 61 62 6c | 65 20 64 75 72 69 6e 67 |....tabl|e during|
|00003a50| 20 61 20 76 65 72 79 20 | 77 65 6c 6c 20 70 6c 61 | a very |well pla|
|00003a60| 63 65 64 20 69 6e 74 65 | 72 72 75 70 74 20 2a 2f |ced inte|rrupt */|
|00003a70| 0d 09 09 2a 55 54 61 62 | 6c 65 42 61 73 65 20 3d |...*UTab|leBase =|
|00003a80| 20 6e 65 77 54 61 62 6c | 65 3b 0d 09 09 2a 55 6e | newTabl|e;...*Un|
|00003a90| 69 74 4e 74 72 79 43 6e | 74 20 3d 20 36 34 3b 0d |itNtryCn|t = 64;.|
|00003aa0| 09 09 0d 09 09 09 2f 2a | 20 57 65 20 68 61 76 65 |....../*| We have|
|00003ab0| 20 6e 6f 77 20 66 75 6c | 6c 79 20 72 65 70 6c 61 | now ful|ly repla|
|00003ac0| 63 65 64 20 74 68 65 20 | 75 6e 69 74 20 74 61 62 |ced the |unit tab|
|00003ad0| 6c 65 2c 20 73 6f 20 77 | 65 20 63 61 6e 20 67 65 |le, so w|e can ge|
|00003ae0| 74 20 72 69 64 20 6f 66 | 20 74 68 65 20 6f 6c 64 |t rid of| the old|
|00003af0| 20 6f 6e 65 2e 20 2a 2f | 0d 09 09 44 69 73 70 6f | one. */|...Dispo|
|00003b00| 73 50 74 72 28 28 50 74 | 72 29 20 74 68 65 55 54 |sPtr((Pt|r) theUT|
|00003b10| 61 62 6c 65 29 3b 0d 09 | 09 0d 09 09 09 2f 2a 20 |able);..|...../* |
|00003b20| 53 69 6e 63 65 20 74 68 | 65 20 55 6e 69 74 20 74 |Since th|e Unit t|
|00003b30| 61 62 6c 65 27 73 20 22 | 73 6c 6f 74 73 22 20 61 |able's "|slots" a|
|00003b40| 72 65 20 6e 75 6d 62 65 | 72 65 64 20 66 72 6f 6d |re numbe|red from|
|00003b50| 20 7a 65 72 6f 2c 20 74 | 68 65 20 6f 6c 64 20 74 | zero, t|he old t|
|00003b60| 61 62 6c 65 20 73 69 7a | 65 20 69 73 20 74 68 65 |able siz|e is the|
|00003b70| 0d 09 09 09 6e 75 6d 62 | 65 72 20 6f 66 20 74 68 |....numb|er of th|
|00003b80| 65 20 66 69 72 73 74 20 | 61 64 64 65 64 20 28 61 |e first |added (a|
|00003b90| 6e 64 20 67 75 61 72 61 | 6e 74 65 65 64 20 65 6d |nd guara|nteed em|
|00003ba0| 70 74 79 29 20 73 6c 6f | 74 2c 20 73 6f 20 74 68 |pty) slo|t, so th|
|00003bb0| 61 74 27 73 20 77 68 61 | 74 20 77 65 20 72 65 74 |at's wha|t we ret|
|00003bc0| 75 72 6e 20 2a 2f 0d 09 | 09 72 65 74 75 72 6e 20 |urn */..|.return |
|00003bd0| 74 61 62 6c 65 53 69 7a | 65 3b 0d 09 7d 3b 20 20 |tableSiz|e;..}; |
|00003be0| 0d 09 0d 09 09 2f 2a 20 | 53 65 61 72 63 68 20 74 |...../* |Search t|
|00003bf0| 68 65 20 74 61 62 6c 65 | 20 66 6f 72 20 65 6d 70 |he table| for emp|
|00003c00| 74 79 20 73 6c 6f 74 73 | 20 3e 3d 20 34 38 20 2a |ty slots| >= 48 *|
|00003c10| 2f 0d 09 66 6f 72 20 28 | 74 68 65 53 6c 6f 74 20 |/..for (|theSlot |
|00003c20| 3d 20 34 38 3b 20 74 68 | 65 53 6c 6f 74 20 3c 20 |= 48; th|eSlot < |
|00003c30| 74 61 62 6c 65 53 69 7a | 65 3b 20 74 68 65 53 6c |tableSiz|e; theSl|
|00003c40| 6f 74 2b 2b 29 0d 09 09 | 69 66 20 28 74 68 65 55 |ot++)...|if (theU|
|00003c50| 54 61 62 6c 65 5b 74 68 | 65 53 6c 6f 74 5d 20 3d |Table[th|eSlot] =|
|00003c60| 3d 20 4e 69 6c 29 20 20 | 2f 2a 20 66 6f 75 6e 64 |= Nil) |/* found|
|00003c70| 20 61 6e 20 65 6d 70 74 | 79 20 73 6c 6f 74 20 2a | an empt|y slot *|
|00003c80| 2f 0d 09 09 09 72 65 74 | 75 72 6e 20 74 68 65 53 |/....ret|urn theS|
|00003c90| 6c 6f 74 3b 0d 09 0d 09 | 09 2f 2a 20 54 68 65 20 |lot;....|./* The |
|00003ca0| 55 6e 69 74 20 74 61 62 | 6c 65 20 69 73 20 66 75 |Unit tab|le is fu|
|00003cb0| 6c 6c 2e 20 48 6f 77 65 | 76 65 72 2c 20 74 68 65 |ll. Howe|ver, the|
|00003cc0| 20 6e 75 6d 62 65 72 20 | 69 6e 20 55 6e 69 74 4e | number |in UnitN|
|00003cd0| 54 72 79 43 6e 74 20 6d | 61 79 20 6e 6f 74 20 72 |TryCnt m|ay not r|
|00003ce0| 65 66 6c 65 63 74 20 74 | 68 65 20 61 63 74 75 61 |eflect t|he actua|
|00003cf0| 6c 0d 09 09 73 69 7a 65 | 20 6f 66 20 74 68 65 20 |l...size| of the |
|00003d00| 68 61 6e 64 6c 65 20 68 | 6f 6c 64 69 6e 67 20 74 |handle h|olding t|
|00003d10| 68 65 20 75 6e 69 74 20 | 74 61 62 6c 65 2c 20 73 |he unit |table, s|
|00003d20| 6f 20 6c 65 74 73 20 66 | 69 72 73 74 20 63 68 65 |o lets f|irst che|
|00003d30| 63 6b 20 74 6f 20 73 65 | 65 20 69 66 20 74 68 65 |ck to se|e if the|
|00003d40| 72 65 20 69 73 20 61 6e | 79 0d 09 09 75 6e 6c 61 |re is an|y...unla|
|00003d50| 69 6d 65 64 20 73 70 61 | 63 65 20 69 6e 20 74 68 |imed spa|ce in th|
|00003d60| 65 20 74 61 62 6c 65 20 | 2a 2f 0d 09 6e 65 77 54 |e table |*/..newT|
|00003d70| 61 62 6c 65 53 69 7a 65 | 20 3d 20 47 65 74 50 74 |ableSize| = GetPt|
|00003d80| 72 53 69 7a 65 28 28 50 | 74 72 29 20 74 68 65 55 |rSize((P|tr) theU|
|00003d90| 54 61 62 6c 65 29 20 3e | 3e 20 32 3b 20 20 2f 2a |Table) >|> 2; /*|
|00003da0| 20 73 69 7a 65 20 6f 66 | 20 68 61 6e 64 6c 65 20 | size of| handle |
|00003db0| 69 6e 20 6c 6f 6e 67 77 | 6f 72 64 73 20 2a 2f 0d |in longw|ords */.|
|00003dc0| 09 69 66 20 28 6e 65 77 | 54 61 62 6c 65 53 69 7a |.if (new|TableSiz|
|00003dd0| 65 20 3e 20 74 61 62 6c | 65 53 69 7a 65 29 20 7b |e > tabl|eSize) {|
|00003de0| 20 20 2f 2a 20 48 61 6e | 64 6c 65 20 69 73 20 62 | /* Han|dle is b|
|00003df0| 69 67 20 65 6e 6f 75 67 | 68 20 74 6f 20 68 6f 6c |ig enoug|h to hol|
|00003e00| 64 20 6d 6f 72 65 20 65 | 6e 74 72 69 65 73 20 2a |d more e|ntries *|
|00003e10| 2f 0d 09 09 69 66 20 28 | 28 74 61 62 6c 65 53 69 |/...if (|(tableSi|
|00003e20| 7a 65 20 2b 20 34 29 20 | 3c 20 6e 65 77 54 61 62 |ze + 4) |< newTab|
|00003e30| 6c 65 53 69 7a 65 29 20 | 2f 2a 20 4b 65 65 70 20 |leSize) |/* Keep |
|00003e40| 74 68 65 20 74 61 62 6c | 65 20 73 6d 61 6c 6c 3a |the tabl|e small:|
|00003e50| 20 64 6f 6e 27 74 20 61 | 64 64 20 6d 6f 72 65 20 | don't a|dd more |
|00003e60| 74 68 61 6e 20 34 20 65 | 6e 74 72 69 65 73 20 2a |than 4 e|ntries *|
|00003e70| 2f 0d 09 09 09 6e 65 77 | 54 61 62 6c 65 53 69 7a |/....new|TableSiz|
|00003e80| 65 20 3d 20 74 61 62 6c | 65 53 69 7a 65 20 2b 20 |e = tabl|eSize + |
|00003e90| 34 3b 0d 09 09 66 6f 72 | 20 28 74 68 65 53 6c 6f |4;...for| (theSlo|
|00003ea0| 74 20 3d 20 74 61 62 6c | 65 53 69 7a 65 3b 20 74 |t = tabl|eSize; t|
|00003eb0| 68 65 53 6c 6f 74 20 3c | 20 6e 65 77 54 61 62 6c |heSlot <| newTabl|
|00003ec0| 65 53 69 7a 65 3b 20 74 | 68 65 53 6c 6f 74 2b 2b |eSize; t|heSlot++|
|00003ed0| 29 20 2f 2a 20 43 6c 65 | 61 72 20 74 68 65 20 6e |) /* Cle|ar the n|
|00003ee0| 65 77 20 65 6e 74 72 69 | 65 73 20 2a 2f 0d 09 09 |ew entri|es */...|
|00003ef0| 09 74 68 65 55 54 61 62 | 6c 65 5b 74 68 65 53 6c |.theUTab|le[theSl|
|00003f00| 6f 74 5d 20 3d 20 6e 69 | 6c 3b 0d 09 09 2a 55 6e |ot] = ni|l;...*Un|
|00003f10| 69 74 4e 74 72 79 43 6e | 74 20 3d 20 6e 65 77 54 |itNtryCn|t = newT|
|00003f20| 61 62 6c 65 53 69 7a 65 | 3b 20 2f 2a 20 55 70 64 |ableSize|; /* Upd|
|00003f30| 61 74 65 20 74 68 65 20 | 6c 6f 67 69 63 61 6c 20 |ate the |logical |
|00003f40| 74 61 62 6c 65 20 73 69 | 7a 65 20 2a 2f 0d 09 09 |table si|ze */...|
|00003f50| 72 65 74 75 72 6e 20 74 | 61 62 6c 65 53 69 7a 65 |return t|ableSize|
|00003f60| 3b 20 20 2f 2a 20 46 69 | 72 73 74 20 65 6d 70 74 |; /* Fi|rst empt|
|00003f70| 79 20 73 6c 6f 74 20 69 | 73 20 66 69 72 73 74 20 |y slot i|s first |
|00003f80| 6e 65 77 6c 79 20 61 64 | 64 65 64 20 73 6c 6f 74 |newly ad|ded slot|
|00003f90| 20 2a 2f 0d 09 7d 3b 0d | 09 0d 09 20 2f 2a 20 4e | */..};.|... /* N|
|00003fa0| 6f 20 6d 6f 72 65 20 72 | 6f 6f 6d 20 69 6e 20 74 |o more r|oom in t|
|00003fb0| 68 65 20 68 61 6e 64 6c | 65 2c 20 65 78 70 61 6e |he handl|e, expan|
|00003fc0| 64 20 74 68 65 20 75 6e | 69 74 20 74 61 62 6c 65 |d the un|it table|
|00003fd0| 20 61 73 20 61 62 6f 76 | 65 20 66 6f 72 20 74 61 | as abov|e for ta|
|00003fe0| 62 6c 65 53 69 7a 65 20 | 3c 3d 20 34 38 20 2a 2f |bleSize |<= 48 */|
|00003ff0| 0d 09 6e 65 77 54 61 62 | 6c 65 53 69 7a 65 20 3d |..newTab|leSize =|
|00004000| 20 74 61 62 6c 65 53 69 | 7a 65 20 2b 20 34 3b 20 | tableSi|ze + 4; |
|00004010| 20 2f 2a 20 61 64 64 20 | 34 20 65 6e 74 72 69 65 | /* add |4 entrie|
|00004020| 73 2c 20 70 65 72 20 74 | 65 63 68 6e 6f 74 65 20 |s, per t|echnote |
|00004030| 2a 2f 0d 09 69 66 20 28 | 28 6e 65 77 54 61 62 6c |*/..if (|(newTabl|
|00004040| 65 20 3d 20 28 48 61 6e | 64 6c 65 20 2a 29 20 4e |e = (Han|dle *) N|
|00004050| 65 77 50 74 72 53 79 73 | 43 6c 65 61 72 28 28 53 |ewPtrSys|Clear((S|
|00004060| 69 7a 65 29 20 6e 65 77 | 54 61 62 6c 65 53 69 7a |ize) new|TableSiz|
|00004070| 65 2a 34 29 29 20 3d 3d | 20 30 29 0d 09 09 72 65 |e*4)) ==| 0)...re|
|00004080| 74 75 72 6e 20 4d 65 6d | 45 72 72 6f 72 28 29 3b |turn Mem|Error();|
|00004090| 0d 09 0d 09 42 6c 6f 63 | 6b 4d 6f 76 65 28 28 50 |....Bloc|kMove((P|
|000040a0| 74 72 29 20 74 68 65 55 | 54 61 62 6c 65 2c 20 28 |tr) theU|Table, (|
|000040b0| 50 74 72 29 20 6e 65 77 | 54 61 62 6c 65 2c 20 74 |Ptr) new|Table, t|
|000040c0| 61 62 6c 65 53 69 7a 65 | 2a 34 29 3b 0d 09 2a 55 |ableSize|*4);..*U|
|000040d0| 54 61 62 6c 65 42 61 73 | 65 20 3d 20 6e 65 77 54 |TableBas|e = newT|
|000040e0| 61 62 6c 65 3b 0d 09 2a | 55 6e 69 74 4e 74 72 79 |able;..*|UnitNtry|
|000040f0| 43 6e 74 20 3d 20 6e 65 | 77 54 61 62 6c 65 53 69 |Cnt = ne|wTableSi|
|00004100| 7a 65 3b 0d 09 44 69 73 | 70 6f 73 50 74 72 28 28 |ze;..Dis|posPtr((|
|00004110| 50 74 72 29 20 74 68 65 | 55 54 61 62 6c 65 29 3b |Ptr) the|UTable);|
|00004120| 0d 09 72 65 74 75 72 6e | 20 74 61 62 6c 65 53 69 |..return| tableSi|
|00004130| 7a 65 3b 0d 7d 0d 0d 00 | 00 00 00 00 00 00 00 00 |ze;.}...|........|
|00004140| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004180| 00 00 01 00 00 00 01 4c | 00 00 00 4c 00 00 00 32 |.......L|...L...2|
|00004190| 00 00 0b 0a 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000041a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000041b0| 15 52 65 67 69 73 74 65 | 72 4d 79 53 69 67 6e 61 |.Registe|rMySigna|
|000041c0| 74 75 72 65 2e 63 02 00 | 00 00 54 45 58 54 4d 50 |ture.c..|..TEXTMP|
|000041d0| 00 00 54 45 58 54 4d 50 | 53 20 01 00 01 f8 00 00 |..TEXTMP|S ......|
|000041e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000041f0| 00 00 a2 ec cd 4d 00 00 | 40 b7 00 00 01 7e 00 00 |.....M..|@....~..|
|00004200| 00 00 00 00 00 00 00 00 | 00 00 03 d1 25 00 00 00 |........|....%...|
|00004210| 0b 0a 15 33 38 78 20 64 | 65 73 69 67 6e 20 72 65 |...38x d|esign re|
|00004220| 76 69 65 77 20 64 6f 63 | 00 00 00 00 00 00 00 00 |view doc|........|
|00004230| 00 00 00 00 04 2a 25 00 | 00 00 0b 0a 1d 33 38 78 |.....*%.|.....38x|
|00004240| 20 64 65 73 69 67 6e 20 | 72 65 76 69 65 77 20 64 | design |review d|
|00004250| 6f 63 20 6f 75 74 6c 69 | 6e 65 00 00 00 00 03 dd |oc outli|ne......|
|00004260| 25 00 00 00 0b 0a 15 33 | 38 78 20 4d 55 49 20 4c |%......3|8x MUI L|
|00004270| 65 63 74 75 72 65 20 4e | 6f 74 65 73 00 00 00 00 |ecture N|otes....|
|00004280| 00 00 00 48 00 09 46 72 | 65 64 00 14 00 01 a4 ec |...H..Fr|ed......|
|00004290| 00 0a 00 00 00 00 00 00 | 00 00 2a 55 00 00 00 14 |........|..*U....|
|000042a0| 00 01 d0 04 00 0a 00 06 | 00 02 00 a5 02 84 03 c4 |........|........|
|000042b0| 04 a5 00 bb 00 14 01 d0 | 02 2d a3 19 70 de 00 00 |........|.-..p...|
|000042c0| 00 00 00 00 00 00 00 00 | 00 00 01 00 00 00 01 00 |........|........|
|000042d0| 00 00 01 4c 00 00 00 4c | 00 00 00 32 00 49 b2 00 |...L...L|...2.I..|
|000042e0| 0b 64 00 00 00 1c 00 32 | 00 00 4d 50 53 52 00 00 |.d.....2|..MPSR..|
|000042f0| 00 0a 03 ed ff ff 00 00 | 00 00 00 4b b1 44 00 00 |........|...K.D..|
+--------+-------------------------+-------------------------+--------+--------+