svn commit: samba r13741 - in branches/SAMBA_4_0/source/librpc/ndr: .

tridge at samba.org tridge at samba.org
Tue Feb 28 04:02:27 GMT 2006


Author: tridge
Date: 2006-02-28 04:02:26 +0000 (Tue, 28 Feb 2006)
New Revision: 13741

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13741

Log:

make the pointer type in pidl handle any size pointer, just in case we
have a 128 bit machine out there somewhere


Modified:
   branches/SAMBA_4_0/source/librpc/ndr/ndr_basic.c


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/ndr/ndr_basic.c
===================================================================
--- branches/SAMBA_4_0/source/librpc/ndr/ndr_basic.c	2006-02-28 03:49:13 UTC (rev 13740)
+++ branches/SAMBA_4_0/source/librpc/ndr/ndr_basic.c	2006-02-28 04:02:26 UTC (rev 13741)
@@ -197,12 +197,13 @@
 */
 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_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)



More information about the samba-cvs mailing list