if (EFI_ERROR(Status)) {
UefiShellProtocol = NULL;
return EFI_SUCCESS;
}
}
if (UefiShellProtocol != NULL) {
//
// Sample to read UEFI Shell Major and Minor Version Variables
//
Print (L"UEFI Shell Revision: %d.%d\n", UefiShellProtocol->MajorVersion, UefiShellProtocol->MinorVersion);
//
// Sample to get list of all environment variables
//
ConstEnvNameList = UefiShellProtocol->GetEnv (NULL);
if (ConstEnvNameList == NULL) {
return EFI_SUCCESS;
}
Print (L"\n");
Print (L"ENVIRONMENT VARIABLES:\n");
Print (L"\n");
//
// Sample to get and display all environment variables
//
while (*ConstEnvNameList != CHAR_NULL){
Value = UefiShellProtocol->GetEnv (ConstEnvNameList);
Print (L"%8s = %s\n", ConstEnvNameList, Value);
ConstEnvNameList += StrLen (ConstEnvNameList)+1;
}
}
return EFI_SUCCESS;
}
76
Uso del modelo de programación UEFI
);