13.2.3 RunDiagnostics() as a UEFI Application

One useful design aspect of the Driver Diagnostics Protocol is implementation of diagnostics as a UEFI application stored with a device (i.e. PCI Option ROM) or in an EFI System Partition. To do so, change the implementation of RunDiagnostics()so it does not directly execute the diagnostics. yet would perform the same parameter checks as before and still retrieve the private context data structure. Then, instead of executing diagnostic algorithms, use the UEFI Boot Service LoadImage() and the UEFI Boot Service StartImage() to load and execute the UEFI application running the diagnostic algorithms. The application then returns the results of the diagnostics back to RunDiagnostics() and RunDiagnostics()returns the final results in the required format.