]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SecurityPkg/UserIdentification/UserProfileManagerDxe/ModifyAccessPolicy.c
SecurityPkg: Convert all .uni files to utf-8
[mirror_edk2.git] / SecurityPkg / UserIdentification / UserProfileManagerDxe / ModifyAccessPolicy.c
index 613751e0232a759bb0e5020849f36d78fa6f1be1..5b4171ddec1bca10281c91aadbbfab550827b6d8 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The functions for access policy modification.\r
     \r
-Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials \r
 are licensed and made available under the terms and conditions of the BSD License \r
 which accompanies this distribution.  The full text of the license may be found at \r
@@ -167,7 +167,7 @@ SaveAccessPolicy (
   //\r
   // Save access policy.\r
   //\r
-  if (mUserInfo.AccessPolicyModified && (mUserInfo.AccessPolicyLen > 0)) {\r
+  if (mUserInfo.AccessPolicyModified && (mUserInfo.AccessPolicyLen > 0) && (mUserInfo.AccessPolicy != NULL)) {\r
     Info = AllocateZeroPool (sizeof (EFI_USER_INFO) + mUserInfo.AccessPolicyLen);\r
     if (Info == NULL) {\r
       return ;\r
@@ -229,24 +229,10 @@ AddDevicePath (
   IN     VOID                                   *OpCodeHandle\r
   )\r
 {\r
-  EFI_STATUS                        Status;\r
   EFI_DEVICE_PATH_PROTOCOL          *Next;\r
   EFI_STRING_ID                     NameID;\r
   EFI_STRING                        DriverName;\r
-  EFI_DEVICE_PATH_TO_TEXT_PROTOCOL  *DevicePathText;\r
 \r
-  //\r
-  // Locate device path to text protocol.\r
-  //\r
-  Status = gBS->LocateProtocol (\r
-                  &gEfiDevicePathToTextProtocolGuid,\r
-                  NULL,\r
-                  (VOID **) &DevicePathText\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return ;\r
-  }\r
-  \r
   //\r
   // Get driver file name node.\r
   //\r
@@ -259,7 +245,7 @@ AddDevicePath (
   //\r
   // Display the device path in form.\r
   //\r
-  DriverName = DevicePathText->ConvertDevicePathToText (DevicePath, FALSE, FALSE);\r
+  DriverName = ConvertDevicePathToText (DevicePath, FALSE, FALSE);\r
   NameID = HiiSetString (mCallbackInfo->HiiHandle, 0, DriverName, NULL);\r
   FreePool (DriverName);\r
   if (NameID == 0) {\r
@@ -410,7 +396,7 @@ DisplayLoadPermit(
     // Get driver device path.\r
     //\r
     UnicodeSPrint (VarName, sizeof (VarName), L"Driver%04x", Order[Index]);\r
-    Var = GetEfiGlobalVariable (VarName);\r
+    GetEfiGlobalVariable2 (VarName, (VOID**)&Var, NULL);\r
     if (Var == NULL) {\r
       continue;\r
     }\r
@@ -655,7 +641,7 @@ AddToForbidLoad (
   // Get loadable driver device path.\r
   //\r
   UnicodeSPrint  (VarName, sizeof (VarName), L"Driver%04x", DriverIndex);\r
-  Var = GetEfiGlobalVariable (VarName);\r
+  GetEfiGlobalVariable2 (VarName, (VOID**)&Var, NULL);\r
   if (Var == NULL) {\r
     return;\r
   }\r