Пример #1
0
 public V_COPYIN_RESULT CopyIn(System.IntPtr typePtr, Networking from, ref __Networking to)
 {
     if (from == null)
     {
         return(V_COPYIN_RESULT.INVALID);
     }
     to.bbg_id = from.bbg_id;
     if (from.ipv4 == null)
     {
         return(V_COPYIN_RESULT.INVALID);
     }
     // Unbounded string: bounds check not required...
     if (!Write(c.getBase(typePtr), ref to.ipv4, from.ipv4))
     {
         return(V_COPYIN_RESULT.OUT_OF_MEMORY);
     }
     if (from.mac == null)
     {
         return(V_COPYIN_RESULT.INVALID);
     }
     // Unbounded string: bounds check not required...
     if (!Write(c.getBase(typePtr), ref to.mac, from.mac))
     {
         return(V_COPYIN_RESULT.OUT_OF_MEMORY);
     }
     return(V_COPYIN_RESULT.OK);
 }
Пример #2
0
        public override void CopyOut(System.IntPtr from, System.IntPtr to)
        {
            __Networking nativeImg     = (__Networking)Marshal.PtrToStructure(from, typeof(__Networking));
            GCHandle     tmpGCHandleTo = GCHandle.FromIntPtr(to);
            Networking   toObj         = tmpGCHandleTo.Target as Networking;

            CopyOut(ref nativeImg, ref toObj);
            tmpGCHandleTo.Target = toObj;
        }
Пример #3
0
 public static void CopyOut(ref __Networking from, ref Networking to)
 {
     if (to == null)
     {
         to = new Networking();
     }
     to.bbg_id = from.bbg_id;
     to.ipv4   = ReadString(from.ipv4);
     to.mac    = ReadString(from.mac);
 }
Пример #4
0
        public V_COPYIN_RESULT CopyIn(System.IntPtr typePtr, Networking from, System.IntPtr to)
        {
            __Networking    nativeImg = new __Networking();
            V_COPYIN_RESULT result    = CopyIn(typePtr, from, ref nativeImg);

            if (result == V_COPYIN_RESULT.OK)
            {
                Marshal.StructureToPtr(nativeImg, to, false);
            }
            return(result);
        }
Пример #5
0
        public static void StaticCopyOut(System.IntPtr from, ref Networking to)
        {
            __Networking nativeImg = (__Networking)Marshal.PtrToStructure(from, typeof(__Networking));

            CopyOut(ref nativeImg, ref to);
        }