Beispiel #1
0
        public new static ManagedExceptionNativeInfo Demarshal(Stream stream)
        {
            ManagedExceptionNativeInfo unit = NativeUnitMarshaler <ManagedExceptionNativeInfo> .Demarshal(stream);

            unit.ClassId = UInt64Marshaler.Demarshal(stream);
            unit.Message = StringMarshaler.Demarshal(stream);
            unit.Stack   = MarshalingManager.Demarshal <ulong[]>(stream);
            return(unit);
        }
 public T GetValue <T>()
 {
     if (IsSerialized)
     {
         using (MemoryStream stream = new MemoryStream(_data))
         {
             _value = MarshalingManager.Demarshal <T>(stream);
         }
         MarkDeserialized();
     }
     return((T)_value);
 }
Beispiel #3
0
        public bool HandlePackage(NativeArray array)
        {
            using (Stream stream = array.OpenRead())
            {
                while (stream.Position < stream.Length)
                {
                    UnitType unitType = (UnitType)Int32Marshaler.Demarshal(stream);
                    switch (unitType)
                    {
                    case UnitType.AppDomain:
                        AppDomainNativeInfo[] appDomains = MarshalingManager.Demarshal <AppDomainNativeInfo[]>(stream);
                        _appDomains.Update(appDomains);
                        break;

                    case UnitType.Assembly:
                        AssemblyNativeInfo[] assemblies = MarshalingManager.Demarshal <AssemblyNativeInfo[]>(stream);
                        _assemblies.Update(assemblies);
                        break;

                    case UnitType.Module:
                        ModuleNativeInfo[] modules = MarshalingManager.Demarshal <ModuleNativeInfo[]>(stream);
                        _modules.Update(modules);
                        break;

                    case UnitType.Class:
                        ClassNativeInfo[] classes = MarshalingManager.Demarshal <ClassNativeInfo[]>(stream);
                        _classes.Update(classes);
                        break;

                    case UnitType.Function:
                        FunctionNativeInfo[] functions = MarshalingManager.Demarshal <FunctionNativeInfo[]>(stream);
                        _functions.Update(functions);
                        break;

                    case UnitType.Thread:
                        ThreadNativeInfo[] threads = MarshalingManager.Demarshal <ThreadNativeInfo[]>(stream);
                        _threads.Update(threads);
                        break;

                    default:
                        throw new TempException("Unknown UnitType");
                    }
                }
            }
            return(true);
        }
        public bool HandlePackage(NativeArray array)
        {
            using (Stream stream = array.OpenRead())
            {
                while (stream.Position < stream.Length)
                {
                    UnitType unitType = (UnitType)Int32Marshaler.Demarshal(stream);
                    switch (unitType)
                    {
                    case UnitType.ManagedException:
                        ManagedExceptionNativeInfo[] exceptions = MarshalingManager.Demarshal <ManagedExceptionNativeInfo[]>(stream);
                        _exceptions.Update(exceptions);
                        break;

                    default:
                        throw new TempException("Unknown UnitType");
                    }
                }
            }
            return(true);
        }