2 /* #include "types.h" */
9 extern struct sysVarsType SysVars ;
11 char fGetCDS(i, pLCDS)
13 struct CDSType *pLCDS ;
15 struct CDSType far *cptr ;
17 /* Get pointer to CDS */
18 if (i >= 0 && i < SysVars.cCDS) {
19 *(long *)(&cptr) = SysVars.pCDS + (i * sizeof(*pLCDS)) ;
21 /* Copy CDS to our program */
22 for (j=0 ; j < sizeof(*pLCDS) ; j++)
23 *((char *)pLCDS+j) = *((char far *)cptr+j) ;
33 char fPutCDS(i, pLCDS)
35 struct CDSType *pLCDS ;
37 struct CDSType far *cptr ;
40 if (i >= 0 && i < SysVars.cCDS) {
41 *(long *)(&cptr) = SysVars.pCDS + (i * sizeof(*pLCDS)) ;
43 for (j=0 ; j < sizeof(*pLCDS) ; j++)
44 *((char far *)cptr+j) = *((char *)pLCDS+j) ;
51 /* returns TRUE if drive i is a physical drive. Physical means that logical
52 * drive n corresponds with physical drive n. This is the case ONLY if the
53 * CDS is inuse and the DPB corresponding to the CDS has the physical drive
54 * equal to the original drive.
61 struct DPBType *pd = &DPB ;
62 struct DPBType far *dptr ;
67 if (!fGetCDS(i, &CDS))
70 if (TESTFLAG(CDS.flags,CDSNET | CDSSPLICE | CDSLOCAL))
73 *(long *)(&dptr) = CDS.pDPB ;
75 for (j=0 ; j < sizeof(DPB) ; j++)
76 *((char *)pd+j) = *((char far *)dptr+j) ;
78 return(i == DPB.drive) ;
81 /* return TRUE if the specified drive is a network drive. i is a 0-based
85 /* MODIFICATION HISTORY
87 * M000 June 5/85 Barrys
88 * Removed extra net check.
95 register union REGS *iregs = &ir ; /* Used for DOS calls */
99 if (!fGetCDS(i, &CDS))
102 iregs->x.ax = IOCTL9 ; /* Function 0x4409 */
103 iregs->x.bx = i + 1 ;
104 intdos(iregs, iregs) ;
107 return(TESTFLAG(CDS.flags,CDSNET) || TESTFLAG(iregs->x.dx,0x1000)) ;
109 return(TESTFLAG(CDS.flags,CDSNET)) ;
113 /* return TRUE if the specified drive is a shared drive. i is a 0-based
121 register union REGS *iregs = &ir ; /* Used for DOS calls */
123 if (!fGetCDS(i, &CDS))
126 iregs->x.ax = IOCTL9 ; /* Function 0x4409 */
127 iregs->x.bx = i + 1 ;
128 intdos(iregs, iregs) ;
130 return TESTFLAG(CDS.flags,CDSNET) || TESTFLAG(iregs->x.dx,0x0200) ;