Current code is using debug message like below for
InstallProtocolInterface.
InstallProtocolInterface: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX XXX
User could not know whether the installation is failed or not by the
debug message, for example, the code below does not initialize Handle
before calling InstallProtocolInterface, EFI_INVALID_PARAMETER will be
returned.
EFI_HANDLE Handle;
Status = gBS->InstallProtocolInterface (
&Handle,
&XXX,
EFI_NATIVE_INTERFACE,
XXX
);
This patch is to add additional debug message if the installation
is failed and specific debug message for the case that the input
handle is invalid.
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
/** @file\r
UEFI handle & protocol handling.\r
\r
/** @file\r
UEFI handle & protocol handling.\r
\r
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
// in the system\r
//\r
InsertTailList (&gHandleList, &Handle->AllHandles);\r
// in the system\r
//\r
InsertTailList (&gHandleList, &Handle->AllHandles);\r
- }\r
-\r
- Status = CoreValidateHandle (Handle);\r
- if (EFI_ERROR (Status)) {\r
- goto Done;\r
+ } else {\r
+ Status = CoreValidateHandle (Handle);\r
+ if (EFI_ERROR (Status)) {\r
+ DEBUG((DEBUG_ERROR, "InstallProtocolInterface: input handle at 0x%x is invalid\n", Handle));\r
+ goto Done;\r
+ }\r
if (Prot != NULL) {\r
CoreFreePool (Prot);\r
}\r
if (Prot != NULL) {\r
CoreFreePool (Prot);\r
}\r
+ DEBUG((DEBUG_ERROR, "InstallProtocolInterface: %g %p failed with %r\n", Protocol, Interface, Status));\r
/** @file\r
SMM handle & protocol handling.\r
\r
/** @file\r
SMM handle & protocol handling.\r
\r
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials are licensed and made available \r
under the terms and conditions of the BSD License which accompanies this \r
distribution. The full text of the license may be found at \r
This program and the accompanying materials are licensed and made available \r
under the terms and conditions of the BSD License which accompanies this \r
distribution. The full text of the license may be found at \r
// in the system\r
//\r
InsertTailList (&gHandleList, &Handle->AllHandles);\r
// in the system\r
//\r
InsertTailList (&gHandleList, &Handle->AllHandles);\r
- }\r
-\r
- Status = SmmValidateHandle (Handle);\r
- if (EFI_ERROR (Status)) {\r
- goto Done;\r
+ } else {\r
+ Status = SmmValidateHandle (Handle);\r
+ if (EFI_ERROR (Status)) {\r
+ DEBUG((DEBUG_ERROR, "SmmInstallProtocolInterface: input handle at 0x%x is invalid\n", Handle));\r
+ goto Done;\r
+ }\r
if (Prot != NULL) {\r
FreePool (Prot);\r
}\r
if (Prot != NULL) {\r
FreePool (Prot);\r
}\r
+ DEBUG((DEBUG_ERROR, "SmmInstallProtocolInterface: %g %p failed with %r\n", Protocol, Interface, Status));\r