Exemple #1
0
        private DeviceDriverPhysicalMemoryAttribute GetDeviceDriverPhysicalMemoryAttribute(CustomAttributeData attributeData)
        {
            var attribute = new DeviceDriverPhysicalMemoryAttribute();

            foreach (var arg in attributeData.NamedArguments)
            {
                if (arg.MemberName == "MemorySize")
                {
                    attribute.MemorySize = (uint)arg.TypedValue.Value;
                }
                else if (arg.MemberName == "MemoryAlignment")
                {
                    attribute.MemoryAlignment = (uint)arg.TypedValue.Value;
                }
                else if (arg.MemberName == "RestrictUnder16M")
                {
                    attribute.RestrictUnder16M = (bool)arg.TypedValue.Value;
                }
                else if (arg.MemberName == "RestrictUnder4G")
                {
                    attribute.RestrictUnder4G = (bool)arg.TypedValue.Value;
                }
            }
            return(attribute);
        }
Exemple #2
0
 /// <summary>
 /// Adds the specified memory attribute.
 /// </summary>
 /// <param name="memoryAttribute">The memory attribute.</param>
 public void Add(DeviceDriverPhysicalMemoryAttribute memoryAttribute)
 {
     MemoryAttributes.AddLast(memoryAttribute);
 }
Exemple #3
0
 /// <summary>
 /// Adds the specified memory attribute.
 /// </summary>
 /// <param name="memoryAttribute">The memory attribute.</param>
 public void Add(DeviceDriverPhysicalMemoryAttribute memoryAttribute)
 {
     MemoryAttributes.AddLast(memoryAttribute);
 }
 private DeviceDriverPhysicalMemoryAttribute GetDeviceDriverPhysicalMemoryAttribute(CustomAttributeData attributeData)
 {
     var attribute = new DeviceDriverPhysicalMemoryAttribute();
     foreach (var arg in attributeData.NamedArguments)
     {
         if (arg.MemberName == "MemorySize")
             attribute.MemorySize = (uint)arg.TypedValue.Value;
         else if (arg.MemberName == "MemoryAlignment")
             attribute.MemoryAlignment = (uint)arg.TypedValue.Value;
         else if (arg.MemberName == "RestrictUnder16M")
             attribute.RestrictUnder16M = (bool)arg.TypedValue.Value;
         else if (arg.MemberName == "RestrictUnder4G")
             attribute.RestrictUnder4G = (bool)arg.TypedValue.Value;
     }
     return attribute;
 }