1
0
Fork 0

added support for the don't inheritance flag and changed the psp routines to use this flag

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@980
This commit is contained in:
Peter Veenstra 2003-05-02 10:54:31 +00:00
parent 672415fcb9
commit 100f13016e
4 changed files with 22 additions and 7 deletions

View file

@ -666,7 +666,7 @@ static Bitu DOS_21Handler(void) {
reg_al=dos.verify?1:0;
break;
case 0x55: /* Create Child PSP*/
DOS_NewPSP(reg_dx,reg_si);
DOS_ChildPSP(reg_dx,reg_si);
dos.psp = reg_dx;
break;
case 0x56: /* RENAME Rename file */

View file

@ -156,12 +156,26 @@ Bit16u DOS_PSP::FindEntryByHandle(Bit8u handle)
return 0xFF;
};
void DOS_PSP::CopyFileTable(DOS_PSP* srcpsp)
void DOS_PSP::CopyFileTable(DOS_PSP* srcpsp,bool createchildpsp)
{
/* Copy file table from calling process */
for (Bit16u i=0;i<20;i++) {
Bit8u handle = srcpsp->GetFileHandle(i);
SetFileHandle(i,handle);
if(createchildpsp)
{ //copy obeying not inherit flag.
if(Files[handle] && !(Files[handle]->flags & DOS_NOT_INHERIT))
{
SetFileHandle(i,handle);
}
else
{
SetFileHandle(i,0xff);
}
}
else
{ //normal copy so don't mind the inheritance
SetFileHandle(i,handle);
}
}
};