在Mac 64位上獲取默認音量的方法是什麼?如何在Mac OS X 64位上獲取默認音量?
我有一個這樣的代碼:
GetVolParmsInfoBuffer buf_64 = { 0 }; status = FSGetVolumeParms(vol_ref, // use default volume &buf_64, // write req_count);
的問題是,我不能在vol_ref傳遞0。在32位Mac我可以寫:提前
GetVolParmsInfoBuffer buf_32 = { 0 }; HParamBlockRec pb; pb.ioParam.ioCompletion = NULL; // not doing async I/O pb.ioParam.ioNamePtr = NULL; // we don't use path name pb.ioParam.ioVRefNum = 0; // use default volume pb.ioParam.ioBuffer = reinterpret_cast(&buf_32); // write data here pb.ioParam.ioReqCount = req_count; OSErr err = PBHGetVolParmsSync(&pb); ASSERT_EQ(err, noErr);
感謝,
- 奧萊克西
「默認音量」是什麼意思?你打算怎麼處理它? – 2010-08-31 14:00:30