diff options
Diffstat (limited to 'v4.0/src/INC/DPB.C')
| -rw-r--r-- | v4.0/src/INC/DPB.C | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/v4.0/src/INC/DPB.C b/v4.0/src/INC/DPB.C new file mode 100644 index 0000000..e6ce8b9 --- /dev/null +++ b/v4.0/src/INC/DPB.C | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | /* dpb.c - retrieve DPB for physical drive */ | ||
| 2 | |||
| 3 | #include "types.h" | ||
| 4 | #include "sysvar.h" | ||
| 5 | #include "dpb.h" | ||
| 6 | #include "cds.h" | ||
| 7 | |||
| 8 | extern char NoMem[], ParmNum[], BadParm[] ; | ||
| 9 | extern struct sysVarsType SysVars ; | ||
| 10 | |||
| 11 | |||
| 12 | /* Walk the DPB list trying to find the appropriate DPB */ | ||
| 13 | |||
| 14 | long GetDPB(i) | ||
| 15 | int i ; | ||
| 16 | { | ||
| 17 | struct DPBType DPB ; | ||
| 18 | struct DPBType *pd = &DPB ; | ||
| 19 | struct DPBType far *dptr ; | ||
| 20 | int j ; | ||
| 21 | |||
| 22 | *(long *)(&dptr) = DPB.nextDPB = SysVars.pDPB ; | ||
| 23 | DPB.drive = -1 ; | ||
| 24 | |||
| 25 | while (DPB.drive != i) { | ||
| 26 | if ((int)DPB.nextDPB == -1) | ||
| 27 | return -1L ; | ||
| 28 | |||
| 29 | *(long *)(&dptr) = DPB.nextDPB ; | ||
| 30 | |||
| 31 | for (j=0 ; j < sizeof(DPB) ; j++) | ||
| 32 | *((char *)pd+j) = *((char far *)dptr+j) ; | ||
| 33 | |||
| 34 | } ; | ||
| 35 | return (long)dptr ; | ||
| 36 | } | ||
| 37 | |||
| 38 | \ No newline at end of file | ||