Win32HandleToDosFileHandle / DosFileHandleToWin32Handle

Derek Fawcus dfawcus at cisco.com
Sat Jan 28 09:01:22 CST 2006


On Sat, Jan 28, 2006 at 10:52:26AM +0100, Eric Pouech wrote:
> > I suppose one could do something in the VDM process to mark the file
> > handles as having multiple references,  and then do proper open / close
> > handling.  But that would require a valid JFT anyway.
> yes, what's currently missing is the JFT layer... one can consider that 
> the Win32HandleToDosHandle (and its friends) to handle the SFT, and 
> allow to bridge between the DOS world and the Win32 world.

What I'm suggesting is that as soon as there is a JFT,  and we have to
store a reference count outside the JFT,  then the place we store it
is an equivalent to the SFT.

> > So th JFT gives a way to update a reference count in the SFT.
> but, you'll have to patch every possible file usage in winedos so that 
> you don't mixup sft indexes and jft indexes...

I know :-(  But the majority of it will be where Win32HandleToDosFileHandle
is called - i.e. the FCB code,  as for a lot of the rest the existing code
using DosFileHandleToWin32Handle _could_ be retained.

> > Another place where I think it'll come in handy is for redirection,
> > where it'll allow for stashing an equivalent of the device info word.
> > I think this'll make some of the console handling a bit better.
> you mean regarding the char / block caps for example?

Yup.  Since it could (also) be used to revector some routines on a per
file type basis - i.e. move the special case code that currently exists
out of the common path.

> not sure we need 
> to store that in the SFT, we can get it back from the win32 handle anyway.

Well with a round trip.  But the 'inherit file handle' bit is one that DOS
stores in the device info word.  We'd really need to store the same bit.
At which point the rest of the word is available for use.

DF



More information about the wine-devel mailing list