This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] windows-nat: Decode system error numbers
- From: Eli Zaretskii <eliz at gnu dot org>
- To: "Maciej W. Rozycki" <macro at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 09 Nov 2011 18:42:50 +0200
- Subject: Re: [PATCH] windows-nat: Decode system error numbers
- References: <alpine.DEB.1.10.1111091050490.5099@tp.orcam.me.uk>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Wed, 9 Nov 2011 12:02:40 +0000
> From: "Maciej W. Rozycki" <macro@codesourcery.com>
>
> + const char *msg = "Unspecified error.";
> + unsigned long err;
> + char buf[1025];
> + size_t size;
> +
> + if (ok)
> + return;
> +
> + err = GetLastError();
> + size = FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM
> + | FORMAT_MESSAGE_IGNORE_INSERTS,
> + NULL,
> + err,
> + MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT),
> + buf, (sizeof (buf) - 1) / sizeof (TCHAR), NULL);
Will this DTRT with Cygwin, which AFAIK wants the wide versions of the
APIs? Is, for example, "char buf[1025];" appropriate in that case?