double			dFree; long 			lFree;
DrawDiskSpaceMsgs(short vRefNum){	XVolumeParam	pb;	OSErr			err, reserr;	UnsignedWide	freeSpace;	short			msglen = 0;	TEHandle		dsAvailH, dsNeededH;	Rect			instDescBox, viewRect;	Handle			instDescRectH;	Str255			msg;	Str15			kb;	char 			*cstr, *cmsg, *ckb, *cfreeSpace, *cSpaceNeeded;	double			dFree;	long 			lFree;		pb.ioCompletion = NULL;	pb.ioVolIndex = 0;	pb.ioNamePtr = NULL;	pb.ioVRefNum = vRefNum;		ERR_CHECK( PBXGetVolInfoSync(&pb) );	freeSpace = UInt64ToUnsignedWide(pb.ioVFreeBytes);	dFree = (freeSpace.hi * 4294967296) + freeSpace.lo; // 2^32 = 4294967296	lFree = (long) (dFree/1024);    sDSAvailK = lFree;    	instDescRectH = NULL;	instDescRectH = Get1Resource('RECT', rCompListBox);	reserr = ResError();	if (reserr!=noErr || !instDescRectH)	{		ErrorHandler(reserr);		return;	}		HLock(instDescRectH);	instDescBox = (Rect) **((Rect**)instDescRectH);	SetRect( &viewRect, instDescBox.left, instDescBox.bottom + 2, 						instDescBox.right, instDescBox.bottom + 14 );	HUnlock(instDescRectH);		DetachResource(instDescRectH);	DisposeHandle(instDescRectH); 								TextFace(normal);	TextSize(9);	TextFont(applFont);	EraseRect(&viewRect);		dsAvailH = NULL;	dsAvailH = TENew(&viewRect, &viewRect);	if (!dsAvailH)	{		ErrorHandler(eMem);		return;	}		/* Get the "Disk Space Available: " string */	GetResourcedString( msg, rInstList, sDiskSpcAvail );	cstr = PascalToC(msg);	msglen = strlen(cstr);	cmsg = (char*)malloc(msglen+255);	strncpy(cmsg, cstr, msglen);	cmsg[msglen] = '\0';		/* tack on the actual disk space in KB */	cfreeSpace = ltoa(lFree);	msglen += strlen(cfreeSpace);	strcat( cmsg, cfreeSpace );	cmsg[msglen] = '\0';		/* tack on the "kilobyte" string: generally "K" but is rsrc'd */	GetResourcedString( kb, rInstList, sKilobytes );	ckb = PascalToC(kb);	msglen += strlen(ckb);	strcat( cmsg, ckb );	cmsg[msglen] = '\0';		/* draw the disk space available string */	TEInsert( cmsg, strlen(cmsg), dsAvailH );	TEUpdate( &viewRect, dsAvailH );		/* recycle pointers */	if (cstr)		DisposePtr((Ptr)cstr);	if (cmsg)		free(cmsg);	if (ckb)		DisposePtr((Ptr)ckb);		SetRect( &viewRect, instDescBox.right - 150, instDescBox.bottom + 2,						instDescBox.right, instDescBox.bottom + 14 );	dsNeededH = NULL;	dsNeededH = TENew( &viewRect, &viewRect );	if (!dsNeededH)	{		ErrorHandler(eMem);		return;	}		/* Get the "Disk Space Needed: " string */	GetResourcedString( msg, rInstList, sDiskSpcNeeded );	cstr = PascalToC(msg);	msglen = strlen(cstr);	cmsg = (char*)malloc(msglen+255);	strncpy(cmsg, cstr, msglen);	cmsg[msglen] = '\0';		/* tack on space needed in KB */	cSpaceNeeded = DiskSpaceNeeded();	msglen += strlen(cSpaceNeeded);	strcat( cmsg, cSpaceNeeded );	cmsg[msglen] = '\0';		/* tack on the "kilobyte" string: generally "K" but is rsrc'd */	GetResourcedString( kb, rInstList, sKilobytes );	ckb = PascalToC(kb);	msglen += strlen(ckb);	strcat( cmsg, ckb );	cmsg[msglen] = '\0';		/* draw the disk space available string */	TEInsert( cmsg, strlen(cmsg), dsNeededH );	TEUpdate( &viewRect, dsNeededH );		if (dsAvailH)		TEDispose(dsAvailH);	if (dsNeededH)		TEDispose(dsNeededH);		if (ckb)		DisposePtr((Ptr)ckb);	if (cSpaceNeeded)		free(cSpaceNeeded);		// malloc'd, not NewPtrClear'd	if (cfreeSpace)		free(cfreeSpace);	if (cstr)		DisposePtr((Ptr)cstr);	if (cmsg)		free(cmsg);	TextFont(systemFont);	TextSize(12);}