diff options
author | Christian Beier <dontmind@freeshell.org> | 2017-02-21 19:07:15 +0100 |
---|---|---|
committer | Christian Beier <dontmind@freeshell.org> | 2017-02-21 19:07:15 +0100 |
commit | 5935c1be4fd77d3304e0666ba6e3e87aa70d8050 (patch) | |
tree | 218902fd5ffc8eafb4248a20a084ed9c79c5bf62 | |
parent | dbf5f9d51476eb513e26559e78fc524a267504d7 (diff) | |
download | libtdevnc-5935c1be4fd77d3304e0666ba6e3e87aa70d8050.tar.gz libtdevnc-5935c1be4fd77d3304e0666ba6e3e87aa70d8050.zip |
Add an rfbLogPError that shows something on WIN32
-rw-r--r-- | libvncserver/main.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libvncserver/main.c b/libvncserver/main.c index dbda77d..27b5437 100644 --- a/libvncserver/main.c +++ b/libvncserver/main.c @@ -261,7 +261,16 @@ rfbLogProc rfbErr=rfbDefaultLog; void rfbLogPerror(const char *str) { +#ifdef WIN32 + wchar_t *s = NULL; + FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, errno, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPWSTR)&s, 0, NULL); + rfbErr("%s: %S\n", str, s); + LocalFree(s); +#else rfbErr("%s: %s\n", str, strerror(errno)); +#endif } void rfbScheduleCopyRegion(rfbScreenInfoPtr rfbScreen,sraRegionPtr copyRegion,int dx,int dy) |