mirror of https://github.com/AR1972/DOS3.3
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
667 B
37 lines
667 B
/* dpb.c - retrieve DPB for physical drive */
|
|
|
|
#include "types.h"
|
|
#include "sysvar.h"
|
|
#include "dpb.h"
|
|
#include "cds.h"
|
|
|
|
extern char NoMem[], ParmNum[], BadParm[] ;
|
|
extern struct sysVarsType SysVars ;
|
|
|
|
|
|
/* Walk the DPB list trying to find the appropriate DPB */
|
|
|
|
long GetDPB(i)
|
|
int i ;
|
|
{
|
|
struct DPBType DPB ;
|
|
struct DPBType *pd = &DPB ;
|
|
struct DPBType far *dptr ;
|
|
int j ;
|
|
|
|
*(long *)(&dptr) = DPB.nextDPB = SysVars.pDPB ;
|
|
DPB.drive = -1 ;
|
|
|
|
while (DPB.drive != i) {
|
|
if ((int)DPB.nextDPB == -1)
|
|
return -1L ;
|
|
|
|
*(long *)(&dptr) = DPB.nextDPB ;
|
|
|
|
for (j=0 ; j <= sizeof(DPB) ; j++)
|
|
*((char *)pd+j) = *((char far *)dptr+j) ;
|
|
|
|
} ;
|
|
return (long)dptr ;
|
|
}
|
|
|