Go to the previous, next section.
struct Window *getConWindowPtr(BPTR fh)
{
struct Window *w;
struct FileHandle *cfh;
struct StandardPacket *sp;
struct InfoData *id;
struct MsgPort *mp;
w = NULL;
if((cfh = BADDR(fh))->fh_Type != NULL)
{
if(sp = AllocMem(sizeof(struct StandardPacket),
MEMF_PUBLIC | MEMF_CLEAR))
{
if(id = AllocMem(sizeof(struct InfoData),
MEMF_PUBLIC | MEMF_CLEAR))
{
if(mp = CreatePort(NULL, 0))
{
sp->sp_Msg.mn_Node.ln_Name = (char *)&sp->sp_Pkt;
sp->sp_Pkt.dp_Link = &sp->sp_Msg;
sp->sp_Pkt.dp_Port = mp;
sp->sp_Pkt.dp_Type = ACTION_DISK_INFO;
sp->sp_Pkt.dp_Arg1 = MKBADDR(id);
PutMsg(cfh->fh_Type, &sp->sp_Msg);
(void)WaitPort(mp);
(void)GetMsg(mp);
if(sp->sp_Pkt.dp_Res1)
w = (struct Window *)id->id_VolumeNode;
DeletePort(mp);
}
FreeMem(id, sizeof(struct InfoData));
}
FreeMem(sp, sizeof(struct StandardPacket));
}
}
return w;
}
Anmerkungen:
Weitere Informationen finden Sie auf den Seiten 273, 276, 435, 463, 485 und 629 im "Amiga Guru Book" (see section Was ist die beste Dokumentation für Programmierer?).
Ralph Babel, rbabel@babylon.pfm-mainz.de
Go to the previous, next section.