This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: shared_info::init_obcaseinsensitive implemented incorrectly

On Feb 21 10:26, Nick Lowe wrote:
> I have just tested this and it works. It is faster, simpler and has
> less overheads than querying the registry for a potentially stale
> value.
> Just call NtOpenSymbolicLinkObject for \SYSTEMROOT with a
> DesiredAccess of 0 and no attributes flags in the OBJECT_ATTRIBUTES
> structure.
> This will fail with STATUS_ACCESS_DENIED if the system is running with
> case insensitivity and STATUS_OBJECT_NAME_NOT_FOUND if running with
> case sensitivity.
> For correctness, on the off chance that a successful NTSTATUS value is

That's not an off-chance.  It works for all admin accounts.

> returned, the system is running with case insensitivity and the handle
> must be closed.

Just call NtOpenDirectoryObject on \\SYSTEMROOT, rather than
NtOpenSymbolicLinkObject.  NtOpenDirectoryObject will never succeed,
rather it returns STATUS_OBJECT_TYPE_MISMATCH on a case insensitive
system and STATUS_OBJECT_NAME_NOT_FOUND on a case sensitive system.

And then there's Windows 2000 which is always case sensitive.  But I
documented to require the registry key for least surprise, see

I'm going to add this to the Cygwin DLL, but right now I have to
debug another problem.


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

Problem reports:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]