/** @file
The functions for access policy modification.
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "UserProfileManager.h"
/**
Collect all the access policy data to mUserInfo.AccessPolicy,
and save it to user profile.
**/
)
{
}
mUserInfo.AccessPolicyLen = 0;
OffSet = 0;
//
// Save access right.
//
Size = sizeof (EFI_USER_INFO_ACCESS_CONTROL);
}
//
// Save access setup.
//
}
}
//
// Save access of boot order.
//
}
CopyMem ((UINT8 *) (mUserInfo.AccessPolicy + OffSet), &mAccessInfo.AccessBootOrder, sizeof (UINT32));
//
// Save permit load.
//
if (mAccessInfo.LoadPermitLen > 0) {
}
}
//
// Save forbid load.
//
if (mAccessInfo.LoadForbidLen > 0) {
}
}
//
// Save permit connect.
//
if (mAccessInfo.ConnectPermitLen > 0) {
}
}
//
// Save forbid connect.
//
if (mAccessInfo.ConnectForbidLen > 0) {
}
}
//
// Save access policy.
//
if (mUserInfo.AccessPolicyModified && (mUserInfo.AccessPolicyLen > 0) && (mUserInfo.AccessPolicy != NULL)) {
return ;
}
&UserInfo,
Info,
);
}
}
}
}
}
}
}
/**
Create an action OpCode with QuestionID and DevicePath on a given OpCodeHandle.
@param[in] QuestionID The question ID.
@param[in] DevicePath Points to device path.
@param[in] OpCodeHandle Points to container for dynamic created opcodes.
**/
)
{
//
// Locate device path to text protocol.
//
NULL,
(VOID **) &DevicePathText
);
return ;
}
//
// Get driver file name node.
//
Next = DevicePath;
while (!IsDevicePathEnd (Next)) {
DevicePath = Next;
}
//
// Display the device path in form.
//
if (NameID == 0) {
return ;
}
OpCodeHandle, // Container for dynamic created opcodes
NameID, // Prompt text
0 // Action String ID
);
}
/**
Check whether the DevicePath is in the device path forbid list
(mAccessInfo.LoadForbid).
@param[in] DevicePath Points to device path.
@retval TRUE The DevicePath is in the device path forbid list.
@retval FALSE The DevicePath is not in the device path forbid list.
**/
)
{
OffSet = 0;
//
// Check each device path.
//
//
// Compare device path.
//
return TRUE;
}
}
return FALSE;
}
/**
Display the permit load device path in the loadable device path list.
**/
)
{
//
// Get DriverOrder.
//
OrderSize = 0;
L"DriverOrder",
NULL,
);
if (Status != EFI_BUFFER_TOO_SMALL) {
return ;
}
return ;
}
L"DriverOrder",
NULL,
);
return ;
}
//
// Initialize the container for dynamic opcodes.
//
//
// Create Hii Extend Label OpCode.
//
NULL,
sizeof (EFI_IFR_GUID_LABEL)
);
NULL,
sizeof (EFI_IFR_GUID_LABEL)
);
//
// Add each driver option.
//
//
// Get driver device path.
//
continue;
}
//
// Check whether the driver is already forbidden.
//
//
// Skip attribute.
//
//
// Skip device path lenth.
//
//
// Skip descript string.
//
continue;
}
);
}
&gUserProfileManagerGuid, // Formset GUID
FORMID_PERMIT_LOAD_DP, // Form ID
StartOpCodeHandle, // Label for where to insert opcodes
EndOpCodeHandle // Replace data
);
//
// Clear Environment.
//
}
}
/**
Display the forbid load device path list (mAccessInfo.LoadForbid).
**/
)
{
//
// Initialize the container for dynamic opcodes.
//
//
// Create Hii Extend Label OpCode.
//
NULL,
sizeof (EFI_IFR_GUID_LABEL)
);
NULL,
sizeof (EFI_IFR_GUID_LABEL)
);
//
// Add each forbid load drivers.
//
Offset = 0;
Index = 0;
Dp,
);
Index++;
}
&gUserProfileManagerGuid, // Formset GUID
FORMID_FORBID_LOAD_DP, // Form ID
StartOpCodeHandle, // Label for where to insert opcodes
EndOpCodeHandle // Replace data
);
}
/**
Display the permit connect device path.
**/
)
{
//
// Note:
// to verify the device path, just add a place holder for permitted connect
// device path.
//
}
/**
Display the forbid connect device path list.
**/
)
{
//
// Note:
// to verify the device path, just add a place holder for forbidden connect
// device path.
//
}
/**
Delete the specified device path by DriverIndex from the forbid device path
list (mAccessInfo.LoadForbid).
@param[in] DriverIndex The index of driver in forbidden device path list.
**/
)
{
OffSet = 0;
//
// Find the specified device path.
//
DriverIndex--;
}
//
// Specified device path found.
//
if (DriverIndex == 0) {
if (OffLen > 0) {
CopyMem (
);
}
}
}
/**
Add the specified device path by DriverIndex to the forbid device path
list (mAccessInfo.LoadForbid).
@param[in] DriverIndex The index of driver saved in driver options.
**/
)
{
//
// Get loadable driver device path.
//
return;
}
//
// Save forbid load driver.
//
//
// Skip attribute.
//
//
// Skip device path length.
//
//
// Skip description string.
//
return ;
}
if (mAccessInfo.LoadForbidLen > 0) {
}
}