From b50bf0f0e71723d8563c1cabf4c7ae709215159c Mon Sep 17 00:00:00 2001 From: Luchezar Georgiev Date: Thu, 2 Dec 2004 18:03:35 +0000 Subject: [PATCH] Fix bug 1819 by setting FAT32 fields of FAT12/16 DPBs on Int21/7302 git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/branches/UNSTABLE@1068 6ac86273-5f31-0410-b378-82cca8765d1b --- docs/history.txt | 3 +++ kernel/inthndlr.c | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/docs/history.txt b/docs/history.txt index 77a60ba..cb7a934 100644 --- a/docs/history.txt +++ b/docs/history.txt @@ -5,6 +5,8 @@ - bugfix: call_nls: DI register was not preserved * exeflat.c - new version exploiting better UPX compression for SYS files; calls UPX itself + * inthndlr.c + - int21/ah=6/dl=ff now calls int28 + Changes Tom * inthndlr.c - improve handling of case where eg. FindFirst(I:\*.*) fails, causes Int24, @@ -309,6 +311,7 @@ - set AX = ES after Int 21h/4Ah (undocumented but expected by BRUN45) (the last 2 changes needed to fix bugs discovered by Michael Devore) - added Int 2Fh/2Fh processing to set DOS version as per MS-DOS 4.0 + - set FAT32 fields of FAT12/16 DPBs on Int21h/7302h. Fixes bug 1819 * autoexec.bat now single-line for FreeCOM compatibility when EOL=LF * break.c: check_handle_break() return was undefined if no Ctrl-break * config.sys: all commands removed as they were close to defaults diff --git a/kernel/inthndlr.c b/kernel/inthndlr.c index d36f0dd..6a244c1 100644 --- a/kernel/inthndlr.c +++ b/kernel/inthndlr.c @@ -196,6 +196,18 @@ int int21_fat32(lregs *r) xddp = MK_FP(r->ES, r->DI); fmemcpy(&xddp->xdd_dpb, dpb, sizeof(struct dpb)); + if (!ISFAT32(dpb)) + { /* FAT12/16 - set FAT32 fields. This helps DOSLFN 0.33+ */ + xddp->xdd_dpb.dpb_nfreeclst_un.dpb_nfreeclst_st.dpb_nfreeclst_hi = 0; + xddp->xdd_dpb.dpb_xflags = 0; + xddp->xdd_dpb.dpb_xfsinfosec = 0xFFFF; /* unknown */ + xddp->xdd_dpb.dpb_xbackupsec = 0xFFFF; + xddp->xdd_dpb.dpb_xdata = dpb->dpb_data; + xddp->xdd_dpb.dpb_xsize = dpb->dpb_size; + xddp->xdd_dpb.dpb_xfatsize = dpb->dpb_fatsize; + xddp->xdd_dpb.dpb_xrootclst = 0; /* impossible cluster number */ + xddp->xdd_dpb.dpb_xcluster = dpb->dpb_cluster; + } xddp->xdd_dpbsize = sizeof(struct dpb); break; }