- if (BdsLibMatchDevicePaths (VarConsole, ExclusiveDevicePath)) {\r
-\r
- Instance = GetNextDevicePathInstance (&VarConsole, &DevicePathSize);\r
-\r
- while (VarConsole != NULL) {\r
- if (CompareMem (\r
- Instance,\r
- ExclusiveDevicePath,\r
- DevicePathSize - sizeof (EFI_DEVICE_PATH_PROTOCOL)\r
- ) == 0) {\r
- //\r
- // Remove the match part\r
- //\r
- NewDevicePath = AppendDevicePathInstance (NewDevicePath, VarConsole);\r
- break;\r
- } else {\r
- //\r
- // Continue the next instance\r
- //\r
- NewDevicePath = AppendDevicePathInstance (NewDevicePath, Instance);\r
- }\r
-\r
- Instance = GetNextDevicePathInstance (&VarConsole, &DevicePathSize);\r
- }\r
- //\r
- // Reset the console variable with new device path\r
- //\r
- gRT->SetVariable (\r
- ConVarName,\r
- &gEfiGlobalVariableGuid,\r
- EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,\r
- GetDevicePathSize (NewDevicePath),\r
- NewDevicePath\r
- );\r
- }\r