edk2toollib/uefi/edk2/variable_policy.py
def decode(self, buffer):
        """
        load this object from a bytes buffer

        return any remaining buffer
        """
        (self.Version, self.Size, self.OffsetToName, _namespace,
            self.MinSize, self.MaxSize, self.AttributesMustHave,
            self.AttributesCantHave, self.LockPolicyType, _) = struct.unpack(
                self._HdrStructFormat, buffer[:self._HdrStructSize])

        if self.Version != VariablePolicyEntry.ENTRY_REVISION:
            raise ValueError("Unknown structure version!")
        if self.LockPolicyType not in VariablePolicyEntry.LOCK_POLICY_STRING_MAP:
            raise ValueError("Unknown LockPolicyType!")

        self.Namespace = uuid.UUID(bytes_le=_namespace)

        if self.OffsetToName != self.Size:
            self.Name = buffer[self.OffsetToName:self.Size].decode('utf-16').strip('\x00')

        if self.LockPolicyType == VariablePolicyEntry.TYPE_LOCK_ON_VAR_STATE:
            self.LockPolicy = VariableLockOnVarStatePolicy()
            self.LockPolicy.decode(buffer[self._HdrStructSize:self.OffsetToName])

        return buffer[self.Size:]

        load this object from a bytes buffer

        return any remaining buffer
        
load this object from a bytes buffer
return any remaining buffer
load this object from a bytes buffer return any remaining buffer
def decode(self, buffer):
        (self.Version, self.Size, self.OffsetToName, _namespace,
            self.MinSize, self.MaxSize, self.AttributesMustHave,
            self.AttributesCantHave, self.LockPolicyType, _) = struct.unpack(
                self._HdrStructFormat, buffer[:self._HdrStructSize])
        if self.Version != VariablePolicyEntry.ENTRY_REVISION:
            raise ValueError("Unknown structure version!")
        if self.LockPolicyType not in VariablePolicyEntry.LOCK_POLICY_STRING_MAP:
            raise ValueError("Unknown LockPolicyType!")
        self.Namespace = uuid.UUID(bytes_le=_namespace)
        if self.OffsetToName != self.Size:
            self.Name = buffer[self.OffsetToName:self.Size].decode('utf-16').strip('\x00')
        if self.LockPolicyType == VariablePolicyEntry.TYPE_LOCK_ON_VAR_STATE:
            self.LockPolicy = VariableLockOnVarStatePolicy()
            self.LockPolicy.decode(buffer[self._HdrStructSize:self.OffsetToName])
        return buffer[self.Size:]
def decode ( self , buffer ) : ( self . Version , self . Size , self . OffsetToName , _namespace , self . MinSize , self . MaxSize , self . AttributesMustHave , self . AttributesCantHave , self . LockPolicyType , _ ) = struct . unpack ( self . _HdrStructFormat , buffer [ : self . _HdrStructSize ] ) if self . Version != VariablePolicyEntry . ENTRY_REVISION : raise ValueError ( "Unknown structure version!" ) if self . LockPolicyType not in VariablePolicyEntry . LOCK_POLICY_STRING_MAP : raise ValueError ( "Unknown LockPolicyType!" ) self . Namespace = uuid . UUID ( bytes_le = _namespace ) if self . OffsetToName != self . Size : self . Name = buffer [ self . OffsetToName : self . Size ] . decode ( 'utf-16' ) . strip ( '\x00' ) if self . LockPolicyType == VariablePolicyEntry . TYPE_LOCK_ON_VAR_STATE : self . LockPolicy = VariableLockOnVarStatePolicy ( ) self . LockPolicy . decode ( buffer [ self . _HdrStructSize : self . OffsetToName ] ) return buffer [ self . Size : ]
load this object from a bytes buffer
return any remaining buffer
load this object from a bytes buffer return any remaining buffer
"""
        load this object from a bytes buffer

        return any remaining buffer
        """
self
buffer