summaryrefslogtreecommitdiff
path: root/v4.0/src/INC/DPB.C
diff options
context:
space:
mode:
authorGravatar Mark Zbikowski2024-04-25 21:24:10 +0100
committerGravatar Microsoft Open Source2024-04-25 22:32:27 +0000
commit2d04cacc5322951f187bb17e017c12920ac8ebe2 (patch)
tree80ee017efa878dfd5344b44249e6a241f2a7f6e2 /v4.0/src/INC/DPB.C
parentMerge pull request #430 from jpbaltazar/typoptbr (diff)
downloadms-dos-main.tar.gz
ms-dos-main.tar.xz
ms-dos-main.zip
MZ is back!HEADmain
Diffstat (limited to 'v4.0/src/INC/DPB.C')
-rw-r--r--v4.0/src/INC/DPB.C38
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
8extern char NoMem[], ParmNum[], BadParm[] ;
9extern struct sysVarsType SysVars ;
10
11
12/* Walk the DPB list trying to find the appropriate DPB */
13
14long GetDPB(i)
15int 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