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: Error accessing mapped drive >2TB?


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


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