2 Implementation functions and structures for var check protocol
3 and variable lock protocol based on VarCheckLib.
5 Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
6 Copyright (c) Microsoft Corporation.
7 SPDX-License-Identifier: BSD-2-Clause-Patent
14 Register SetVariable check handler.
16 @param[in] Handler Pointer to check handler.
18 @retval EFI_SUCCESS The SetVariable check handler was registered successfully.
19 @retval EFI_INVALID_PARAMETER Handler is NULL.
20 @retval EFI_ACCESS_DENIED EFI_END_OF_DXE_EVENT_GROUP_GUID or EFI_EVENT_GROUP_READY_TO_BOOT has
21 already been signaled.
22 @retval EFI_OUT_OF_RESOURCES There is not enough resource for the SetVariable check handler register request.
23 @retval EFI_UNSUPPORTED This interface is not implemented.
24 For example, it is unsupported in VarCheck protocol if both VarCheck and SmmVarCheck protocols are present.
29 VarCheckRegisterSetVariableCheckHandler (
30 IN VAR_CHECK_SET_VARIABLE_CHECK_HANDLER Handler
35 AcquireLockOnlyAtBootTime (&mVariableModuleGlobal
->VariableGlobal
.VariableServicesLock
);
36 Status
= VarCheckLibRegisterSetVariableCheckHandler (Handler
);
37 ReleaseLockOnlyAtBootTime (&mVariableModuleGlobal
->VariableGlobal
.VariableServicesLock
);
43 Variable property set.
45 @param[in] Name Pointer to the variable name.
46 @param[in] Guid Pointer to the vendor GUID.
47 @param[in] VariableProperty Pointer to the input variable property.
49 @retval EFI_SUCCESS The property of variable specified by the Name and Guid was set successfully.
50 @retval EFI_INVALID_PARAMETER Name, Guid or VariableProperty is NULL, or Name is an empty string,
51 or the fields of VariableProperty are not valid.
52 @retval EFI_ACCESS_DENIED EFI_END_OF_DXE_EVENT_GROUP_GUID or EFI_EVENT_GROUP_READY_TO_BOOT has
53 already been signaled.
54 @retval EFI_OUT_OF_RESOURCES There is not enough resource for the variable property set request.
59 VarCheckVariablePropertySet (
62 IN VAR_CHECK_VARIABLE_PROPERTY
*VariableProperty
67 AcquireLockOnlyAtBootTime (&mVariableModuleGlobal
->VariableGlobal
.VariableServicesLock
);
68 Status
= VarCheckLibVariablePropertySet (Name
, Guid
, VariableProperty
);
69 ReleaseLockOnlyAtBootTime (&mVariableModuleGlobal
->VariableGlobal
.VariableServicesLock
);
75 Variable property get.
77 @param[in] Name Pointer to the variable name.
78 @param[in] Guid Pointer to the vendor GUID.
79 @param[out] VariableProperty Pointer to the output variable property.
81 @retval EFI_SUCCESS The property of variable specified by the Name and Guid was got successfully.
82 @retval EFI_INVALID_PARAMETER Name, Guid or VariableProperty is NULL, or Name is an empty string.
83 @retval EFI_NOT_FOUND The property of variable specified by the Name and Guid was not found.
88 VarCheckVariablePropertyGet (
91 OUT VAR_CHECK_VARIABLE_PROPERTY
*VariableProperty
96 AcquireLockOnlyAtBootTime (&mVariableModuleGlobal
->VariableGlobal
.VariableServicesLock
);
97 Status
= VarCheckLibVariablePropertyGet (Name
, Guid
, VariableProperty
);
98 ReleaseLockOnlyAtBootTime (&mVariableModuleGlobal
->VariableGlobal
.VariableServicesLock
);