From afb28f903908b85cfef996690cdc6920323f3dcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Strohh=C3=A4cker?= Date: Sun, 2 Mar 2008 19:45:41 +0000 Subject: [PATCH] fix some oddities with get/set file attribute calls (fixes almost nothing!) Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3115 --- src/dos/dos.cpp | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/dos/dos.cpp b/src/dos/dos.cpp index 726c4037..e3134a5b 100644 --- a/src/dos/dos.cpp +++ b/src/dos/dos.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2007 The DOSBox Team + * Copyright (C) 2002-2008 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos.cpp,v 1.107 2007-12-06 17:44:19 qbix79 Exp $ */ +/* $Id: dos.cpp,v 1.108 2008-03-02 19:45:41 c2woody Exp $ */ #include #include @@ -582,17 +582,22 @@ static Bitu DOS_21Handler(void) { MEM_StrCopy(SegPhys(ds)+reg_dx,name1,DOSNAMEBUF); switch (reg_al) { case 0x00: /* Get */ - if (DOS_GetFileAttr(name1,®_cx)) { - reg_ax=reg_cx; /* Undocumented */ - CALLBACK_SCF(false); - } else { - CALLBACK_SCF(true); - reg_ax=dos.errorcode; - } - break; + { + Bit16u attr_val=reg_cx; + if (DOS_GetFileAttr(name1,&attr_val)) { + reg_cx=attr_val; + reg_ax=attr_val; /* Undocumented */ + CALLBACK_SCF(false); + } else { + CALLBACK_SCF(true); + reg_ax=dos.errorcode; + } + break; + }; case 0x01: /* Set */ LOG(LOG_MISC,LOG_ERROR)("DOS:Set File Attributes for %s not supported",name1); if (DOS_SetFileAttr(name1,reg_cx)) { + reg_ax=0x202; /* ax destroyed */ CALLBACK_SCF(false); } else { CALLBACK_SCF(true);