From: Stefan Weil [mailto:s...@weilnetz.de] Sent: Tuesday, 17 November 2015 23:40 > > +#ifdef DEBUG_TAP_WIN32 > > + LPVOID msgbuf; > > Does this also work ... > > char *msgbuf; > > > > + error = GetLastError(); > > + > FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSA > GE_FROM_SYSTEM, > > + NULL, error, MAKELANGID(LANG_NEUTRAL, > SUBLANG_DEFAULT), > > + (LPTSTR)&msgbuf, 0, NULL); > > ... and remove the type cast here? If it works without compiler > warnings, I'd prefer that variant.
Thanks Stefan. I was able to change the declaration to LPTSTR and avoid the cast, but am reticent about changing it to a bare char *, because the definition of LPTSTR depends on #ifdef UNICODE. I also fixed a lurking bug I had accidentally introduced in the event that WriteFile completes synchronously. Revised patch incoming shortly... Andrew