MdeModulePkg[all]  0.98
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
VariablePolicyHelperLib.h File Reference

Functions

EFI_STATUS EFIAPI CreateBasicVariablePolicy (IN CONST EFI_GUID *Namespace, IN CONST CHAR16 *Name, IN UINT32 MinSize, IN UINT32 MaxSize, IN UINT32 AttributesMustHave, IN UINT32 AttributesCantHave, IN UINT8 LockPolicyType, OUT VARIABLE_POLICY_ENTRY **NewEntry)
 
EFI_STATUS EFIAPI CreateVarStateVariablePolicy (IN CONST EFI_GUID *Namespace, IN CONST CHAR16 *Name, IN UINT32 MinSize, IN UINT32 MaxSize, IN UINT32 AttributesMustHave, IN UINT32 AttributesCantHave, IN CONST EFI_GUID *VarStateNamespace, IN UINT8 VarStateValue, IN CONST CHAR16 *VarStateName, OUT VARIABLE_POLICY_ENTRY **NewEntry)
 
EFI_STATUS EFIAPI RegisterBasicVariablePolicy (IN EDKII_VARIABLE_POLICY_PROTOCOL *VariablePolicy, IN CONST EFI_GUID *Namespace, IN CONST CHAR16 *Name, IN UINT32 MinSize, IN UINT32 MaxSize, IN UINT32 AttributesMustHave, IN UINT32 AttributesCantHave, IN UINT8 LockPolicyType)
 
EFI_STATUS EFIAPI RegisterVarStateVariablePolicy (IN EDKII_VARIABLE_POLICY_PROTOCOL *VariablePolicy, IN CONST EFI_GUID *Namespace, IN CONST CHAR16 *Name, IN UINT32 MinSize, IN UINT32 MaxSize, IN UINT32 AttributesMustHave, IN UINT32 AttributesCantHave, IN CONST EFI_GUID *VarStateNamespace, IN CONST CHAR16 *VarStateName, IN UINT8 VarStateValue)
 

Function Documentation

EFI_STATUS EFIAPI CreateBasicVariablePolicy ( IN CONST EFI_GUID *  Namespace,
IN CONST CHAR16 *  Name,
IN UINT32  MinSize,
IN UINT32  MaxSize,
IN UINT32  AttributesMustHave,
IN UINT32  AttributesCantHave,
IN UINT8  LockPolicyType,
OUT VARIABLE_POLICY_ENTRY **  NewEntry 
)

This helper function will allocate and populate a new VariablePolicy structure for a policy that does not contain any sub-structures (such as VARIABLE_LOCK_ON_VAR_STATE_POLICY).

NOTE: Caller will need to free structure once finished.

Parameters
[in]NamespacePointer to an EFI_GUID for the target variable namespace that this policy will protect.
[in]Name[Optional] If provided, a pointer to the CHAR16 array for the target variable name. Otherwise, will create a policy that targets an entire namespace.
[in]MinSizeMinSize for the VariablePolicy.
[in]MaxSizeMaxSize for the VariablePolicy.
[in]AttributesMustHaveAttributesMustHave for the VariablePolicy.
[in]AttributesCantHaveAttributesCantHave for the VariablePolicy.
[in]LockPolicyTypeLockPolicyType for the VariablePolicy.
[out]NewEntryIf successful, will be set to a pointer to the allocated buffer containing the new policy.
Return values
EFI_SUCCESSOperation completed successfully and structure is populated.
EFI_INVALID_PARAMETERNamespace is NULL.
EFI_INVALID_PARAMETERLockPolicyType is invalid for a basic structure.
EFI_BUFFER_TOO_SMALLFinished structure would not fit in UINT16 size.
EFI_OUT_OF_RESOURCESCould not allocate sufficient space for structure.
EFI_STATUS EFIAPI CreateVarStateVariablePolicy ( IN CONST EFI_GUID *  Namespace,
IN CONST CHAR16 *  Name,
IN UINT32  MinSize,
IN UINT32  MaxSize,
IN UINT32  AttributesMustHave,
IN UINT32  AttributesCantHave,
IN CONST EFI_GUID *  VarStateNamespace,
IN UINT8  VarStateValue,
IN CONST CHAR16 *  VarStateName,
OUT VARIABLE_POLICY_ENTRY **  NewEntry 
)

This helper function will allocate and populate a new VariablePolicy structure for a policy with a lock type of VARIABLE_POLICY_TYPE_LOCK_ON_VAR_STATE.

NOTE: Caller will need to free structure once finished.

