//\r
// Check for invalid Interface\r
//\r
- if (Attributes != EFI_OPEN_PROTOCOL_TEST_PROTOCOL) {\r
- if (Interface == NULL) {\r
- return EFI_INVALID_PARAMETER;\r
- } else {\r
- *Interface = NULL;\r
- }\r
+ if ((Attributes != EFI_OPEN_PROTOCOL_TEST_PROTOCOL) && (Interface == NULL)) {\r
+ return EFI_INVALID_PARAMETER;\r
}\r
\r
//\r
Prot = CoreGetProtocolInterface (UserHandle, Protocol);\r
if (Prot == NULL) {\r
Status = EFI_UNSUPPORTED;\r
+ if (Attributes != EFI_OPEN_PROTOCOL_TEST_PROTOCOL){\r
+ //Return NULL Interface if Unsupported Protocol\r
+ *Interface = NULL;\r
+ }\r
goto Done;\r
}\r
\r
- //\r
- // This is the protocol interface entry for this protocol\r
- //\r
- if (Attributes != EFI_OPEN_PROTOCOL_TEST_PROTOCOL) {\r
- *Interface = Prot->Interface;\r
- }\r
Status = EFI_SUCCESS;\r
\r
ByDriver = FALSE;\r
}\r
\r
Done:\r
+\r
+ //\r
+ // This is the protocol interface entry for this protocol.\r
+ // In case of any Error, Interface should not be updated as per spec.\r
+ //\r
+ if (!EFI_ERROR (Status) && (Attributes != EFI_OPEN_PROTOCOL_TEST_PROTOCOL)) {\r
+ *Interface = Prot->Interface;\r
+ }\r
//\r
// Done. Release the database lock are return\r
//\r