internal ActCtxDllRedirection(StringSectionEntry <ACTIVATION_CONTEXT_DATA_DLL_REDIRECTION> entry, ReadHandle handle, int base_offset)
 {
     Name = entry.Key;
     Path = string.Join(@"\",
                        handle.ReadArray <ACTIVATION_CONTEXT_DATA_DLL_REDIRECTION_PATH_SEGMENT>(base_offset + entry.Entry.PathSegmentOffset,
                                                                                                entry.Entry.PathSegmentCount).Select(e => handle.ReadString(base_offset + e.Offset, e.Length)));
     Flags = entry.Entry.Flags;
 }
        internal ActCtxComInterfaceRedirection(GuidSectionEntry <ACTIVATION_CONTEXT_DATA_COM_INTERFACE_REDIRECTION> entry, ReadHandle handle, int base_offset)
        {
            Iid = entry.Key;
            var ent = entry.Entry;

            ProxyStubClsid32 = ent.ProxyStubClsid32;
            NumMethods       = ent.NumMethods;
            TypeLibraryId    = ent.TypeLibraryId;
            BaseInterface    = ent.BaseInterface;
            Name             = handle.ReadString(entry.Offset + ent.NameOffset, ent.NameLength);
        }
 internal ActCtxComProgIdRedirection(StringSectionEntry <ACTIVATION_CONTEXT_DATA_COM_PROGID_REDIRECTION> entry, ReadHandle handle, int base_offset)
 {
     ProgId = entry.Key;
     Clsid  = handle.ReadStructure <Guid>(base_offset + entry.Entry.ConfiguredClsidOffset);
 }
 internal ActCtxComServerRedirection(GuidSectionEntry <ACTIVATION_CONTEXT_DATA_COM_SERVER_REDIRECTION> entry, ReadHandle handle, int base_offset, int struct_offset)
 {
     Clsid            = entry.Key;
     ReferenceClsid   = entry.Entry.ReferenceClsid;
     ConfiguredClsid  = entry.Entry.ConfiguredClsid;
     ImplementedClsid = entry.Entry.ImplementedClsid;
     TypeLibraryId    = entry.Entry.TypeLibraryId;
     Module           = handle.ReadString(base_offset + entry.Entry.ModuleOffset, entry.Entry.ModuleLength);
     ProgId           = handle.ReadString(struct_offset + entry.Entry.ProgIdOffset, entry.Entry.ProgIdLength);
     ThreadingModel   = FromActCtxThreadingModel(entry.Entry.ThreadingModel);
     if (!string.IsNullOrWhiteSpace(entry.RosterEntry.FullPath))
     {
         FullPath = Path.Combine(entry.RosterEntry.FullPath, Module);
     }
     else
     {
         FullPath = Module;
     }
 }
        internal ActCtxAssemblyRoster(ACTIVATION_CONTEXT_DATA_ASSEMBLY_ROSTER_ENTRY entry, ReadHandle handle, int base_offset)
        {
            AssemblyName          = string.Empty;
            AssemblyDirectoryName = string.Empty;
            FullPath = string.Empty;

            if ((entry.Flags & ACTIVATION_CONTEXT_DATA_ASSEMBLY_ROSTER_ENTRY_FLAGS.INVALID) != 0)
            {
                return;
            }

            AssemblyName = handle.ReadString(entry.AssemblyNameOffset, entry.AssemblyNameLength);
            if (entry.AssemblyInformationOffset == 0)
            {
                return;
            }

            var info = handle.ReadStructure <ACTIVATION_CONTEXT_DATA_ASSEMBLY_INFORMATION>(entry.AssemblyInformationOffset);

            AssemblyDirectoryName = handle.ReadString(base_offset + info.AssemblyDirectoryNameOffset, info.AssemblyDirectoryNameLength);
            FullPath = Path.Combine(SXS_FOLDER, AssemblyDirectoryName);
        }
示例#6
0
 public ReadHandle(byte[] data)
     : this(GCHandle.Alloc(data, GCHandleType.Pinned),
            null, 0, data.Length)
 {
     Root = this;
 }
示例#7
0
        internal ActCtxComTypeLibraryRedirection(GuidSectionEntry <ACTIVATION_CONTEXT_DATA_COM_TYPE_LIBRARY_REDIRECTION> entry, ReadHandle handle, int base_offset)
        {
            TypeLibraryId = entry.Key;
            var ent = entry.Entry;

            Name         = handle.ReadString(base_offset + ent.NameOffset, ent.NameLength);
            HelpDir      = handle.ReadString(entry.Offset + ent.HelpDirOffset, ent.HelpDirLength);
            LibraryFlags = (System.Runtime.InteropServices.ComTypes.LIBFLAGS)ent.LibraryFlags;
            ResourceId   = ent.ResourceId;
            Version      = new Version(ent.MajorVersion, ent.MinorVersion);
            if (!string.IsNullOrWhiteSpace(entry.RosterEntry.FullPath))
            {
                FullPath = Path.Combine(entry.RosterEntry.FullPath, Name);
            }
            else
            {
                FullPath = Name;
            }
        }