summaryrefslogtreecommitdiff
path: root/source4/rpc_server/common/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'source4/rpc_server/common/common.h')
-rw-r--r--source4/rpc_server/common/common.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/source4/rpc_server/common/common.h b/source4/rpc_server/common/common.h
index afc238f6b6..d3ae0db014 100644
--- a/source4/rpc_server/common/common.h
+++ b/source4/rpc_server/common/common.h
@@ -38,10 +38,13 @@
/* this checks for a valid policy handle, and gives a fault if an
invalid handle or NT_STATUS_INVALID_HANDLE if the handle is of the
wrong type */
-#define DCESRV_PULL_HANDLE(h, inhandle, t) do { \
+#define DCESRV_PULL_HANDLE_RETVAL(h, inhandle, t, retval) do { \
(h) = dcesrv_handle_fetch(dce_call->conn, (inhandle), DCESRV_HANDLE_ANY); \
DCESRV_CHECK_HANDLE(h); \
if ((t) != DCESRV_HANDLE_ANY && (h)->wire_handle.handle_type != (t)) { \
- return NT_STATUS_INVALID_HANDLE; \
+ return retval; \
} \
} while (0)
+
+#define DCESRV_PULL_HANDLE(h, inhandle, t) DCESRV_PULL_HANDLE_RETVAL(h, inhandle, t, NT_STATUS_INVALID_HANDLE)
+#define DCESRV_PULL_HANDLE_WERR(h, inhandle, t) DCESRV_PULL_HANDLE_RETVAL(h, inhandle, t, WERR_BADFID)