From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14655 invoked by alias); 21 Feb 2012 11:04:53 -0000 Received: (qmail 14559 invoked by uid 22791); 21 Feb 2012 11:04:33 -0000 X-Spam-Check-By: sourceware.org Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.83/v0.83-20-g38e4449) with ESMTP; Tue, 21 Feb 2012 11:04:18 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id CF55C2C006A; Tue, 21 Feb 2012 12:04:15 +0100 (CET) Date: Tue, 21 Feb 2012 11:04:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: shared_info::init_obcaseinsensitive implemented incorrectly Message-ID: <20120221110415.GE22597@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2012-02/txt/msg00614.txt.bz2 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 http://cygwin.com/cygwin-ug-net/using-specialnames.html#pathnames-casesensitive I'm going to add this to the Cygwin DLL, but right now I have to debug another problem. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple