merge from dev kernel, Jason Hood's patch for extended DPBs and Set Extended Error function

git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1120 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
Kenneth J Davis 2005-03-06 16:58:33 +00:00
parent e501067d7b
commit c41380e578
3 changed files with 37 additions and 6 deletions

View File

@ -1978,6 +1978,16 @@ COUNT dos_setfattr(BYTE * name, UWORD attrp)
#endif
#ifdef WITHFAT32
VOID dpb16to32(struct dpb FAR *dpbp)
{
dpbp->dpb_xflags = 0;
dpbp->dpb_xfsinfosec = 0xffff;
dpbp->dpb_xbackupsec = 0xffff;
dpbp->dpb_xrootclst = 0;
dpbp->dpb_xdata = dpbp->dpb_data;
dpbp->dpb_xsize = dpbp->dpb_size;
}
VOID bpb_to_dpb(bpb FAR * bpbp, REG struct dpb FAR * dpbp, BOOL extended)
#else
VOID bpb_to_dpb(bpb FAR * bpbp, REG struct dpb FAR * dpbp)
@ -2037,12 +2047,7 @@ ckok:;
dpbp->dpb_xcluster = UNKNCLUSTER;
dpbp->dpb_xnfreeclst = XUNKNCLSTFREE; /* number of free clusters */
dpbp->dpb_xflags = 0;
dpbp->dpb_xfsinfosec = 0xffff;
dpbp->dpb_xbackupsec = 0xffff;
dpbp->dpb_xrootclst = 0;
dpbp->dpb_xdata = dpbp->dpb_data;
dpbp->dpb_xsize = dpbp->dpb_size;
dpb16to32(dpbp);
if (ISFAT32(dpbp))
{

View File

@ -200,6 +200,17 @@ int int21_fat32(lregs *r)
fmemcpy(&xddp->xdd_dpb, dpb, sizeof(struct dpb));
xddp->xdd_dpbsize = sizeof(struct dpb);
/* if it doesn't look like an extended DPB, fill in those fields */
if (!ISFAT32(dpb) && dpb->dpb_xsize != dpb->dpb_size)
{
xddp->xdd_dpb.dpb_nfreeclst_un.dpb_nfreeclst_st.dpb_nfreeclst_hi =
(dpb->dpb_nfreeclst == 0xFFFF ? 0xFFFF : 0);
dpb16to32(&xddp->xdd_dpb);
xddp->xdd_dpb.dpb_xfatsize = dpb->dpb_fatsize;
xddp->xdd_dpb.dpb_xcluster = (dpb->dpb_cluster == 0xFFFF ?
0xFFFFFFFFuL : dpb->dpb_cluster);
}
break;
}
/* Get extended free drive space */
@ -1215,6 +1226,20 @@ dispatch:
goto error_exit;
break;
/* Set Extended Error */
case 0x0a:
{
lregs er;
fmemcpy(&er, FP_DS_DX, sizeof(er));
CritErrCode = er.AX;
CritErrDev = MK_FP(er.ES, er.DI);
CritErrLocus = er.CH;
CritErrClass = er.BH;
CritErrAction = er.BL;
CLEAR_CARRY_FLAG();
break;
}
default:
CritErrCode = SUCCESS;
goto error_invalid;

View File

@ -173,6 +173,7 @@ COUNT dos_write(COUNT fd, const VOID FAR * buffer, UCOUNT count);
LONG dos_lseek(COUNT fd, LONG foffset, COUNT origin);
CLUSTER dos_free(struct dpb FAR * dpbp);
BOOL dir_exists(char * path);
VOID dpb16to32(struct dpb FAR *dpbp);
VOID trim_path(BYTE FAR * s);