mirror of https://github.com/tongzx/nt5src
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
1.0 KiB
69 lines
1.0 KiB
/*++
|
|
|
|
Copyright (c) 1991 Microsoft Corporation
|
|
|
|
Module Name:
|
|
|
|
status.c
|
|
|
|
Abstract:
|
|
|
|
This module attempts to map NT status codes to Unix error
|
|
numbers as specified by the X/Open Transport Interface.
|
|
|
|
Author:
|
|
|
|
Eric Chin (ericc) August 2, 1991
|
|
|
|
Revision History:
|
|
|
|
--*/
|
|
|
|
#include "common.h"
|
|
#include <sock_err.h>
|
|
|
|
int
|
|
MapNtToPosixStatus(
|
|
IN NTSTATUS status
|
|
)
|
|
|
|
/*++
|
|
|
|
Routine Description:
|
|
|
|
This function returns a POSIX error number, given an NT status code.
|
|
|
|
Arguments:
|
|
|
|
status - an NT status code
|
|
|
|
Return Value:
|
|
|
|
the corresponding POSIX error number
|
|
|
|
--*/
|
|
|
|
{
|
|
switch (status) {
|
|
case STATUS_INSUFFICIENT_RESOURCES:
|
|
return(ENOSR);
|
|
|
|
case STATUS_INVALID_PARAMETER:
|
|
return(EINVAL);
|
|
|
|
case STATUS_NO_SUCH_DEVICE:
|
|
return(ENXIO);
|
|
|
|
case STATUS_INVALID_NETWORK_RESPONSE:
|
|
return(ENETDOWN);
|
|
|
|
case STATUS_NETWORK_BUSY:
|
|
return(EBUSY);
|
|
|
|
case STATUS_ACCESS_DENIED:
|
|
return(EACCES);
|
|
|
|
default:
|
|
return(EINVAL);
|
|
}
|
|
}
|