public sealed class SecurityDeclaration {
readonly internal uint signature;
+ byte [] blob;
readonly ModuleDefinition module;
internal bool resolved;
this.resolved = true;
}
+ public SecurityDeclaration (SecurityAction action, byte [] blob)
+ {
+ this.action = action;
+ this.resolved = false;
+ this.blob = blob;
+ }
+
public byte [] GetBlob ()
{
+ if (blob != null)
+ return blob;
+
if (!HasImage || signature == 0)
throw new NotSupportedException ();
- return module.Read (this, (declaration, reader) => reader.ReadSecurityDeclarationBlob (declaration.signature));
+ return blob = module.Read (this, (declaration, reader) => reader.ReadSecurityDeclarationBlob (declaration.signature));
}
void Resolve ()
this ISecurityDeclarationProvider self,
ModuleDefinition module)
{
- return module.HasImage ()
- ? module.Read (self, (provider, reader) => reader.HasSecurityDeclarations (provider))
- : false;
+ return module.HasImage () && module.Read (self, (provider, reader) => reader.HasSecurityDeclarations (provider));
}
public static Collection<SecurityDeclaration> GetSecurityDeclarations (