appletfilediskicon.c

Go to the documentation of this file.
00001 
00002 /*  $Id: appletfilediskicon.c 355 2005-01-11 22:48:55Z andreradke $    */
00003 
00004 /* copyright 1991-96 UserLand Software, Inc. All Rights Reserved.*/
00005 
00006 
00007 #include "applet.h"
00008 #include "appletfilesinternal.h"
00009 #include "appletfilediskicon.h"
00010 
00011 
00012 boolean filegetdiskicon (short vnum, Handle *hdiskicon) {
00013 
00014     HParamBlockRec pb;
00015     ParamBlockRec cpb;
00016     OSErr ec;
00017 
00018     clearbytes (&pb, longsizeof (pb));
00019     
00020     pb.volumeParam.ioVRefNum = vnum;
00021     
00022     ec = PBHGetVInfoSync (&pb);
00023     
00024     if (fileerror (nil, ec))
00025         return (false);
00026         
00027     cpb.cntrlParam.ioCRefNum = pb.volumeParam.ioVDRefNum;
00028     
00029     cpb.cntrlParam.ioVRefNum = pb.volumeParam.ioVDrvInfo;
00030 
00031     cpb.cntrlParam.csCode = 22;
00032     
00033     ec = PBControlSync (&cpb);
00034 
00035     if (ec != noErr) {
00036     
00037         cpb.cntrlParam.csCode = 21;
00038         
00039         ec = PBControlSync (&cpb);
00040         }
00041         
00042     if (fileerror (nil, ec))
00043         return (false);
00044 
00045     ec = PtrToHand (*(Ptr*) &cpb.cntrlParam.csParam, hdiskicon, kLargeIconSize);
00046     
00047     return (!fileerror (nil, ec));
00048     } /*filegetdiskicon*/
00049     

Generated on Wed May 31 18:19:41 2006 for frontierkernel 10.1.10a by  doxygen 1.4.6