summaryrefslogtreecommitdiffstats
path: root/libvncserver/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'libvncserver/main.c')
-rw-r--r--libvncserver/main.c9
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)