diff options
Diffstat (limited to 'source4')
-rw-r--r-- | source4/include/nt_status.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/source4/include/nt_status.h b/source4/include/nt_status.h index 71c69cc441..0ef443d355 100644 --- a/source4/include/nt_status.h +++ b/source4/include/nt_status.h @@ -64,6 +64,30 @@ typedef uint32_t WERROR; }\ } while (0) +#define NT_STATUS_IS_OK_RETURN(x) do { \ + if (NT_STATUS_IS_OK(x)) {\ + return x;\ + }\ +} while (0) + +#define NT_STATUS_NOT_OK_RETURN(x) do { \ + if (!NT_STATUS_IS_OK(x)) {\ + return x;\ + }\ +} while (0) + +#define NT_STATUS_IS_ERR_RETURN(x) do { \ + if (NT_STATUS_IS_ERR(x)) {\ + return x;\ + }\ +} while (0) + +#define NT_STATUS_NOT_ERR_RETURN(x) do { \ + if (!NT_STATUS_IS_ERR(x)) {\ + return x;\ + }\ +} while (0) + #define W_ERROR_IS_OK(x) (W_ERROR_V(x) == 0) #define W_ERROR_EQUAL(x,y) (W_ERROR_V(x) == W_ERROR_V(y)) @@ -73,6 +97,18 @@ typedef uint32_t WERROR; }\ } while (0) +#define W_ERROR_IS_OK_RETURN(x) do { \ + if (W_ERROR_IS_OK(x)) {\ + return x;\ + }\ +} while (0) + +#define W_ERROR_NOT_OK_RETURN(x) do { \ + if (!W_ERROR_IS_OK(x)) {\ + return x;\ + }\ +} while (0) + /* this defines special NTSTATUS codes to represent DOS errors. I have chosen this macro to produce status codes in the invalid NTSTATUS range */ |