TweetFollow Us on Twitter

December 94 - KON & BAL'S PUZZLE PAGE

KON & BAL'S PUZZLE PAGE

Processed Cheese

CARY CLARK, BYRON, AND SHELLEY

[IMAGE puzzle.GIF]

KON and BAL still lay claim to the Puzzle Page, and they assure us they'll be back, but meanwhile they'd like to have some guest puzzlers take over for a while. (They say they're busy with work at Catapult Entertainment and Rocket Science, but we all know about those vacations they take!) This puzzle is from Cary Clark, presented in the form of a dialog between his astute pug dogs, Shelley and Byron (who, Cary says, will eat anything, including codecs and Texas Hold'ems). The dialog gives clues to help you. Keep guessing until you're done; your score is the number to the left of the clue that gave you the correct answer. And please, help out KON and BAL by submitting puzzles of your own to AppleLink DEVELOP.

Shelley KON and BAL have gone the way of the dodo bird (or at least the way of the hedgehog), so it's time to replace all of their arcane QuickDraw knowledge with arcane QuickDraw GX knowledge.

Byron I tried to use QuickDraw GX, but since installing it off the 1994 WWDC CD, I can't launch any of my applications.

Shelley Are you sure?

100 Byron Well, the applications launch, but double-clicking a document doesn't do anything, even though the icons look all right.

Shelley The problem is in the desktop database, which the Finder uses to tell which document file types correspond to which applications. Did you try rebuilding your desktop?

90 Byron Sure, but it didn't help.

Shelley How about booting off a different disk?

85 Byron That works, but only for some files. So I removed QuickDraw GX altogether and rebuilt the original desktop by holding down Option-Command at system startup. Then everything worked fine.

Shelley That must mean that one of the files you removed got rid of the problem.

80 Byron Nope, grr. I tried explicitly taking the QuickDraw GX extension out of my Extensions folder and rebooting, and nothing happened, except that my desktop printers went away.

Shelley So how do you like the LQ, anyway?

Byron It's a lot faster than the Qume. But I miss watching it hammer the period to make my LisaDraw pictures.

Shelley So, what else is a part of QuickDraw GX? Let's take a peek in the System Folder. There's the printer drivers, ATM . . .

Byron That's never caused any trouble.

Shelley . . . ColorSync, the new Color Picker, PrinterShare GX. Hmmm, that's odd -- PrinterShare GX's icon is dimmed as if it were an open application, but it doesn't show up in the process menu as PrintMonitor used to.

75 Byron Oh, you dog. That's because PrinterShare's file type is 'appe'. It's a faceless application that's always running in the background.

Shelley I don't remember reading about that in the Processes volume of Inside Macintosh .

Byron That's because dogs can't read. But I've heard it's briefly mentioned in Volume VI on page 9-41. Anyway, that's beside the point. If you type procinfo in MacsBug, you'll get a list that looks like this:

 Displaying Process Information
PSN  Process Name        Size     Free     HeapAt   Type Crtr Status
2000 PowerTalk Manager   00044800 00003AE4 05892960 appe kl02 BgOnly
2002 Finder              00026C00 000012DC 05846E80 FNDR MACS Bkgnd
2003 File Sharing Ext... 00029C00 00005A2A 057A2C60 INIT hhgg BgOnly
2005 Eudora 1.4.2        0005CC60 000154F8 057242E0 APPL CSOm Front
2006 NCSA Telnet 2.6     00088000 0003E0B2 056982D0 APPL NCSA Bkgnd
2007 THINK Project Ma... 003E8000 001E1A68 052AC2C0 APPL KAHL Bkgnd
2008 Find File           00046000 00014F4A 052622B0 APPL fndf Bkgnd
200B Microsoft Word      00200000 000C1D5C 0505E2A0 APPL MSWD Bkgnd
200C PrinterShare GX     0001C000 00011488 0503E290 appe PtSr BgOnly

Shelley OK, try removing PrinterShare GX and rebuilding the desktop.

70 Byron Hey, that fixed it!

Shelley But the question remains, what's wrong with PrinterShare GX? And how did you get into this sorry situation anyway?

65 Byron Well, I ran Norton Utilities on my disk, and it said it was fixing some applications with bad bundle bits.

Shelley So Norton must force the desktop to rebuild in order to register the applications it thought needed to be reregistered with the Finder's desktop database. Bad dog. And the Finder fails when rebuilding the desktop.

Byron Wait a minute. PowerTalk Manager is also an 'appe'. What's different about it?

60 Shelley AOCE requires that PowerTalk Manager always run as a background application, while QuickDraw GX needs PrinterShare GX to run only when a document is printing.

Byron So, how does the system know to run PowerTalk Manager, but not to run PrinterShare GX?

55 Shelley PowerTalk Manager contains a resource of type 'appe', ID = 0. This resource returns true when called as a Pascal function, which tells the Startup Manager to launch it. PrinterShare GX has no such resource.

Byron I bet we could figure this out from the Process Manager source, but barring that, let's use MacsBug to figure out why the Finder fails.

Shelley We can stop on file opens using atb openrf to figure out when the Finder is accessing PrinterShare GX.

Byron But how do you get it to stop only for PrinterShare GX?

Shelley Well, I need to find the filename. I put a break on _Open; then I display the parameter block using dm a0 iopb.

Byron iopb?

Shelley I/O parameter block. It looks like this:

 Displaying IOParamBlockRec at 0008D720
0008D720  qLink            NIL
0008D724  qType            0000 
0008D726  ioTrap           A000 
0008D728  ioCmdAddr        NIL 
0008D72C  ioCompletion     NIL 
0008D730  ioResult         0000 
0008D732  ioNamePtr        0008A8D6 -> "PrinterShare GX"
0008D736  ioVRefNum        FFFF 
0008D738  ioRefNum         0000 
0008D73A  ioVersNum        #0 
0008D73B  ioPermssn        #4 
0008D73C  ioMisc           NIL 
0008D740  ioBuffer         NIL 
0008D744  ioReqCount       00000000 
0008D748  ioActCount       00000000 
0008D74C  ioPosMode        0000 
0008D74E  ioPosOffset      00000000

Byron So the 18th byte into the block can be a pointer to a string; we can dereference that and look for strings that start with 'Prin'.

Shelley You C mutt. You have to think Pascal; the first byte will be the string length, 15, so you want to break when @@(a0+12)=0F507269.

50 Byron By George, this won't work. The file is already open!

Shelley How do you know?

Byron I used the MacsBug file dcmd, and there it is, near the bottom of the list.

Displaying File Control Blocks
fRef File         Vol      Type Fl Fork LEof     Mark    FlNum  Parent FCB at
0002 System       fat      zsys dW rsrc #2303194 #920    008359 007bfe 2fb352
0060              fat      **** dw data #1032192 #0      000003 000000 2fb3b0
00be              fat      **** dw data #3096576 #0      000004 000000 2fb40e
011c Apple Chanc… fat      FFIL dW rsrc #269497  #219985 008220 007c02 2fb46c
017a Chicago      fat      FFIL dW rsrc #48064   #38423  008351 007c02 2fb4ca
. . .
0874 PowerTalk M… fat      appe dW rsrc #507556  #413184 007ca8 007bff 2fbbc4
08d2 PrinterShar… fat      appe dW rsrc #32978   #708    008236 007bff 2fbb22
0930 Finder       fat      FNDR dW rsrc #456553  #362328 00835c 007bfe 2fbc80
098e Finder Pref… fat      pref dW rsrc #19983   #328    007cde 007c95 2fbcde
09ec Desktop DB   fat      BTFL dW data #196608  #150528 000011 000002 2fbd3c
0a4a Desktop DF   fat      DTFL dW data #351810  #101184 000010 000002 2fbd9a
0bc2 QMgrCatalog  fat      BTFL dW data #65536   #1024   007ce5 007ce4 2fbf12
0c20 WSBTree      fat      BTFL dW data #65536   #1024   007ce7 007ce2 2fbf70
131a              Mail En… **** dw data #0       #0      000003 000000 2fc66a
#74 FCBs, #35 in use, #39 free

