21#include <Protocol/VariablePolicy.h>
22#include <Library/VariablePolicyHelperLib.h>
45 IN CHAR16 *VariableName,
75 MEMORY_OVERWRITE_REQUEST_CONTROL_LOCK_NAME,
76 &gEfiMemoryOverwriteRequestControlLockGuid,
94 &gEfiMemoryOverwriteControlDataGuid,
117 Status =
gBS->LocateProtocol (&gEdkiiVariablePolicyProtocolGuid,
NULL, (VOID **)&VariablePolicy);
118 if (EFI_ERROR (Status)) {
119 DEBUG ((DEBUG_ERROR,
"%a - Could not locate VariablePolicy protocol! %r\n", __func__, Status));
124 Status = RegisterBasicVariablePolicy (
126 &gEfiMemoryOverwriteRequestControlLockGuid,
127 MEMORY_OVERWRITE_REQUEST_CONTROL_LOCK_NAME,
128 VARIABLE_POLICY_NO_MIN_SIZE,
129 VARIABLE_POLICY_NO_MAX_SIZE,
130 VARIABLE_POLICY_NO_MUST_ATTR,
131 VARIABLE_POLICY_NO_CANT_ATTR,
132 VARIABLE_POLICY_TYPE_LOCK_NOW
134 if (EFI_ERROR (Status)) {
135 DEBUG ((DEBUG_ERROR,
"%a - Could not lock variable %s! %r\n", __func__, MEMORY_OVERWRITE_REQUEST_CONTROL_LOCK_NAME, Status));
138 Status = RegisterBasicVariablePolicy (
140 &gEfiMemoryOverwriteControlDataGuid,
142 VARIABLE_POLICY_NO_MIN_SIZE,
143 VARIABLE_POLICY_NO_MAX_SIZE,
144 VARIABLE_POLICY_NO_MUST_ATTR,
145 VARIABLE_POLICY_NO_CANT_ATTR,
146 VARIABLE_POLICY_TYPE_LOCK_NOW
148 if (EFI_ERROR (Status)) {
#define DEBUG(Expression)
#define MEMORY_OVERWRITE_REQUEST_VARIABLE_NAME
EFI_STATUS MorLockInit(VOID)
VOID MorLockInitAtEndOfDxe(VOID)
EFI_STATUS SetVariableCheckHandlerMor(IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN UINT32 Attributes, IN UINTN DataSize, IN VOID *Data)
EFI_STATUS EFIAPI VariableServiceSetVariable(IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN UINT32 Attributes, IN UINTN DataSize, IN VOID *Data)