X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:content-type:mime-version:subject:from
	:in-reply-to:date:content-transfer-encoding:message-id
	:references:to; q=dns; s=default; b=QnivA1Wco52mpgfuPLCQKyX/RIct
	PmzA/noomK/F7IqnHpWxjVsnHO/X3hByW/Kxxm62xcEBsJhrTpBEGOZvMwkBsX1l
	z8SCbRvOxLeiIvPVTSvRVOloZtxkCk7VjRaO0rcgAPKe0KXBX3A/6LUqbe8c7WPg
	6iR1yc6JspiJ+40=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:content-type:mime-version:subject:from
	:in-reply-to:date:content-transfer-encoding:message-id
	:references:to; s=default; bh=I3NUNw0cT83vFmMIamqV8nybKzw=; b=bQ
	2ycLtx+o491ugrkiFogxaVaUXyoSOVL2d5ZOBiHu4WnqTw5SHgIb1P50oWZBqhLm
	0bFdIyz2uxi1ezfnQLC2AXUeoI8gKEPtJFgdA4W/IT6VioyjoAOR2haOv4WfrE6J
	EVIkCjXoLYgY3pWLJ6qHTODsLBnBB0PgwVDCCVFys=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=1.1 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=no version=3.3.2
X-HELO: etr-usa.com
Content-Type: text/plain; charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\))
Subject: Re: Error accessing mapped drive >2TB?
From: Warren Young <wyml@etr-usa.com>
In-Reply-To: <0F9378A1-6890-42CE-BD19-578167F116AA@etr-usa.com>
Date: Fri, 23 Oct 2015 16:36:33 -0600
Message-Id: <A844F1FA-0AB0-442B-808F-86B09640F6EB@etr-usa.com>
References: <CA+2x6-L_pqdN6PHE0c15hcmrmB66Z75Hz95cH+dbcn4yXuVZNg@mail.gmail.com> <712A87EA-64C7-4033-BE7F-39C8C8D527EB@etr-usa.com> <20151021100328.GL5319@calimero.vinschen.de> <CB8461F5-FB0E-44D8-81BB-B52DD02AD400@etr-usa.com> <20151021162254.GC19868@calimero.vinschen.de> <169BF9F6-FF26-4073-9CC4-786882EFBAE9@etr-usa.com> <20151022083446.GW5319@calimero.vinschen.de> <B8DBF0B5-51A9-4833-92D5-CA9E08B27DEC@etr-usa.com> <20151023092007.GF5319@calimero.vinschen.de> <0F9378A1-6890-42CE-BD19-578167F116AA@etr-usa.com>
To: cygwin@cygwin.com
X-IsSubscribed: yes
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id t9NMal0X002001

On Oct 23, 2015, at 4:04 PM, Warren Young wrote:
> 
> I’ve made the suggested changes to the program, here:
> 
>  http://pastebin.com/uZdDZPgi

By the way, if you look at scream_and_die() and wonder why I’ve badly overcomplicated it, it’s because a previous version presented a printf-like interface to its callers.  In stages, the callers stopped using it that way, and the function itself evolved to where it couldn’t do printf-like things anyway.

This simpler replacement suffices now:

void scream_and_die(const char* complaint)
{
    LPTSTR syserr = 0;
    FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM |
            FORMAT_MESSAGE_ALLOCATE_BUFFER, 0, GetLastError(),
            MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
            (LPTSTR)&syserr, 0, 0);
    fprintf(stderr, "%s: %s (0x%x)\n", complaint, syserr, GetLastError());
    exit(1);
}


--
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


