Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!lll-winken!unixhub!shelby!msi.umn.edu!cs.umn.edu!quest!digibd!merlyn From: merlyn@digibd.com (Brian Westley (Merlyn LeRoy)) Newsgroups: comp.sys.mac.programmer Subject: Re: DrvrInstall and DrvrRemove (here's the glue) Message-ID: <1990Nov16.202612.3369@digibd.com> Date: 16 Nov 90 20:26:12 GMT References: <1990Nov12.062133.29315@ux1.cso.uiuc.edu> Organization: DigiBoard Incorporated, St. Louis Park, MN Lines: 56 resnick@cogsci.uiuc.edu (Pete Resnick) writes: ... >5. DrvrInstall and DrvrRemove are not in MacTraps in THINK C as far >as I can tell. What do I do with the MPW glue to make this work? Here's what I use (Think C) /* "trap" is used in assembly thus: trap _DrvrInstall */ #define trap dc.w #define _DrvrInstall 0xA03D #define _DrvrRemove 0xA03E /* * Apple routine glue for DrvrInstall */ OSErr DrvrInstall(drvrHandle, refNum) Handle drvrHandle; int refNum; { OSErr result; asm { move.w refNum, d0 ; driver reference number move.l drvrHandle, a0 ; handle to driver move.l (a0), a0 ; pointer to driver trap _DrvrInstall move.w d0, result ; get error } return (result); } /* * Apple routine glue for DrvrRemove */ OSErr DrvrRemove(refNum) int refNum; { OSErr result; asm { move.w refNum, d0 ; driver reference number trap _DrvrRemove move.w d0, result ; get error } return (result); } HTH (hope this helps) --- Merlyn LeRoy