942
942
return IntPtr.Zero;
945
IntPtr RealArray = MemCtx.Alloc<uint> (list.AEntries.Length + 1);
945
/* XXX not nice, but rare */
946
IntPtr RealArray = MemCtx.Alloc<byte> (Marshal.SizeOf(typeof(NativeSizedArray)) * list.AEntries.Length + Marshal.SizeOf(typeof(uint)));
947
948
Marshal.WriteInt32 (RealArray, list.AEntries.Length);
948
949
IntPtr iter = (IntPtr) ((int) RealArray + Marshal.SizeOf (typeof (UInt32)));
950
951
foreach (AdrEntry entry in list.AEntries) {
951
NativeSizedArray Array = new NativeSizedArray ();
952
Array.Data = PropArrayToPtr (entry.PropVals, out Array.Count, MemCtx);
953
Marshal.StructureToPtr (Array, iter, false);
954
iter = (IntPtr) ((int) iter + Marshal.SizeOf (Array));
952
/* XXX this shouldn't happen, but we are still having ONC-RPC */
953
if(entry != null && entry.PropVals != null) {
954
NativeSizedArray Array = new NativeSizedArray ();
955
Array.Data = PropArrayToPtr (entry.PropVals, out Array.Count, MemCtx);
956
Marshal.WriteInt32 (iter, 0);
957
iter = (IntPtr) ((int) iter + Marshal.SizeOf (typeof (UInt32)));
958
Marshal.StructureToPtr (Array, iter, false);
959
iter = (IntPtr) ((int) iter + Marshal.SizeOf (Array));
961
System.Console.WriteLine("WARNING: AdrListToPointer() AdrList with broken entries");
957
966
return RealArray;