Win: fix improper treatment of real ntstatus codes as mapped win32 errors

This commit is contained in:
Bert Belder 2011-11-24 17:59:24 +01:00
parent 96c230344d
commit 0ded5d29cd

View File

@ -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);