
FB II Compiler
PG PRO
Debugging
Memory
System
Mathematics
Resources
Disk I/O
Windows
Controls
Menus
Mouse
Keyboard
Text
Fonts
Drawing
Sound
Clipboard
Printing
Communication
ASM
|
DISK I/O
Implement PBXGetVolInfo
From looking at the "Files.p" include file provided by Apple (and using MacsBug to disassemble the hex codes), it looks like the parameter block pointer should be put into register A0 rather than pushed onto the stack, and likewise the result code is taken directly from register D0 rather than being pulled off the stack. Also, PBXGetVolInfo seems to use trap numbers A060 (for sync calls) or A460 (for async calls), rather than A260.
Try this:
LOCAL FN PBXGetVolInfo(pbPtr&, async)
DIM OSErr
LONG IF async
` movea.l ^pbPtr&,a0
` moveq #12,d0
` dc.w $A460
` move.w d0,^OSErr
XELSE
` movea.l ^pbPtr&,a0
` moveq #12,d0
` dc.w $A060
` move.w d0,^OSErr
END IF
END FN = OSErr
LOCAL FN GetVolumeInformation(volumeIndex%)
DIM oserr%,pbPtr&
DIM VolName$
DIM paramBlock.80
pbPtr& = @paramblock
DEF BLOCKFILL(pbPtr&,80,0)
pbPtr&.myioCompletion& = 0
pbPtr&.myioResult% = 0
pbPtr&.myioNamePtr& = @VolName$
pbPtr&.myioVRefNum% = 0
pbPtr&.myioXVersion& = 0
pbPtr&.myioVolIndex% = volumeIndex%
oserr% = FN PBXGetVolInfo(pbPtr&,0)
END FN
|