Category : Files from Magazines
Archive   : ITCMAR91.ZIP
Filename : MCB.C

 
Output of file : MCB.C contained in archive : ITCMAR91.ZIP

/****************************************************************
* MCB.C - Functions to handle DOS' MCB chain *
****************************************************************/

#include /* geninterrupt(), MK_FP() */
#include "mcb.h" /* Definition of the MCB structure */

#undef getNextMCB /* Turn off the getNextMCB() macro */

MCB far *getFirstMCB(void)
{
int i; /* Temporary scratch variable */
int far *p; /* Temporary pointer variable */

_AH=0x52; /* Undocumented DOS call */
geninterrupt(0x21);
i = _ES;
p = MK_FP(i,_BX-2); /* Compute address of first MCB seg */
return MK_FP(*p,0);
}

MCB far *getNextMCB(MCB far *x)
{
return MK_FP(FP_SEG(x)+x->size+1,0);
}