summaryrefslogtreecommitdiff
path: root/source4/librpc/ndr
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-07-05 12:09:33 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:19:16 -0500
commit4a993c5241c26bbd86f3aba830cb5a5a7a2a6ae7 (patch)
treeb59616dd0d34796d8ac23e06b3346481bda3033b /source4/librpc/ndr
parentf1031746e51268d64559b9eb3ab1affbc436af00 (diff)
downloadsamba-4a993c5241c26bbd86f3aba830cb5a5a7a2a6ae7.tar.gz
samba-4a993c5241c26bbd86f3aba830cb5a5a7a2a6ae7.tar.bz2
samba-4a993c5241c26bbd86f3aba830cb5a5a7a2a6ae7.zip
r8167: - use the same algorithm than w2k3 for 'unique' pointer values
- add a new 'sptr' (simple-full) pointer type to simulate what we need to support pipes like epmapper and mgmt that uses 'ptr' full pointer in their spec - I runned make test and test_w2k3.sh with this, all fine does we have any other pipe using 'unique' pointer where we need 'ptr'? btw: jelmer, what does 'ignore' pointers do? they are allowed in pidl but not implemented! metze (This used to be commit d19068bfb2e3ff5d88bc3b76d5cef93417c7f218)
Diffstat (limited to 'source4/librpc/ndr')
-rw-r--r--source4/librpc/ndr/ndr_basic.c16
-rw-r--r--source4/librpc/ndr/ndr_krb5pac.c2
2 files changed, 13 insertions, 5 deletions
diff --git a/source4/librpc/ndr/ndr_basic.c b/source4/librpc/ndr/ndr_basic.c
index 0a268ac6c9..8b473724dc 100644
--- a/source4/librpc/ndr/ndr_basic.c
+++ b/source4/librpc/ndr/ndr_basic.c
@@ -128,7 +128,7 @@ NTSTATUS ndr_pull_uint32(struct ndr_pull *ndr, int ndr_flags, uint32_t *v)
/*
parse a pointer referent identifier
*/
-NTSTATUS ndr_pull_unique_ptr(struct ndr_pull *ndr, uint32_t *v)
+NTSTATUS ndr_pull_generic_ptr(struct ndr_pull *ndr, uint32_t *v)
{
NTSTATUS status;
status = ndr_pull_uint32(ndr, NDR_SCALARS, v);
@@ -563,14 +563,22 @@ NTSTATUS ndr_push_unique_ptr(struct ndr_push *ndr, const void *p)
{
uint32_t ptr = 0;
if (p) {
-#if 0
ptr = ndr->ptr_count * 4;
ptr |= 0x00020000;
ndr->ptr_count++;
-#else
+ }
+ return ndr_push_uint32(ndr, NDR_SCALARS, ptr);
+}
+
+/*
+ push a 'simple' full non-zero value if a pointer is non-NULL, otherwise 0
+*/
+NTSTATUS ndr_push_sptr_ptr(struct ndr_push *ndr, const void *p)
+{
+ uint32_t ptr = 0;
+ if (p) {
ndr->ptr_count++;
ptr = ndr->ptr_count;
-#endif
}
return ndr_push_uint32(ndr, NDR_SCALARS, ptr);
}
diff --git a/source4/librpc/ndr/ndr_krb5pac.c b/source4/librpc/ndr/ndr_krb5pac.c
index e373189d89..3af3a185e5 100644
--- a/source4/librpc/ndr/ndr_krb5pac.c
+++ b/source4/librpc/ndr/ndr_krb5pac.c
@@ -90,7 +90,7 @@ NTSTATUS ndr_pull_PAC_BUFFER(struct ndr_pull *ndr, int ndr_flags, struct PAC_BUF
{
uint32_t _flags_save_PAC_INFO = ndr->flags;
ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN8);
- NDR_CHECK(ndr_pull_unique_ptr(ndr, &_ptr_info));
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info));
if (_ptr_info) {
NDR_ALLOC(ndr, r->info);
NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->info, _ptr_info));