Inheritance: SafeHandleZeroOrMinusOneIsInvalid
 private PEFileEvidenceFactory(SafePEFileHandle peFile)
 {
     Contract.Assert(peFile != null &&
                     !peFile.IsClosed &&
                     !peFile.IsInvalid);
     m_peFile = peFile;
 }
 private static Evidence CreateSecurityIdentity(SafePEFileHandle peFile, Evidence hostProvidedEvidence)
 {
     PEFileEvidenceFactory target = new PEFileEvidenceFactory(peFile);
     Evidence evidence = new Evidence(target);
     if (hostProvidedEvidence != null)
     {
         evidence.MergeWithNoDuplicates(hostProvidedEvidence);
     }
     return evidence;
 }
 private static extern void FireEvidenceGeneratedEvent(SafePEFileHandle peFile, EvidenceTypeGenerated type);
 private PEFileEvidenceFactory(SafePEFileHandle peFile)
 {
     this.m_peFile = peFile;
 }
 private static extern void GetPublisherCertificate(SafePEFileHandle peFile, ObjectHandleOnStack retCertificate);
 private static extern void GetLocationEvidence(SafePEFileHandle peFile, out SecurityZone zone, StringHandleOnStack retUrl);
 private static extern void GetAssemblySuppliedEvidence(SafePEFileHandle peFile, ObjectHandleOnStack retSerializedEvidence);
        private static Evidence CreateSecurityIdentity(SafePEFileHandle peFile,
                                                       Evidence hostProvidedEvidence)
        {

            PEFileEvidenceFactory evidenceFactory = new PEFileEvidenceFactory(peFile);
            Evidence evidence = new Evidence(evidenceFactory);

            // If the host (caller of Assembly.Load) provided evidence, merge it with the evidence we've just
            // created. The host evidence takes priority.
            if (hostProvidedEvidence != null)
            {
                evidence.MergeWithNoDuplicates(hostProvidedEvidence);
            }

            return evidence;
        }
Exemplo n.º 9
0
 protected override bool ReleaseHandle()
 {
     SafePEFileHandle.ReleaseSafePEFileHandle(this.handle);
     return(true);
 }