From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6249 invoked by alias); 21 Feb 2012 10:26:22 -0000 Received: (qmail 6240 invoked by uid 22791); 21 Feb 2012 10:26:21 -0000 X-SWARE-Spam-Status: No, hits=0.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-vx0-f171.google.com (HELO mail-vx0-f171.google.com) (209.85.220.171) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 21 Feb 2012 10:26:06 +0000 Received: by vcbfo11 with SMTP id fo11so5668838vcb.2 for ; Tue, 21 Feb 2012 02:26:05 -0800 (PST) Received-SPF: pass (google.com: domain of nick.lowe@gmail.com designates 10.220.142.80 as permitted sender) client-ip=10.220.142.80; Authentication-Results: mr.google.com; spf=pass (google.com: domain of nick.lowe@gmail.com designates 10.220.142.80 as permitted sender) smtp.mail=nick.lowe@gmail.com; dkim=pass header.i=nick.lowe@gmail.com Received: from mr.google.com ([10.220.142.80]) by 10.220.142.80 with SMTP id p16mr3191628vcu.10.1329819965662 (num_hops = 1); Tue, 21 Feb 2012 02:26:05 -0800 (PST) MIME-Version: 1.0 Received: by 10.220.142.80 with SMTP id p16mr2584551vcu.10.1329819965609; Tue, 21 Feb 2012 02:26:05 -0800 (PST) Received: by 10.220.186.201 with HTTP; Tue, 21 Feb 2012 02:26:05 -0800 (PST) In-Reply-To: References: Date: Tue, 21 Feb 2012 10:26:00 -0000 Message-ID: Subject: Re: shared_info::init_obcaseinsensitive implemented incorrectly From: Nick Lowe To: cygwin@cygwin.com Content-Type: text/plain; charset=ISO-8859-1 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/msg00612.txt.bz2 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 returned, the system is running with case insensitivity and the handle must be closed. Regards, Nick On Tue, Feb 21, 2012 at 9:52 AM, Nick Lowe wrote: > OK, fair enough, it is an edge case... I am a stickler for correctness! :P > > Looking at previous threads though actually, I notice that the > following is documented by Microsoft regarding the obcaseinsensitive > value: > > "If this setting is enabled, case insensitivity is enforced for all > directory objects, symbolic links, and IO objects, including file > objects. Disabling this setting does not allow the Win32 subsystem to > become case sensitive." > > You could just get away with therefore, in theory, a call to > NtOpenSymbolicLinkObject for \SYSTEMROOT. If it fails because it > cannot be found, you know that the system is running with case > sensitivity, otherwise, it is case sensitive. > > Regards, > > Nick -- 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