45 Shelley That could be OK. It depends on whether the Finder is opening a read-only path on the file. We can tell by looking at the parameter block as we did before and seeing what's in the ioPermssn field.

40 Byron As I suspected, it's a 3, meaning the Finder is opening it for reading and writing, when it only needs to read the bundle resource.

35 Shelley Well, not exactly, since it wants to mark the file as initialized, so that next time it won't add the file to the database again.

Byron But isn't that data in the Finder info, which is in neither the data fork nor the resource fork, but just part of the file identifier, like the filename?

30 Shelley Oh, yeah. I know! The standard call OpenResFile always tries for read/write permission. The Finder desktop-building code is old and tired, but I'm sure when they rewrite it they'll correctly use OpenRF instead. In any case, the Finder is getting an error it doesn't expect when opening the file, so it gives up building the desktop database before it has retrieved the bundle information from all of the applications.

25 Byron So one possible fix is to prevent the Startup Manager from opening the file in the first place, since QuickDraw GX doesn't need it to be open all the time.

20 Shelley Or we could cause the file to be opened as read-only by setting its shared bundle bit. There's a more obscure way to solve the problem: if we put the right stuff in the 'appe' resource, the Startup Manager will be instructed to close the file after executing some code.

15 Byron I happen to have a copy of ResEdit right here. It's a little difficult to work with my paws, so give me a minute. Hey -- look at that little man going in and out of the jack- in-the-box. I could watch this all day!

Shelley Cool. It even changes all the colors in the system palette, causing all of the screens to redraw, and then redraw again when you quit. State of the art, man -- I mean, dog.

10 Byron Well, the problem is now obvious. PrinterShare GX is a background application that doesn't need to run all the time, but it doesn't have the shared bit set, and it doesn't have an 'appe' resource. The 'appe' resource is code, and I don't have that nifty ResEdit code editor.

5 Shelley We can use MacsBug to write it for us. All we need are enough instructions to create a Pascal function that returns false. We can cheat by disassembling PtInRect and steal a little code from there. We can verify our code by using the MacsBug command dh to disassemble our hex. I think 422e 0004 4e74 0004 ought to do the trick.

Byron What does that do?

Shelley It causes an illegal instruction error on a 68000 machine. Good thing Apple doesn't sell those anymore.

Byron But I just bought a luggable for a steal at the flea market! What can I do?

Shelley Hit your smushed-faced little head against it. QuickDraw GX runs only on 68020 and better, so this code is just fine.

Byron Arf.

Shelley Grr.

SCORING

  • 80-100 Excellent! You're good enough to write your own puzzles. Heck, you could probably write the whole develop magazine. (While you're at it, try to get some work out of those slackers at Catapult Entertainment and Rocket Science.)
  • 55-75 Pretty good. You could speed up the blits in QuickDraw GX. (When you do, let us know.)
  • 30-50 Not bad. You could make the PostScript driver go fast even without taking it native.
  • 5-25 Try not to hurt yourself with shape operations. *
CARY CLARK, once on the QuickDraw GX engineering team at Apple, has joined BAL at Rocket Science. He's co-owner of Shelley and Byron, who often know more than he does. Cary was working on QuickDraw when BAL made Microsoft Word skanky and KON made GM (not General Magic) what it is today. Next time you see KON, ask him if he wants to cut for a hundred and watch him wince. *

Thanks to Dave Hersey, KON (Konstantin Othmer), and BAL (Bruce Leak) for reviewing this column, and to Ron Voss for tracking the problem down and fixing it in the shipping version of QuickDraw GX. *

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Dropbox 193.4.5594 - Cloud backup and sy...
Dropbox is a file hosting service that provides cloud storage, file synchronization, personal cloud, and client software. It is a modern workspace that allows you to get to all of your files, manage... Read more
Google Chrome 122.0.6261.57 - Modern and...
Google Chrome is a Web browser by Google, created to be a modern platform for Web pages and applications. It utilizes very fast loading of Web pages and has a V8 engine, which is a custom built... Read more
Skype 8.113.0.210 - Voice-over-internet...
Skype is a telecommunications app that provides HD video calls, instant messaging, calling to any phone number or landline, and Skype for Business for productive cooperation on the projects. This... Read more
Tor Browser 13.0.10 - Anonymize Web brow...
Using Tor Browser you can protect yourself against tracking, surveillance, and censorship. Tor was originally designed, implemented, and deployed as a third-generation onion-routing project of the U.... Read more
Deeper 3.0.4 - Enable hidden features in...
Deeper is a personalization utility for macOS which allows you to enable and disable the hidden functions of the Finder, Dock, QuickTime, Safari, iTunes, login window, Spotlight, and many of Apple's... Read more
OnyX 4.5.5 - Maintenance and optimizatio...
OnyX is a multifunction utility that you can use to verify the startup disk and the structure of its system files, to run miscellaneous maintenance and cleaning tasks, to configure parameters in the... Read more
Hopper Disassembler 5.14.1 - Binary disa...
Hopper Disassembler is a binary disassembler, decompiler, and debugger for 32- and 64-bit executables. It will let you disassemble any binary you want, and provide you all the information about its... Read more

Latest Forum Discussions

See All

Zenless Zone Zero opens entries for its...
miHoYo, aka HoYoverse, has become such a big name in mobile gaming that it's hard to believe that arguably their flagship title, Genshin Impact, is only three and a half years old. Now, they continue the road to the next title in their world, with... | Read more »
Live, Playdate, Live! – The TouchArcade...
In this week’s episode of The TouchArcade Show we kick things off by talking about all the games I splurged on during the recent Playdate Catalog one-year anniversary sale, including the new Lucas Pope jam Mars After Midnight. We haven’t played any... | Read more »
TouchArcade Game of the Week: ‘Vroomies’
So here’s a thing: Vroomies from developer Alex Taber aka Unordered Games is the Game of the Week! Except… Vroomies came out an entire month ago. It wasn’t on my radar until this week, which is why I included it in our weekly new games round-up, but... | Read more »
SwitchArcade Round-Up: ‘MLB The Show 24’...
Hello gentle readers, and welcome to the SwitchArcade Round-Up for March 15th, 2024. We’re closing out the week with a bunch of new games, with Sony’s baseball franchise MLB The Show up to bat yet again. There are several other interesting games to... | Read more »
Steam Deck Weekly: WWE 2K24 and Summerho...
Welcome to this week’s edition of the Steam Deck Weekly. The busy season has begun with games we’ve been looking forward to playing including Dragon’s Dogma 2, Horizon Forbidden West Complete Edition, and also console exclusives like Rise of the... | Read more »
Steam Spring Sale 2024 – The 10 Best Ste...
The Steam Spring Sale 2024 began last night, and while it isn’t as big of a deal as say the Steam Winter Sale, you may as well take advantage of it to save money on some games you were planning to buy. I obviously recommend checking out your own... | Read more »
New ‘SaGa Emerald Beyond’ Gameplay Showc...
Last month, Square Enix posted a Let’s Play video featuring SaGa Localization Director Neil Broadley who showcased the worlds, companions, and more from the upcoming and highly-anticipated RPG SaGa Emerald Beyond. | Read more »
Choose Your Side in the Latest ‘Marvel S...
Last month, Marvel Snap (Free) held its very first “imbalance" event in honor of Valentine’s Day. For a limited time, certain well-known couples were given special boosts when conditions were right. It must have gone over well, because we’ve got a... | Read more »
Warframe welcomes the arrival of a new s...
As a Warframe player one of the best things about it launching on iOS, despite it being arguably the best way to play the game if you have a controller, is that I can now be paid to talk about it. To whit, we are gearing up to receive the first... | Read more »
Apple Arcade Weekly Round-Up: Updates an...
Following the new releases earlier in the month and April 2024’s games being revealed by Apple, this week has seen some notable game updates and events go live for Apple Arcade. What The Golf? has an April Fool’s Day celebration event going live “... | Read more »

