summaryrefslogtreecommitdiff
path: root/source4/libcli/smb2/smb2.h
diff options
context:
space:
mode:
Diffstat (limited to 'source4/libcli/smb2/smb2.h')
-rw-r--r--source4/libcli/smb2/smb2.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/source4/libcli/smb2/smb2.h b/source4/libcli/smb2/smb2.h
index 76f00cc573..f6847bfc9b 100644
--- a/source4/libcli/smb2/smb2.h
+++ b/source4/libcli/smb2/smb2.h
@@ -168,3 +168,14 @@ struct smb2_request {
#define SMB2_MAGIC 0x424D53FE /* 0xFE 'S' 'M' 'B' */
+/*
+ check that a buffer code matches the expected value
+*/
+#define SMB2_CHECK_BUFFER_CODE(req, code) do { \
+ io->out.buffer_code = SVAL(req->in.body, 0); \
+ if (io->out.buffer_code != (code)) { \
+ DEBUG(0,("Unexpected buffer code 0x%x. Expected 0x%x\n", \
+ io->out.buffer_code, code)); \
+ return NT_STATUS_INVALID_PARAMETER; \
+ } \
+} while (0)