Mail Archives: djgpp-workers/1999/06/01/02:28:38
On Mon, 31 May 1999, Mark E. wrote:
> From experimentation, it seems the no-inherit bit is stored with the
> file mode instead of the device info word.
It works for me both ways (see the test programs in my other mail).
That is, both the device info word at offset 5 in the SFT and the file
mode. I think the reason that you don't find the no-inherit bit at
offset 5 is because you access it as a byte, not as a word:
> unsigned char sft_entry[64];
[snip]
> printf("Testing device info byte for no-inherit flag... ");
> if (sft_entry[5] & (1<<12))
> printf("found!\n");
You need to cast sft_entry[5] to a short, like this:
if (*(unsigned short *)&sft_entry[5] & (1<<12))
Also note that using `open' with the O_NOINHERIT bit will currently
only work on LFN platforms, since the non-LFN code of `_open' calls
function 3Dh which doesn't support that bit. I used a modified
version of `_open' that calls function 6Ch on non-LFN systems to test
this (also included with test programs in my other mail).
> I'd be interested to know if this is also true with Win NT.
It seems to work, at least as far as the no-inherit bit is concerned, but
only in the device info word at offset 5. Tested on NT v4.00SP3.
- Raw text -