1、问题记录:
在项目中导入driver health模块后,启动设备后,第一次进入driver health选项,健康状态能成功显示中文,但是在退出再进来之后,无法再正常显示中文。
[Defines]
INF_VERSION = 0x00010005
BASE_NAME = DriverHealthManagerDxe
MODULE_UNI_FILE = DriverHealthManagerDxe.uni
FILE_GUID = EBF8ED7C-0DD1-4787-84F1-F48D537DCACF
MODULE_TYPE = DXE_DRIVER
VERSION_STRING = 1.0
ENTRY_POINT = InitializeDriverHealthManager
2、解决方法:
在DriverHealthManagerCallback接口中,去掉对form close的action的响应动作,改动如下:
EFI_STATUS
EFIAPI
DriverHealthManagerCallback (
IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
IN EFI_BROWSER_ACTION Action,
IN EFI_QUESTION_ID QuestionId,
IN UINT8 Type,
IN EFI_IFR_TYPE_VALUE *Value,
OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest
)
{
UINTN Index;
if (QuestionId == QUESTION_ID_REFRESH_MANAGER || QuestionId == QUESTION_ID_REFRESH_CONFIGURE) {
if (Action == EFI_BROWSER_ACTION_FORM_OPEN) {
DriverHealthManagerUpdateForm ((BOOLEAN) (QuestionId == QUESTION_ID_REFRESH_CONFIGURE));
} else if (Action == EFI_BROWSER_ACTION_FORM_CLOSE) {
DriverHealthManagerCleanDynamicString ();
}
return EFI_SUCCESS;
}
修改为:
EFI_STATUS
EFIAPI
DriverHealthManagerCallback (
IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
IN EFI_BROWSER_ACTION Action,
IN EFI_QUESTION_ID QuestionId,
IN UINT8 Type,
IN EFI_IFR_TYPE_VALUE *Value,
OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest
)
{
UINTN Index;
if (QuestionId == QUESTION_ID_REFRESH_MANAGER || QuestionId == QUESTION_ID_REFRESH_CONFIGURE) {
if (Action == EFI_BROWSER_ACTION_FORM_OPEN) {
DriverHealthManagerUpdateForm ((BOOLEAN) (QuestionId == QUESTION_ID_REFRESH_CONFIGURE));
}
// } else if (Action == EFI_BROWSER_ACTION_FORM_CLOSE) {
// DriverHealthManagerCleanDynamicString ();
// }
return EFI_SUCCESS;
}