Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
Win: fix improper treatment of real ntstatus codes as mapped win32 er…
Browse files Browse the repository at this point in the history
…rors
  • Loading branch information
piscisaureus committed Nov 24, 2011
1 parent 96c2303 commit 0ded5d2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/win/winsock.c
Expand Up @@ -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);
Expand Down

0 comments on commit 0ded5d2

Please sign in to comment.