From 0ded5d29cd71ec1d946a606ddc25724c3ac6588e Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Thu, 24 Nov 2011 17:59:24 +0100 Subject: [PATCH] Win: fix improper treatment of real ntstatus codes as mapped win32 errors --- src/win/winsock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/win/winsock.c b/src/win/winsock.c index 5309f1ee..8ed642c2 100644 --- a/src/win/winsock.c +++ b/src/win/winsock.c @@ -206,7 +206,8 @@ int uv_ntstatus_to_winsock_error(NTSTATUS status) { return WSAEACCES; default: - if (status & ((FACILITY_NTWIN32 << 16) | ERROR_SEVERITY_ERROR)) { + if ((status & (FACILITY_NTWIN32 << 16)) == (FACILITY_NTWIN32 << 16) && + (status & (ERROR_SEVERITY_ERROR | ERROR_SEVERITY_WARNING))) { /* It's a windows error that has been previously mapped to an */ /* ntstatus code. */ return (DWORD) (status & 0xffff);