]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.h
pointer verification (not NULL) and buffer overrun fixes.
[mirror_edk2.git] / ShellPkg / Library / UefiShellDebug1CommandsLib / SmbiosView / QueryTable.h
index adacc41cf3cd50e9b47c7a39f4d340ac6c31a5e0..1022132f1046234fa2e79615ade8719c58378caa 100644 (file)
@@ -2,7 +2,7 @@
   Build a table, each item is (key, info) pair.\r
   and give a interface of query a string out of a table.\r
 \r
-  Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2005 - 2011, 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
@@ -37,12 +37,37 @@ typedef struct TABLE_ITEM {
     } \\r
   } while (0);\r
 \r
+/**\r
+  Given a table and a Key, return the responding info.\r
+\r
+  Notes:\r
+    Table[Index].Key is change from UINT8 to UINT16,\r
+    in order to deal with "0xaa - 0xbb".\r
+\r
+    For example:\r
+      DisplaySELVariableDataFormatTypes(UINT8 Type, UINT8 Option)\r
+    has a item:\r
+      "0x07-0x7F,   Unused"\r
+    Now define Key = 0x7F07, that is to say: High = 0x7F, Low = 0x07.\r
+    Then all the Key Value between Low and High gets the same string\r
+    L"Unused".\r
+\r
+  @param[in] Table    The begin address of table.\r
+  @param[in] Number   The number of table items.\r
+  @param[in] Key      The query Key.\r
+  @param[in,out] Info Input as empty buffer; output as data buffer.\r
+  @param[in] InfoLen  The max number of characters for Info.\r
+\r
+  @return the found Key and Info is valid.\r
+  @retval QUERY_TABLE_UNFOUND and Info should be NULL.\r
+**/\r
 UINT8\r
 QueryTable (\r
   IN  TABLE_ITEM    *Table,\r
   IN  UINTN         Number,\r
   IN  UINT8         Key,\r
-  IN  OUT CHAR16    *Info\r
+  IN  OUT CHAR16    *Info,\r
+  IN  UINTN         InfoLen\r
   );\r
 \r
 VOID\r