From d88f86f154ddbe39355fcf0aca03438f219b2660 Mon Sep 17 00:00:00 2001 From: ydong10 Date: Fri, 20 May 2011 01:33:42 +0000 Subject: Refine all R9 call back function to return EFI_UNSUPPORTED for all unsupported call back type. Signed-off-by: ydong10 Reviewed-by: lgao4 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11681 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Universal/BdsDxe/DeviceMngr/DeviceManager.c | 69 +++++++++++----------- 1 file changed, 34 insertions(+), 35 deletions(-) (limited to 'IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.c') diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.c b/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.c index 40d93c5ae0..1857ffa0a1 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.c +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.c @@ -141,37 +141,36 @@ DeviceManagerCallback ( ) { UINTN CurIndex; + + if (Action == EFI_BROWSER_ACTION_CHANGING) { + if ((Value == NULL) || (ActionRequest == NULL)) { + return EFI_INVALID_PARAMETER; + } + + gCallbackKey = QuestionId; + if ((QuestionId < MAX_KEY_SECTION_LEN + NETWORK_DEVICE_LIST_KEY_OFFSET) && (QuestionId >= NETWORK_DEVICE_LIST_KEY_OFFSET)) { + // + // If user select the mac address, need to record mac address string to support next form show. + // + for (CurIndex = 0; CurIndex < mMacDeviceList.CurListLen; CurIndex ++) { + if (mMacDeviceList.NodeList[CurIndex].QuestionId == QuestionId) { + mSelectedMacAddrString = HiiGetString (gDeviceManagerPrivate.HiiHandle, mMacDeviceList.NodeList[CurIndex].PromptId, NULL); + } + } + } - if ((Action == EFI_BROWSER_ACTION_FORM_OPEN) || (Action == EFI_BROWSER_ACTION_FORM_CLOSE)) { // - // Do nothing for UEFI OPEN/CLOSE Action + // Request to exit SendForm(), so as to switch to selected form // - return EFI_SUCCESS; - } + *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT; - if ((Value == NULL) || (ActionRequest == NULL)) { - return EFI_INVALID_PARAMETER; + return EFI_SUCCESS; } - gCallbackKey = QuestionId; - - if ((QuestionId < MAX_KEY_SECTION_LEN + NETWORK_DEVICE_LIST_KEY_OFFSET) && (QuestionId >= NETWORK_DEVICE_LIST_KEY_OFFSET)) { - // - // If user select the mac address, need to record mac address string to support next form show. - // - for (CurIndex = 0; CurIndex < mMacDeviceList.CurListLen; CurIndex ++) { - if (mMacDeviceList.NodeList[CurIndex].QuestionId == QuestionId) { - mSelectedMacAddrString = HiiGetString (gDeviceManagerPrivate.HiiHandle, mMacDeviceList.NodeList[CurIndex].PromptId, NULL); - } - } - } - // - // Request to exit SendForm(), so as to switch to selected form + // All other action return unsupported. // - *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT; - - return EFI_SUCCESS; + return EFI_UNSUPPORTED; } /** @@ -1109,25 +1108,25 @@ DriverHealthCallback ( OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest ) { - if ((Action == EFI_BROWSER_ACTION_FORM_OPEN) || (Action == EFI_BROWSER_ACTION_FORM_CLOSE)) { + if (Action == EFI_BROWSER_ACTION_CHANGING) { + if ((Value == NULL) || (ActionRequest == NULL)) { + return EFI_INVALID_PARAMETER; + } + + gCallbackKey = QuestionId; + // - // Do nothing for UEFI OPEN/CLOSE Action + // Request to exit SendForm(), so as to switch to selected form // - return EFI_SUCCESS; - } + *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT; - if ((Value == NULL) || (ActionRequest == NULL)) { - return EFI_INVALID_PARAMETER; + return EFI_SUCCESS; } - gCallbackKey = QuestionId; - // - // Request to exit SendForm(), so as to switch to selected form + // All other action return unsupported. // - *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT; - - return EFI_SUCCESS; + return EFI_UNSUPPORTED; } /** -- cgit v1.2.3