TianoCore EDK2 master
Loading...
Searching...
No Matches
PlatformPKProtectionLibVarPolicy.c
Go to the documentation of this file.
1
8#include <Uefi.h>
9#include <Protocol/VariablePolicy.h>
10
11#include <Library/DebugLib.h>
13
28EFIAPI
30 VOID
31 )
32{
33 EFI_STATUS Status;
34 EDKII_VARIABLE_POLICY_PROTOCOL *VariablePolicy;
35
36 DEBUG ((DEBUG_INFO, "%a() Entry...\n", __func__));
37
38 // IMPORTANT NOTE: This operation is sticky and leaves variable protections disabled.
39 // The system *MUST* be reset after performing this operation.
40 Status = gBS->LocateProtocol (&gEdkiiVariablePolicyProtocolGuid, NULL, (VOID **)&VariablePolicy);
41 if (!EFI_ERROR (Status)) {
42 Status = VariablePolicy->DisableVariablePolicy ();
43 // EFI_ALREADY_STARTED means that everything is currently disabled.
44 // This should be considered SUCCESS.
45 if (Status == EFI_ALREADY_STARTED) {
46 Status = EFI_SUCCESS;
47 }
48 }
49
50 return Status;
51}
#define NULL
Definition: Base.h:319
#define DEBUG(Expression)
Definition: DebugLib.h:434
EFI_STATUS EFIAPI DisablePKProtection(VOID)
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
#define EFI_SUCCESS
Definition: UefiBaseType.h:112
EFI_BOOT_SERVICES * gBS