Parameters
[in]NamespacePointer to an EFI_GUID for the target variable namespace that this policy will protect.
[in]Name[Optional] If provided, a pointer to the CHAR16 array for the target variable name. Otherwise, will create a policy that targets an entire namespace.
[in]MinSizeMinSize for the VariablePolicy.
[in]MaxSizeMaxSize for the VariablePolicy.
[in]AttributesMustHaveAttributesMustHave for the VariablePolicy.
[in]AttributesCantHaveAttributesCantHave for the VariablePolicy.
[in]VarStateNamespacePointer to the EFI_GUID for the VARIABLE_LOCK_ON_VAR_STATE_POLICY.Namespace.
[in]VarStateValueValue for the VARIABLE_LOCK_ON_VAR_STATE_POLICY.Value.
[in]VarStateNamePointer to the CHAR16 array for the VARIABLE_LOCK_ON_VAR_STATE_POLICY.Name.
[out]NewEntryIf successful, will be set to a pointer to the allocated buffer containing the new policy.
Return values
EFI_SUCCESSOperation completed successfully and structure is populated.
EFI_INVALID_PARAMETERNamespace, VarStateNamespace, VarStateName is NULL.
EFI_BUFFER_TOO_SMALLFinished structure would not fit in UINT16 size.
EFI_OUT_OF_RESOURCESCould not allocate sufficient space for structure.
EFI_STATUS EFIAPI RegisterBasicVariablePolicy ( IN EDKII_VARIABLE_POLICY_PROTOCOL VariablePolicy,
IN CONST EFI_GUID *  Namespace,
IN CONST CHAR16 *  Name,
IN UINT32  MinSize,
IN UINT32  MaxSize,
IN UINT32  AttributesMustHave,
IN UINT32  AttributesCantHave,
IN UINT8  LockPolicyType 
)

This helper function does everything that CreateBasicVariablePolicy() does, but also uses the passed in protocol to register the policy with the infrastructure. Does not return a buffer, does not require the caller to free anything.

Parameters
[in]VariablePolicyPointer to a valid instance of the VariablePolicy protocol.
[in]NamespacePointer to an EFI_GUID for the target variable namespace that this policy will protect.
[in]Name[Optional] If provided, a pointer to the CHAR16 array for the target variable name. Otherwise, will create a policy that targets an entire namespace.
[in]MinSizeMinSize for the VariablePolicy.
[in]MaxSizeMaxSize for the VariablePolicy.
[in]AttributesMustHaveAttributesMustHave for the VariablePolicy.
[in]AttributesCantHaveAttributesCantHave for the VariablePolicy.
[in]LockPolicyTypeLockPolicyType for the VariablePolicy.
Return values
EFI_INVALID_PARAMETERVariablePolicy pointer is NULL.
EFI_STATUSStatus returned by CreateBasicVariablePolicy() or RegisterVariablePolicy().
EFI_STATUS EFIAPI RegisterVarStateVariablePolicy ( IN EDKII_VARIABLE_POLICY_PROTOCOL VariablePolicy,
IN CONST EFI_GUID *  Namespace,
IN CONST CHAR16 *  Name,
IN UINT32  MinSize,
IN UINT32  MaxSize,
IN UINT32  AttributesMustHave,
IN UINT32  AttributesCantHave,
IN CONST EFI_GUID *  VarStateNamespace,
IN CONST CHAR16 *  VarStateName,
IN UINT8  VarStateValue 
)

This helper function does everything that CreateBasicVariablePolicy() does, but also uses the passed in protocol to register the policy with the infrastructure. Does not return a buffer, does not require the caller to free anything.

Parameters
[in]VariablePolicyPointer to a valid instance of the VariablePolicy protocol.
[in]NamespacePointer to an EFI_GUID for the target variable namespace that this policy will protect.
[in]Name[Optional] If provided, a pointer to the CHAR16 array for the target variable name. Otherwise, will create a policy that targets an entire namespace.
[in]MinSizeMinSize for the VariablePolicy.
[in]MaxSizeMaxSize for the VariablePolicy.
[in]AttributesMustHaveAttributesMustHave for the VariablePolicy.
[in]AttributesCantHaveAttributesCantHave for the VariablePolicy.
[in]VarStateNamespacePointer to the EFI_GUID for the VARIABLE_LOCK_ON_VAR_STATE_POLICY.Namespace.
[in]VarStateNamePointer to the CHAR16 array for the VARIABLE_LOCK_ON_VAR_STATE_POLICY.Name.
[in]VarStateValueValue for the VARIABLE_LOCK_ON_VAR_STATE_POLICY.Value.
Return values
EFI_INVALID_PARAMETERVariablePolicy pointer is NULL.
EFI_STATUSStatus returned by CreateBasicVariablePolicy() or RegisterVariablePolicy().