summaryrefslogtreecommitdiff
path: root/source4/librpc
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-02-28 04:02:26 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:52:08 -0500
commit4be369984895ffb5afc5bf9d56ef19d944513eb3 (patch)
treeae259cf467c78c6019061d147a001296ad15025c /source4/librpc
parent6b6f516a4a2d8392aaf30575fe3bb2abec72f88a (diff)
downloadsamba-4be369984895ffb5afc5bf9d56ef19d944513eb3.tar.gz
samba-4be369984895ffb5afc5bf9d56ef19d944513eb3.tar.bz2
samba-4be369984895ffb5afc5bf9d56ef19d944513eb3.zip
r13741: make the pointer type in pidl handle any size pointer, just in case we
have a 128 bit machine out there somewhere (This used to be commit 4a1b7580a7ea5db7d10c8ee6a5b3950313b7d273)
Diffstat (limited to 'source4/librpc')
-rw-r--r--source4/librpc/ndr/ndr_basic.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/source4/librpc/ndr/ndr_basic.c b/source4/librpc/ndr/ndr_basic.c
index 8020c7da23..ccc1c8a016 100644
--- a/source4/librpc/ndr/ndr_basic.c
+++ b/source4/librpc/ndr/ndr_basic.c
@@ -197,12 +197,13 @@ NTSTATUS ndr_pull_hyper(struct ndr_pull *ndr, int ndr_flags, uint64_t *v)
*/
NTSTATUS ndr_pull_pointer(struct ndr_pull *ndr, int ndr_flags, void* *v)
{
- uint64_t h;
- NTSTATUS status;
- NDR_PULL_ALIGN(ndr, 8);
- status = ndr_pull_udlong(ndr, ndr_flags, &h);
- *v = (void *)((intptr_t)h);
- return status;
+ intptr_t h;
+ NDR_PULL_ALIGN(ndr, sizeof(h));
+ NDR_PULL_NEED_BYTES(ndr, sizeof(h));
+ memcpy(&h, ndr->data+ndr->offset, sizeof(h));
+ ndr->offset += sizeof(h);
+ *v = (void *)h;
+ return NT_STATUS_OK;
}
/*
@@ -393,8 +394,12 @@ NTSTATUS ndr_push_hyper(struct ndr_push *ndr, int ndr_flags, uint64_t v)
*/
NTSTATUS ndr_push_pointer(struct ndr_push *ndr, int ndr_flags, void* v)
{
- NDR_PUSH_ALIGN(ndr, 8);
- return ndr_push_udlong(ndr, NDR_SCALARS, (intptr_t)v);
+ intptr_t h = (intptr_t)v;
+ NDR_PUSH_ALIGN(ndr, sizeof(h));
+ NDR_PUSH_NEED_BYTES(ndr, sizeof(h));
+ memcpy(ndr->data+ndr->offset, &h, sizeof(h));
+ ndr->offset += sizeof(h);
+ return NT_STATUS_OK;
}
NTSTATUS ndr_push_align(struct ndr_push *ndr, size_t size)