|
PBXGetVolInfo
Glue (30-July-98)
Q What is the glue for calling
PBXGetVolInfoSync
and PBXGetVolInfoAsync
?
A Here is the glue that you need:
#if GENERATINGCFM #include <Traps.h> #include <FSM.h> // kFSMXGetVolInfo was not introduced until Universal Interfaces 3.0.1. #if UNIVERSAL_INTERFACES_VERSION < 0x0301 enum { kFSMXGetVolInfo = 0x0012 }; #endif // Define the ProcInfoType value for the PBXGetVolInfo routines. enum { uppXGetVolInfoProcInfo = kRegisterBased | RESULT_SIZE(SIZE_CODE(sizeof(OSErr))) | REGISTER_RESULT_LOCATION(kRegisterD0) | REGISTER_ROUTINE_PARAMETER(1, kRegisterD0, kFourByteCode) | REGISTER_ROUTINE_PARAMETER(2, kRegisterD1, kFourByteCode) | REGISTER_ROUTINE_PARAMETER(3, kRegisterA0, SIZE_CODE(sizeof(XVolumeParamPtr))) }; // Glue for the sync routine. extern pascal OSErr PBXGetVolInfoSync(XVolumeParamPtr paramBlock) { return CallOSTrapUniversalProc(GetOSTrapAddress(_FSDispatch), uppXGetVolInfoProcInfo, kFSMXGetVolInfo, // selector in D0 _FSDispatch, // trap word in D1 paramBlock // paramBlock in A0 ); } // Glue for the async routine. extern pascal OSErr PBXGetVolInfoAsync(XVolumeParamPtr paramBlock) { return CallOSTrapUniversalProc(GetOSTrapAddress(_FSDispatch), uppXGetVolInfoProcInfo, kFSMXGetVolInfo, // selector in D0 _FSDispatch | kAsyncMask, // trap word in D1 paramBlock // paramBlock in A0 ); } #endif
IMPORTANT: You can recognize the incorrect glue by looking at the
This For more information on how to build glue for calling classic 68K code from CFM, including OS traps like |
-- Mark Cookson
-- Revised by Quinn "The Eskimo!"
Worldwide Developer Technical Support
Technical Q&As
Previous Question |
Contents | Next
Question
To contact us, please use the Contact
Us page.