summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/tdr/tdr.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source4/lib/tdr/tdr.c b/source4/lib/tdr/tdr.c
index c16a05ecf0..e55060da25 100644
--- a/source4/lib/tdr/tdr.c
+++ b/source4/lib/tdr/tdr.c
@@ -36,9 +36,11 @@
#define TDR_BE(tdr) ((tdr)->flags & TDR_BIG_ENDIAN)
+#define TDR_CVAL(tdr, ofs) CVAL(tdr->data.data,ofs)
#define TDR_SVAL(tdr, ofs) (TDR_BE(tdr)?RSVAL(tdr->data.data,ofs):SVAL(tdr->data.data,ofs))
#define TDR_IVAL(tdr, ofs) (TDR_BE(tdr)?RIVAL(tdr->data.data,ofs):IVAL(tdr->data.data,ofs))
#define TDR_IVALS(tdr, ofs) (TDR_BE(tdr)?RIVALS(tdr->data.data,ofs):IVALS(tdr->data.data,ofs))
+#define TDR_SCVAL(tdr, ofs, v) SCVAL(tdr->data.data,ofs,v)
#define TDR_SSVAL(tdr, ofs, v) do { if (TDR_BE(tdr)) { RSSVAL(tdr->data.data,ofs,v); } else SSVAL(tdr->data.data,ofs,v); } while (0)
#define TDR_SIVAL(tdr, ofs, v) do { if (TDR_BE(tdr)) { RSIVAL(tdr->data.data,ofs,v); } else SIVAL(tdr->data.data,ofs,v); } while (0)
#define TDR_SIVALS(tdr, ofs, v) do { if (TDR_BE(tdr)) { RSIVALS(tdr->data.data,ofs,v); } else SIVALS(tdr->data.data,ofs,v); } while (0)
@@ -60,7 +62,7 @@ NTSTATUS tdr_push_expand(struct tdr_push *tdr, uint32_t size)
NTSTATUS tdr_pull_uint8(struct tdr_pull *tdr, uint8_t *v)
{
TDR_PULL_NEED_BYTES(tdr, 1);
- SCVAL(tdr->data.data, tdr->offset, *v);
+ *v = TDR_CVAL(tdr, tdr->offset);
tdr->offset += 1;
return NT_STATUS_OK;
}
@@ -68,7 +70,7 @@ NTSTATUS tdr_pull_uint8(struct tdr_pull *tdr, uint8_t *v)
NTSTATUS tdr_push_uint8(struct tdr_push *tdr, const uint8_t *v)
{
TDR_PUSH_NEED_BYTES(tdr, 1);
- SCVAL(tdr->data.data, tdr->offset, *v);
+ TDR_SCVAL(tdr, tdr->offset, *v);
tdr->offset += 1;
return NT_STATUS_OK;
}