Price Scanner via MacPrices.net

Apple Education is offering $100 discounts on...
If you’re a student, teacher, or staff member at any educational institution, you can use your .edu email address when ordering at Apple Education to take $100 off the price of a new M3 MacBook Air.... Read more
Apple Watch Ultra 2 with Blood Oxygen feature...
Best Buy is offering Apple Watch Ultra 2 models for $50 off MSRP on their online store this week. Sale prices available for online orders only, in-store prices may vary. Order online, and choose... Read more
New promo at Sams Club: Apple HomePods for $2...
Sams Club has Apple HomePods on sale for $259 through March 31, 2024. Their price is $40 off Apple’s MSRP, and both Space Gray and White colors are available. Sale price is for online orders only, in... Read more
Get Apple’s 2nd generation Apple Pencil for $...
Apple’s Pencil (2nd generation) works with the 12″ iPad Pro (3rd, 4th, 5th, and 6th generation), 11″ iPad Pro (1st, 2nd, 3rd, and 4th generation), iPad Air (4th and 5th generation), and iPad mini (... Read more
10th generation Apple iPads on sale for $100...
Best Buy has Apple’s 10th-generation WiFi iPads back on sale for $100 off MSRP on their online store, starting at only $349. With the discount, Best Buy’s prices are the lowest currently available... Read more
iPad Airs on sale again starting at $449 on B...
Best Buy has 10.9″ M1 WiFi iPad Airs on record-low sale prices again for $150 off Apple’s MSRP, starting at $449. Sale prices for online orders only, in-store price may vary. Order online, and choose... Read more
Best Buy is blowing out clearance 13-inch M1...
Best Buy is blowing out clearance Apple 13″ M1 MacBook Airs this weekend for only $649.99, or $350 off Apple’s original MSRP. Sale prices for online orders only, in-store prices may vary. Order... Read more
Low price alert! You can now get a 13-inch M1...
Walmart has, for the first time, begun offering new Apple MacBooks for sale on their online store, albeit clearance previous-generation models. They now have the 13″ M1 MacBook Air (8GB RAM, 256GB... Read more
Best Apple MacBook deal this weekend: Get the...
Apple has 13″ M2 MacBook Airs available for only $849 today in their Certified Refurbished store. These are the cheapest M2-powered MacBooks for sale at Apple. Apple’s one-year warranty is included,... Read more
New 15-inch M3 MacBook Air (Midnight) on sale...
Amazon has the new 15″ M3 MacBook Air (8GB RAM/256GB SSD/Midnight) in stock and on sale today for $1249.99 including free shipping. Their price is $50 off MSRP, and it’s the lowest price currently... Read more

Jobs Board

Early Preschool Teacher - Glenda Drive/ *Appl...
Early Preschool Teacher - Glenda Drive/ Apple ValleyTeacher Share by Email Share on LinkedIn Share on Twitter Read more
Senior Software Engineer - *Apple* Fundamen...
…center of Microsoft's efforts to empower our users to do more. The Apple Fundamentals team focused on defining and improving the end-to-end developer experience in Read more
Relationship Banker *Apple* Valley Main - W...
…Alcohol Policy to learn more. **Company:** WELLS FARGO BANK **Req Number:** R-350696 **Updated:** Mon Mar 11 00:00:00 UTC 2024 **Location:** APPLE VALLEY,California Read more
Medical Assistant - Surgical Oncology- *Apple...
Medical Assistant - Surgical Oncology- Apple Hill WellSpan Medical Group, York, PA | Nursing | Nursing Support | FTE: 1 | Regular | Tracking Code: 200555 Apply Now Read more
Early Preschool Teacher - Glenda Drive/ *Appl...
Early Preschool Teacher - Glenda Drive/ Apple ValleyTeacher Share by Email Share on LinkedIn Share on Twitter Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.