diff options
author | Andrew Tridgell <tridge@samba.org> | 2003-11-15 04:42:48 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2003-11-15 04:42:48 +0000 |
commit | 099899a7cc01fab5faba82e59650aa76bac8143e (patch) | |
tree | 581b349e1562b198be22c46e3f6c2e1238a86e10 /source4/librpc/ndr/libndr.h | |
parent | 5a1779b982569201decc8a09765d5361212813d7 (diff) | |
download | samba-099899a7cc01fab5faba82e59650aa76bac8143e.tar.gz samba-099899a7cc01fab5faba82e59650aa76bac8143e.tar.bz2 samba-099899a7cc01fab5faba82e59650aa76bac8143e.zip |
added lsa_QuerySecObj() and the necessary sec_desc_buf supporting code
also adding printing of security descriptors
(This used to be commit 1f93cbc1d597b973ab1a5005ede093c1bcefff87)
Diffstat (limited to 'source4/librpc/ndr/libndr.h')
-rw-r--r-- | source4/librpc/ndr/libndr.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/source4/librpc/ndr/libndr.h b/source4/librpc/ndr/libndr.h index 287046ad20..a7c63f7e13 100644 --- a/source4/librpc/ndr/libndr.h +++ b/source4/librpc/ndr/libndr.h @@ -88,6 +88,27 @@ enum ndr_err_code { #define NDR_SCALARS 1 #define NDR_BUFFERS 2 +#define NDR_PULL_NEED_BYTES(ndr, n) do { \ + if ((n) > ndr->data_size || ndr->offset + (n) > ndr->data_size) { \ + return NT_STATUS_BUFFER_TOO_SMALL; \ + } \ +} while(0) + +#define NDR_PULL_ALIGN(ndr, n) do { \ + ndr->offset = (ndr->offset + (n-1)) & ~(n-1); \ + if (ndr->offset >= ndr->data_size) { \ + return NT_STATUS_BUFFER_TOO_SMALL; \ + } \ +} while(0) + +#define NDR_PUSH_NEED_BYTES(ndr, n) NDR_CHECK(ndr_push_expand(ndr, ndr->offset+(n))) + +#define NDR_PUSH_ALIGN(ndr, n) do { \ + uint32 _pad = (ndr->offset & (n-1)); \ + while (_pad--) NDR_CHECK(ndr_push_uint8(ndr, 0)); \ +} while(0) + + /* these are used to make the error checking on each element in libndr less tedious, hopefully making the code more readable */ #define NDR_CHECK(call) do { NTSTATUS _status; \ |