public DependentAssembly(System.Deployment.Internal.Isolation.Manifest.AssemblyReferenceEntry assemblyReferenceEntry) { this._hashCollection = new System.Deployment.Application.HashCollection(); System.Deployment.Internal.Isolation.Manifest.AssemblyReferenceDependentAssemblyEntry dependentAssembly = assemblyReferenceEntry.DependentAssembly; this._size = dependentAssembly.Size; this._codebase = dependentAssembly.Codebase; this._group = dependentAssembly.Group; bool flag = false; System.Deployment.Internal.Isolation.ISection hashElements = dependentAssembly.HashElements; uint celt = (hashElements != null) ? hashElements.Count : 0; if (celt > 0) { uint celtFetched = 0; System.Deployment.Internal.Isolation.Manifest.IHashElementEntry[] rgelt = new System.Deployment.Internal.Isolation.Manifest.IHashElementEntry[celt]; System.Deployment.Internal.Isolation.IEnumUnknown unknown = (System.Deployment.Internal.Isolation.IEnumUnknown)hashElements._NewEnum; Marshal.ThrowExceptionForHR(unknown.Next(celt, rgelt, ref celtFetched)); if (celtFetched != celt) { throw new InvalidDeploymentException(ExceptionTypes.Manifest, Resources.GetString("Ex_IsoEnumFetchNotEqualToCount")); } for (uint i = 0; i < celt; i++) { System.Deployment.Internal.Isolation.Manifest.HashElementEntry allData = rgelt[i].AllData; if (allData.DigestValueSize > 0) { byte[] destination = new byte[allData.DigestValueSize]; Marshal.Copy(allData.DigestValue, destination, 0, (int)allData.DigestValueSize); this._hashCollection.AddHash(destination, (System.Deployment.Internal.Isolation.Manifest.CMS_HASH_DIGESTMETHOD)allData.DigestMethod, (System.Deployment.Internal.Isolation.Manifest.CMS_HASH_TRANSFORM)allData.Transform); flag = true; } } } if (!flag && (dependentAssembly.HashValueSize > 0)) { byte[] buffer2 = new byte[dependentAssembly.HashValueSize]; Marshal.Copy(dependentAssembly.HashValue, buffer2, 0, (int)dependentAssembly.HashValueSize); this._hashCollection.AddHash(buffer2, (System.Deployment.Internal.Isolation.Manifest.CMS_HASH_DIGESTMETHOD)dependentAssembly.HashAlgorithm, System.Deployment.Internal.Isolation.Manifest.CMS_HASH_TRANSFORM.CMS_HASH_TRANSFORM_IDENTITY); } this._preRequisite = (dependentAssembly.Flags & 4) != 0; this._optional = (assemblyReferenceEntry.Flags & 1) != 0; this._visible = (dependentAssembly.Flags & 2) != 0; this._resourceFallbackCultureInternal = (dependentAssembly.Flags & 8) != 0; this._resourceFallbackCulture = dependentAssembly.ResourceFallbackCulture; this._description = dependentAssembly.Description; this._supportUrl = AssemblyManifest.UriFromMetadataEntry(dependentAssembly.SupportUrl, "Ex_DependencySupportUrlNotValid"); System.Deployment.Internal.Isolation.IReferenceIdentity referenceIdentity = assemblyReferenceEntry.ReferenceIdentity; this._identity = new System.Deployment.Application.ReferenceIdentity(referenceIdentity); this._codebaseFS = UriHelper.NormalizePathDirectorySeparators(this._codebase); }
internal static System.Deployment.Application.DefinitionIdentity GetDefinitionIdentityFromManagedAssembly(string filePath) { Guid guidOfType = System.Deployment.Internal.Isolation.IsolationInterop.GetGuidOfType(typeof(System.Deployment.Internal.Isolation.IReferenceIdentity)); System.Deployment.Internal.Isolation.IReferenceIdentity assemblyIdentityFromFile = (System.Deployment.Internal.Isolation.IReferenceIdentity)System.Deployment.Application.NativeMethods.GetAssemblyIdentityFromFile(filePath, ref guidOfType); System.Deployment.Application.ReferenceIdentity refId = new System.Deployment.Application.ReferenceIdentity(assemblyIdentityFromFile); string processorArchitecture = refId.ProcessorArchitecture; if (processorArchitecture != null) { refId.ProcessorArchitecture = processorArchitecture.ToLower(CultureInfo.InvariantCulture); } System.Deployment.Application.DefinitionIdentity identity3 = new System.Deployment.Application.DefinitionIdentity(refId); Logger.AddInternalState("Managed Assembly Identity = " + identity3.ToString()); return(identity3); }
public ReferenceIdentity(string text) { this._idComPtr = System.Deployment.Internal.Isolation.IsolationInterop.IdentityAuthority.TextToReference(0, text); }
public ReferenceIdentity(System.Deployment.Internal.Isolation.IReferenceIdentity idComPtr) { this._idComPtr = idComPtr; }
public ReferenceIdentity() { this._idComPtr = System.Deployment.Internal.Isolation.IsolationInterop.IdentityAuthority.CreateReference(); }