ndr: merge duplicate ndr_map_error2ntstatus() functions.
[samba.git] / source3 / librpc / ndr / util.c
index ed24f87387554ae4f4ba414aa57c9959bf2110a7..ada98108e50dbd422d94302a4b22de332709d4be 100644 (file)
 
 #include "includes.h"
 
-NTSTATUS ndr_map_error2ntstatus(enum ndr_err_code ndr_err)
-{
-       switch (ndr_err) {
-       case NDR_ERR_SUCCESS:
-               return NT_STATUS_OK;
-       case NDR_ERR_BUFSIZE:
-               return NT_STATUS_BUFFER_TOO_SMALL;
-       case NDR_ERR_TOKEN:
-               return NT_STATUS_INTERNAL_ERROR;
-       case NDR_ERR_ALLOC:
-               return NT_STATUS_NO_MEMORY;
-       case NDR_ERR_ARRAY_SIZE:
-               return NT_STATUS_ARRAY_BOUNDS_EXCEEDED;
-       case NDR_ERR_INVALID_POINTER:
-               return NT_STATUS_INVALID_PARAMETER_MIX;
-       case NDR_ERR_UNREAD_BYTES:
-               return NT_STATUS_PORT_MESSAGE_TOO_LONG;
-       default:
-               break;
-       }
-
-       /* we should map all error codes to different status codes */
-       return NT_STATUS_INVALID_PARAMETER;
-}
-
 /*
  * Convert an ndr error to string
  */