Mail Archives: djgpp/2001/08/10/02:15:08
Charles Sandmann wrote:
>
> > In a nutshell, the LFN-aware functions are not to be trusted on W2K. In
> > particular, handles created by an LFN variant of _open fail some important
> > functions of Int 21h that take a file handle, such as functions 5700h and
> > 5701h, and all subfunctions of function 44h (IOCTL) seem to return zero
> > instead of valid info. The latter problem is the reason why ">/dev/null"
> > doesn't work on W2K.
>
> Eli's mostly correct here, but the actual reason why >/dev/null fails is
> because a write of zero bytes to NUL or CON fails under Windows 2000 if
> the handle was opened with an LFN function but works just fine if opened
> with a standard DOS function.
I think this is a consequence of the more general problem: the LFN API of
W2K doesn't go through the emulation of devices. That's why the same
write-zero-bytes code works on disk files opened with LFN functions, but
fails on devices. For the same reason, findfirst doesn't set the character
device bit in the attribute byte it returns for devices such as NUL.
In other words, write-zero-bytes failure is a symptom; the disease is that
the DOS device driver layer is not properly emulated when LFN functions are
used.
- Raw text -