]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c
IntelSiliconPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Application / MemoryProfileInfo / MemoryProfileInfo.c
index 14e89347c6db5fa366e90928bdc794edb5841953..072ae72dcd7614295e602e83c2bf0821145c8ceb 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-  Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2014 - 2017, 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
@@ -249,8 +249,8 @@ GetDriverNameString (
   //\r
   // Method 1: Get the name string from image PDB\r
   //\r
-  if (DriverInfo->Header.Length > sizeof (MEMORY_PROFILE_DRIVER_INFO)) {\r
-    GetShortPdbFileName ((CHAR8 *) (DriverInfo + 1), mNameString);\r
+  if (DriverInfo->PdbStringOffset != 0) {\r
+    GetShortPdbFileName ((CHAR8 *) ((UINTN) DriverInfo + DriverInfo->PdbStringOffset), mNameString);\r
     return mNameString;\r
   }\r
 \r
@@ -343,16 +343,16 @@ ProfileActionToStr (
 \r
   if (IsForSmm) {\r
     ActionString = mSmmActionString;\r
-    ActionStringCount = sizeof (mSmmActionString) / sizeof (mSmmActionString[0]);\r
+    ActionStringCount = ARRAY_SIZE (mSmmActionString);\r
   } else {\r
     ActionString = mActionString;\r
-    ActionStringCount = sizeof (mActionString) / sizeof (mActionString[0]);\r
+    ActionStringCount = ARRAY_SIZE (mActionString);\r
   }\r
 \r
   if ((UINTN) (UINT32) Action < ActionStringCount) {\r
     return ActionString[Action];\r
   }\r
-  for (Index = 0; Index < sizeof (mExtActionString) / sizeof (mExtActionString[0]); Index++) {\r
+  for (Index = 0; Index < ARRAY_SIZE (mExtActionString); Index++) {\r
     if (mExtActionString[Index].Action == Action) {\r
       return mExtActionString[Index].String;\r
     }\r