27UINTN mMmReceivedVarCheckHiiBinSize = 0;
28EFI_GUID gVarCheckReceivedHiiBinHandlerGuid = VAR_CHECK_RECEIVED_HII_BIN_HANDLER_GUID;
50 IN CONST VOID *Context OPTIONAL,
51 IN OUT VOID *CommBuffer OPTIONAL,
60 if ((CommBuffer ==
NULL) || (CommBufferSize ==
NULL)) {
64 mMmReceivedVarCheckHiiBinSize = *CommBufferSize;
67 DEBUG ((DEBUG_ERROR,
"%a: MM Communication buffer size is invalid for this handler!\n", __func__));
68 return EFI_ACCESS_DENIED;
71 mMmReceivedVarCheckHiiBin =
AllocateZeroPool (mMmReceivedVarCheckHiiBinSize);
72 if (mMmReceivedVarCheckHiiBin ==
NULL) {
73 DEBUG ((DEBUG_ERROR,
"%a: Failed to allocate memory for mVarCheckHiiBinMm\n", __func__));
74 return EFI_OUT_OF_RESOURCES;
77 CopyMem (mMmReceivedVarCheckHiiBin, CommBuffer, mMmReceivedVarCheckHiiBinSize);
78 if (DispatchHandle !=
NULL) {
79 Status = gMmst->MmiHandlerUnRegister (DispatchHandle);
82 if (EFI_ERROR (Status)) {
83 DEBUG ((DEBUG_ERROR,
"%a: Failed to unregister handler - %r!\n", __func__, Status));
85 DEBUG ((DEBUG_INFO,
"%a: Handler unregistered successfully.\n", __func__));
107 IN CHAR16 *VariableName,
109 IN UINT32 Attributes,
114 return CheckHiiVariableCommon (mMmReceivedVarCheckHiiBin, mMmReceivedVarCheckHiiBinSize, VariableName, VendorGuid, Attributes, DataSize, Data);
137 DEBUG ((DEBUG_INFO,
"%a: starts.\n", __func__));
142 if (EFI_ERROR (Status)) {
143 DEBUG ((DEBUG_ERROR,
"%a: Failed to register handler - %r!\n", __func__, Status));
150 DEBUG ((DEBUG_INFO,
"%a: ends.\n", __func__));
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
#define DEBUG(Expression)
EFI_STATUS EFIAPI CheckHiiVariableCommon(IN VAR_CHECK_HII_VARIABLE_HEADER *HiiVariableBin, IN UINTN HiiVariableBinSize, IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN UINT32 Attributes, IN UINTN DataSize, IN VOID *Data)
EFI_STATUS EFIAPI VarCheckHiiLibReceiveHiiBinHandler(IN EFI_HANDLE DispatchHandle, IN CONST VOID *Context OPTIONAL, IN OUT VOID *CommBuffer OPTIONAL, IN OUT UINTN *CommBufferSize OPTIONAL)
EFI_STATUS EFIAPI SetVariableCheckHandlerHii(IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN UINT32 Attributes, IN UINTN DataSize, IN VOID *Data)
EFI_STATUS EFIAPI VarCheckHiiLibConstructorStandaloneMm(IN EFI_HANDLE ImageHandle, IN EFI_MM_SYSTEM_TABLE *SystemTable)
EFI_STATUS EFIAPI VarCheckLibRegisterAddressPointer(IN VOID **AddressPointer)
EFI_STATUS EFIAPI VarCheckLibRegisterSetVariableCheckHandler(IN VAR_CHECK_SET_VARIABLE_CHECK_HANDLER Handler)