-\r
- Status = gBS->OpenProtocolInformation (\r
- PciHandle,\r
- &gEfiPciIoProtocolGuid,\r
- &OpenInfoBuffer,\r
- &EntryCount\r
- );\r
- if (EFI_ERROR (Status)) {\r
- return FALSE;\r
- }\r
-\r
- for (Index = 0; Index < EntryCount; Index++) {\r
- //\r
- // Query all the children created by the GOP driver\r
- //\r
- if ((OpenInfoBuffer[Index].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) {\r
- Status = gBS->OpenProtocol (\r
- OpenInfoBuffer[Index].ControllerHandle,\r
- &gEfiDevicePathProtocolGuid,\r
- (VOID **) &ChildDevicePath,\r
- NULL,\r
- NULL,\r
- EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
- );\r
- if (!EFI_ERROR (Status)) {\r
- //\r
- // Append the device path to ConOutDev and ErrOutDev\r
- //\r
- ConPlatformUpdateDeviceVariable (L"ConOutDev", ChildDevicePath, Append);\r
- ConPlatformUpdateDeviceVariable (L"ErrOutDev", ChildDevicePath, Append);\r
- }\r
- }\r
+ TempDevicePath = EfiBootManagerGetGopDevicePath (PciHandle);\r
+ if (TempDevicePath != NULL) {\r
+ ConPlatformUpdateDeviceVariable (L"ConOutDev", TempDevicePath, Append);\r
+ ConPlatformUpdateDeviceVariable (L"ErrOutDev", TempDevicePath, Append);\r