#150 closing a duplicated filehandle invalidates all handles

0.58
closed
Ulf Wohlers
6
2012-09-07
2003-08-08
No

When you duplicate a file handle (for example with int
0x21, ah = 0x45), and then close either the old or the
new handle with DOS_CloseFile, the underlying DOS_File
will get closed, even though there is still a valid
filehandle pointing to it.

(as discussed on IRC on 8 August)

Discussion

  • Peter Veenstra
    Peter Veenstra
    2003-08-09

    Logged In: YES
    user_id=535630

    Assigned to Finsterr as he seems to make more changes in
    this code.

     
  • Ulf Wohlers
    Ulf Wohlers
    2003-08-11

    Logged In: YES
    user_id=585207

    What operations do i have to perform in IDA to get this
    wrong behaviour ? IDA seems to work fine here (it doesnt
    call the duplicate handle function). I'm using IDA v3.05 (16
    Bit).

     
  • Logged In: YES
    user_id=23042

    this happens in IDA 4.15. You don't have to do anything
    special to make it happen; just start ida and open a file.

    The next problem with running IDA is somewhat related: IDA
    seems to open "con" about 15 times, and tries to close most
    of them. Dosbox refuses to close device file handles,
    though, so the entire psp is quickly filled up with 'con'
    devices, leaving no room for real files.

    Maybe (some of?) the psp entries for devices should be
    closable after all, as long as one remains?

     
  • Logged In: YES
    user_id=23042

    Today's CVS changes ("dont duplicate console handles") seem
    to have fixed IDA not opening a database properly.