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
>
12
#include <
Library/UefiBootServicesTableLib.h
>
13
27
EFI_STATUS
28
EFIAPI
29
DisablePKProtection
(
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
}
NULL
#define NULL
Definition:
Base.h:319
DebugLib.h
DEBUG
#define DEBUG(Expression)
Definition:
DebugLib.h:434
DisablePKProtection
EFI_STATUS EFIAPI DisablePKProtection(VOID)
Definition:
PlatformPKProtectionLibVarPolicy.c:29
Uefi.h
EFI_STATUS
RETURN_STATUS EFI_STATUS
Definition:
UefiBaseType.h:29
EFI_SUCCESS
#define EFI_SUCCESS
Definition:
UefiBaseType.h:112
UefiBootServicesTableLib.h
gBS
EFI_BOOT_SERVICES * gBS
Definition:
UefiBootServicesTableLib.c:17
_EDKII_VARIABLE_POLICY_PROTOCOL
Definition:
VariablePolicy.h:261
SecurityPkg
Library
PlatformPKProtectionLibVarPolicy
PlatformPKProtectionLibVarPolicy.c
Generated on Fri Nov 15 2024 18:01:23 for TianoCore EDK2 by
1.9.6