private void LoadAssemblyPermissions ()
{
IntPtr minimum = IntPtr.Zero, optional = IntPtr.Zero, refused = IntPtr.Zero;
int minLength = 0, optLength = 0, refLength = 0;
if (LoadPermissions (this, ref minimum, ref minLength, ref optional,
ref optLength, ref refused, ref refLength)) {
// Note: no need to cache these permission sets as they will only be created once
// at assembly resolution time.
if (minLength > 0) {
byte[] data = new byte [minLength];
Marshal.Copy (minimum, data, 0, minLength);
_minimum = SecurityManager.Decode (data);
}
if (optLength > 0) {
byte[] data = new byte [optLength];
Marshal.Copy (optional, data, 0, optLength);
_optional = SecurityManager.Decode (data);
}
if (refLength > 0) {
byte[] data = new byte [refLength];
Marshal.Copy (refused, data, 0, refLength);
_refuse = SecurityManager.Decode (data);
}
}
}
#endif