blob: b8bb83c20e700297f760965342680f8f045e9678 [file] [log] [blame]
lgao48069d492008-02-25 07:01:44 +00001/** @file
lgao4eceb3a42008-07-15 11:12:43 +00002 Provide generic extract guided section functions for Dxe phase.
lgao40fa00152007-09-30 09:01:06 +00003
myronporter58380e92010-06-30 00:13:25 +00004 Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
hhtian19388d22010-04-23 16:37:43 +00005 This program and the accompanying materials
lgao48069d492008-02-25 07:01:44 +00006 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
myronporter2fc59a02010-06-25 21:56:02 +00008 http://opensource.org/licenses/bsd-license.php.
lgao40fa00152007-09-30 09:01:06 +00009
lgao48069d492008-02-25 07:01:44 +000010 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
lgao40fa00152007-09-30 09:01:06 +000012
lgao48069d492008-02-25 07:01:44 +000013**/
lgao40fa00152007-09-30 09:01:06 +000014
15#include <PiDxe.h>
16
17#include <Library/DebugLib.h>
lgao40fa00152007-09-30 09:01:06 +000018#include <Library/BaseMemoryLib.h>
19#include <Library/MemoryAllocationLib.h>
20#include <Library/ExtractGuidedSectionLib.h>
21
lgao4de2314f2008-12-11 07:36:58 +000022#define EXTRACT_HANDLER_TABLE_SIZE 0x10
23
jji4fe467412008-10-30 05:58:52 +000024UINT32 mNumberOfExtractHandler = 0;
lgao4de2314f2008-12-11 07:36:58 +000025UINT32 mMaxNumberOfExtractHandler = 0;
lgao40fa00152007-09-30 09:01:06 +000026
lgao4de2314f2008-12-11 07:36:58 +000027GUID *mExtractHandlerGuidTable = NULL;
28EXTRACT_GUIDED_SECTION_DECODE_HANDLER *mExtractDecodeHandlerTable = NULL;
29EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER *mExtractGetInfoHandlerTable = NULL;
lgao40fa00152007-09-30 09:01:06 +000030
qhuang84754c982008-10-31 03:39:53 +000031/**
lgao4de2314f2008-12-11 07:36:58 +000032 Reallocates more global memory to store the registered guid and Handler list.
33
myronporter58380e92010-06-30 00:13:25 +000034 @retval RETURN_SUCCESS Reallocated more global memory space to store guid and function tables.
35 @retval RETURN_OUT_OF_RESOURCES Not enough memory to allocate.
lgao4de2314f2008-12-11 07:36:58 +000036**/
37RETURN_STATUS
38EFIAPI
39ReallocateExtractHandlerTable (
40 )
41{
42 //
43 // Reallocate memory for GuidTable
44 //
45 mExtractHandlerGuidTable = ReallocatePool (
46 mMaxNumberOfExtractHandler * sizeof (GUID),
47 (mMaxNumberOfExtractHandler + EXTRACT_HANDLER_TABLE_SIZE) * sizeof (GUID),
48 mExtractHandlerGuidTable
49 );
50
51 if (mExtractHandlerGuidTable == NULL) {
52 goto Done;
53 }
54
55 //
56 // Reallocate memory for Decode handler Table
57 //
58 mExtractDecodeHandlerTable = ReallocatePool (
59 mMaxNumberOfExtractHandler * sizeof (EXTRACT_GUIDED_SECTION_DECODE_HANDLER),
60 (mMaxNumberOfExtractHandler + EXTRACT_HANDLER_TABLE_SIZE) * sizeof (EXTRACT_GUIDED_SECTION_DECODE_HANDLER),
61 mExtractDecodeHandlerTable
62 );
63
64 if (mExtractDecodeHandlerTable == NULL) {
65 goto Done;
66 }
67
68 //
69 // Reallocate memory for GetInfo handler Table
70 //
71 mExtractGetInfoHandlerTable = ReallocatePool (
72 mMaxNumberOfExtractHandler * sizeof (EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER),
73 (mMaxNumberOfExtractHandler + EXTRACT_HANDLER_TABLE_SIZE) * sizeof (EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER),
74 mExtractGetInfoHandlerTable
75 );
76
77 if (mExtractGetInfoHandlerTable == NULL) {
78 goto Done;
79 }
80
81 //
82 // Increase max handler number
83 //
84 mMaxNumberOfExtractHandler = mMaxNumberOfExtractHandler + EXTRACT_HANDLER_TABLE_SIZE;
85 return RETURN_SUCCESS;
86
87Done:
88 if (mExtractHandlerGuidTable != NULL) {
89 FreePool (mExtractHandlerGuidTable);
90 }
91 if (mExtractDecodeHandlerTable != NULL) {
92 FreePool (mExtractDecodeHandlerTable);
93 }
94 if (mExtractGetInfoHandlerTable != NULL) {
95 FreePool (mExtractGetInfoHandlerTable);
96 }
97
98 return RETURN_OUT_OF_RESOURCES;
99}
100/**
qhuang80057fda2008-12-01 13:46:34 +0000101 Constructor allocates the global memory to store the registered guid and Handler list.
lgao40fa00152007-09-30 09:01:06 +0000102
103 @param ImageHandle The firmware allocated handle for the EFI image.
qhuang84754c982008-10-31 03:39:53 +0000104 @param SystemTable A pointer to the EFI System Table.
lgao40fa00152007-09-30 09:01:06 +0000105
myronporter58380e92010-06-30 00:13:25 +0000106 @retval RETURN_SUCCESS Allocated the global memory space to store guid and function tables.
107 @retval RETURN_OUT_OF_RESOURCES Not enough memory to allocate.
lgao40fa00152007-09-30 09:01:06 +0000108**/
109RETURN_STATUS
110EFIAPI
111DxeExtractGuidedSectionLibConstructor (
112 IN EFI_HANDLE ImageHandle,
113 IN EFI_SYSTEM_TABLE *SystemTable
114 )
115{
lgao4de2314f2008-12-11 07:36:58 +0000116 return ReallocateExtractHandlerTable ();
lgao40fa00152007-09-30 09:01:06 +0000117}
118
qhuang84754c982008-10-31 03:39:53 +0000119/**
jji4f1db45f2008-11-18 11:33:48 +0000120 Retrieve the list GUIDs that have been registered through ExtractGuidedSectionRegisterHandlers().
lgao40fa00152007-09-30 09:01:06 +0000121
jji4f1db45f2008-11-18 11:33:48 +0000122 Sets ExtractHandlerGuidTable so it points at a callee allocated array of registered GUIDs.
123 The total number of GUIDs in the array are returned. Since the array of GUIDs is callee allocated
124 and caller must treat this array of GUIDs as read-only data.
125 If ExtractHandlerGuidTable is NULL, then ASSERT().
126
qhuang80057fda2008-12-01 13:46:34 +0000127 @param[out] ExtractHandlerGuidTable A pointer to the array of GUIDs that have been registered through
jji4f1db45f2008-11-18 11:33:48 +0000128 ExtractGuidedSectionRegisterHandlers().
lgao40fa00152007-09-30 09:01:06 +0000129
myronporter58380e92010-06-30 00:13:25 +0000130 @return The number of the supported extract guided Handler.
jji4f1db45f2008-11-18 11:33:48 +0000131
lgao40fa00152007-09-30 09:01:06 +0000132**/
133UINTN
134EFIAPI
135ExtractGuidedSectionGetGuidList (
lgao4eceb3a42008-07-15 11:12:43 +0000136 OUT GUID **ExtractHandlerGuidTable
lgao40fa00152007-09-30 09:01:06 +0000137 )
138{
139 ASSERT (ExtractHandlerGuidTable != NULL);
140
141 *ExtractHandlerGuidTable = mExtractHandlerGuidTable;
142 return mNumberOfExtractHandler;
143}
144
qhuang84754c982008-10-31 03:39:53 +0000145/**
jji4f1db45f2008-11-18 11:33:48 +0000146 Registers handlers of type EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER and EXTRACT_GUIDED_SECTION_DECODE_HANDLER
147 for a specific GUID section type.
lgao40fa00152007-09-30 09:01:06 +0000148
qhuang80057fda2008-12-01 13:46:34 +0000149 Registers the handlers specified by GetInfoHandler and DecodeHandler with the GUID specified by SectionGuid.
jji4f1db45f2008-11-18 11:33:48 +0000150 If the GUID value specified by SectionGuid has already been registered, then return RETURN_ALREADY_STARTED.
151 If there are not enough resources available to register the handlers then RETURN_OUT_OF_RESOURCES is returned.
jji457209472008-12-05 08:21:57 +0000152
jji4f1db45f2008-11-18 11:33:48 +0000153 If SectionGuid is NULL, then ASSERT().
154 If GetInfoHandler is NULL, then ASSERT().
155 If DecodeHandler is NULL, then ASSERT().
qhuang84754c982008-10-31 03:39:53 +0000156
jji4f1db45f2008-11-18 11:33:48 +0000157 @param[in] SectionGuid A pointer to the GUID associated with the the handlers
158 of the GUIDed section type being registered.
myronporter2fc59a02010-06-25 21:56:02 +0000159 @param[in] GetInfoHandler The pointer to a function that examines a GUIDed section and returns the
jji4f1db45f2008-11-18 11:33:48 +0000160 size of the decoded buffer and the size of an optional scratch buffer
161 required to actually decode the data in a GUIDed section.
myronporter2fc59a02010-06-25 21:56:02 +0000162 @param[in] DecodeHandler The pointer to a function that decodes a GUIDed section into a caller
jji4f1db45f2008-11-18 11:33:48 +0000163 allocated output buffer.
164
165 @retval RETURN_SUCCESS The handlers were registered.
jji4f1db45f2008-11-18 11:33:48 +0000166 @retval RETURN_OUT_OF_RESOURCES There are not enough resources available to register the handlers.
167
lgao40fa00152007-09-30 09:01:06 +0000168**/
169RETURN_STATUS
170EFIAPI
171ExtractGuidedSectionRegisterHandlers (
172 IN CONST GUID *SectionGuid,
173 IN EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER GetInfoHandler,
174 IN EXTRACT_GUIDED_SECTION_DECODE_HANDLER DecodeHandler
175 )
176{
lgao4e2701212007-10-19 09:11:42 +0000177 UINT32 Index;
lgao40fa00152007-09-30 09:01:06 +0000178 //
179 // Check input paramter.
180 //
jji4f1db45f2008-11-18 11:33:48 +0000181 ASSERT (SectionGuid != NULL);
182 ASSERT (GetInfoHandler != NULL);
183 ASSERT (DecodeHandler != NULL);
lgao4e2701212007-10-19 09:11:42 +0000184
185 //
186 // Search the match registered GetInfo handler for the input guided section.
187 //
188 for (Index = 0; Index < mNumberOfExtractHandler; Index ++) {
189 if (CompareGuid (&mExtractHandlerGuidTable[Index], SectionGuid)) {
lgao4b911d092008-08-18 12:11:37 +0000190 //
191 // If the guided handler has been registered before, only update its handler.
192 //
193 mExtractDecodeHandlerTable [Index] = DecodeHandler;
194 mExtractGetInfoHandlerTable [Index] = GetInfoHandler;
195 return RETURN_SUCCESS;
lgao4e2701212007-10-19 09:11:42 +0000196 }
197 }
lgao4e2701212007-10-19 09:11:42 +0000198
lgao40fa00152007-09-30 09:01:06 +0000199 //
200 // Check the global table is enough to contain new Handler.
201 //
lgao4de2314f2008-12-11 07:36:58 +0000202 if (mNumberOfExtractHandler >= mMaxNumberOfExtractHandler) {
203 if (ReallocateExtractHandlerTable () != RETURN_SUCCESS) {
204 return RETURN_OUT_OF_RESOURCES;
205 }
lgao40fa00152007-09-30 09:01:06 +0000206 }
207
208 //
209 // Register new Handler and guid value.
210 //
211 CopyGuid (&mExtractHandlerGuidTable [mNumberOfExtractHandler], SectionGuid);
212 mExtractDecodeHandlerTable [mNumberOfExtractHandler] = DecodeHandler;
213 mExtractGetInfoHandlerTable [mNumberOfExtractHandler++] = GetInfoHandler;
214
215 return RETURN_SUCCESS;
216}
217
qhuang84754c982008-10-31 03:39:53 +0000218/**
qhuang80057fda2008-12-01 13:46:34 +0000219 Retrieves a GUID from a GUIDed section and uses that GUID to select an associated handler of type
jji4f1db45f2008-11-18 11:33:48 +0000220 EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER that was registered with ExtractGuidedSectionRegisterHandlers().
221 The selected handler is used to retrieve and return the size of the decoded buffer and the size of an
222 optional scratch buffer required to actually decode the data in a GUIDed section.
lgao40fa00152007-09-30 09:01:06 +0000223
jji4f1db45f2008-11-18 11:33:48 +0000224 Examines a GUIDed section specified by InputSection.
225 If GUID for InputSection does not match any of the GUIDs registered through ExtractGuidedSectionRegisterHandlers(),
226 then RETURN_UNSUPPORTED is returned.
227 If the GUID of InputSection does match the GUID that this handler supports, then the the associated handler
228 of type EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER that was registered with ExtractGuidedSectionRegisterHandlers()
229 is used to retrieve the OututBufferSize, ScratchSize, and Attributes values. The return status from the handler of
230 type EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER is returned.
klu2518db1d2008-12-10 03:14:49 +0000231
jji4f1db45f2008-11-18 11:33:48 +0000232 If InputSection is NULL, then ASSERT().
233 If OutputBufferSize is NULL, then ASSERT().
234 If ScratchBufferSize is NULL, then ASSERT().
235 If SectionAttribute is NULL, then ASSERT().
lgao40fa00152007-09-30 09:01:06 +0000236
jji4f1db45f2008-11-18 11:33:48 +0000237 @param[in] InputSection A pointer to a GUIDed section of an FFS formatted file.
238 @param[out] OutputBufferSize A pointer to the size, in bytes, of an output buffer required if the buffer
239 specified by InputSection were decoded.
240 @param[out] ScratchBufferSize A pointer to the size, in bytes, required as scratch space if the buffer specified by
241 InputSection were decoded.
242 @param[out] SectionAttribute A pointer to the attributes of the GUIDed section. See the Attributes field of
243 EFI_GUID_DEFINED_SECTION in the PI Specification.
qhuang84754c982008-10-31 03:39:53 +0000244
myronporter58380e92010-06-30 00:13:25 +0000245 @retval RETURN_SUCCESS Successfully obtained the required information.
jji4f1db45f2008-11-18 11:33:48 +0000246 @retval RETURN_UNSUPPORTED The GUID from the section specified by InputSection does not match any of
247 the GUIDs registered with ExtractGuidedSectionRegisterHandlers().
248 @retval Others The return status from the handler associated with the GUID retrieved from
249 the section specified by InputSection.
lgao40fa00152007-09-30 09:01:06 +0000250
251**/
252RETURN_STATUS
253EFIAPI
254ExtractGuidedSectionGetInfo (
255 IN CONST VOID *InputSection,
256 OUT UINT32 *OutputBufferSize,
257 OUT UINT32 *ScratchBufferSize,
258 OUT UINT16 *SectionAttribute
259 )
260{
261 UINT32 Index;
jji4f1db45f2008-11-18 11:33:48 +0000262
263 ASSERT (InputSection != NULL);
lgao40fa00152007-09-30 09:01:06 +0000264 ASSERT (OutputBufferSize != NULL);
265 ASSERT (ScratchBufferSize != NULL);
266 ASSERT (SectionAttribute != NULL);
267
268 //
269 // Search the match registered GetInfo handler for the input guided section.
270 //
271 for (Index = 0; Index < mNumberOfExtractHandler; Index ++) {
272 if (CompareGuid (&mExtractHandlerGuidTable[Index], &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) {
lgao4b911d092008-08-18 12:11:37 +0000273 //
274 // Call the match handler to getinfo for the input section data.
275 //
276 return mExtractGetInfoHandlerTable [Index] (
277 InputSection,
278 OutputBufferSize,
279 ScratchBufferSize,
280 SectionAttribute
281 );
lgao40fa00152007-09-30 09:01:06 +0000282 }
283 }
284
285 //
286 // Not found, the input guided section is not supported.
287 //
lgao4b911d092008-08-18 12:11:37 +0000288 return RETURN_UNSUPPORTED;
lgao40fa00152007-09-30 09:01:06 +0000289}
290
qhuang84754c982008-10-31 03:39:53 +0000291/**
qhuang80057fda2008-12-01 13:46:34 +0000292 Retrieves the GUID from a GUIDed section and uses that GUID to select an associated handler of type
jji4f1db45f2008-11-18 11:33:48 +0000293 EXTRACT_GUIDED_SECTION_DECODE_HANDLER that was registered with ExtractGuidedSectionRegisterHandlers().
294 The selected handler is used to decode the data in a GUIDed section and return the result in a caller
295 allocated output buffer.
lgao40fa00152007-09-30 09:01:06 +0000296
jji4f1db45f2008-11-18 11:33:48 +0000297 Decodes the GUIDed section specified by InputSection.
298 If GUID for InputSection does not match any of the GUIDs registered through ExtractGuidedSectionRegisterHandlers(),
299 then RETURN_UNSUPPORTED is returned.
300 If the GUID of InputSection does match the GUID that this handler supports, then the the associated handler
301 of type EXTRACT_GUIDED_SECTION_DECODE_HANDLER that was registered with ExtractGuidedSectionRegisterHandlers()
302 is used to decode InputSection into the buffer specified by OutputBuffer and the authentication status of this
303 decode operation is returned in AuthenticationStatus. If the decoded buffer is identical to the data in InputSection,
304 then OutputBuffer is set to point at the data in InputSection. Otherwise, the decoded data will be placed in caller
305 allocated buffer specified by OutputBuffer. This function is responsible for computing the EFI_AUTH_STATUS_PLATFORM_OVERRIDE
klu2518db1d2008-12-10 03:14:49 +0000306 bit of in AuthenticationStatus. The return status from the handler of type EXTRACT_GUIDED_SECTION_DECODE_HANDLER is returned.
307
jji4f1db45f2008-11-18 11:33:48 +0000308 If InputSection is NULL, then ASSERT().
309 If OutputBuffer is NULL, then ASSERT().
310 If ScratchBuffer is NULL and this decode operation requires a scratch buffer, then ASSERT().
311 If AuthenticationStatus is NULL, then ASSERT().
lgao40fa00152007-09-30 09:01:06 +0000312
jji4f1db45f2008-11-18 11:33:48 +0000313 @param[in] InputSection A pointer to a GUIDed section of an FFS formatted file.
314 @param[out] OutputBuffer A pointer to a buffer that contains the result of a decode operation.
315 @param[in] ScratchBuffer A caller allocated buffer that may be required by this function as a scratch buffer to perform the decode operation.
lgao40fa00152007-09-30 09:01:06 +0000316 @param[out] AuthenticationStatus
jji4f1db45f2008-11-18 11:33:48 +0000317 A pointer to the authentication status of the decoded output buffer. See the definition
318 of authentication status in the EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI section of the PI
319 Specification.
qhuang84754c982008-10-31 03:39:53 +0000320
jji4f1db45f2008-11-18 11:33:48 +0000321 @retval RETURN_SUCCESS The buffer specified by InputSection was decoded.
322 @retval RETURN_UNSUPPORTED The section specified by InputSection does not match the GUID this handler supports.
323 @retval RETURN_INVALID_PARAMETER The section specified by InputSection can not be decoded.
qhuang84754c982008-10-31 03:39:53 +0000324
lgao40fa00152007-09-30 09:01:06 +0000325**/
326RETURN_STATUS
327EFIAPI
328ExtractGuidedSectionDecode (
329 IN CONST VOID *InputSection,
330 OUT VOID **OutputBuffer,
jji4f1db45f2008-11-18 11:33:48 +0000331 IN VOID *ScratchBuffer, OPTIONAL
lgao40fa00152007-09-30 09:01:06 +0000332 OUT UINT32 *AuthenticationStatus
333 )
334{
335 UINT32 Index;
336
lgao4eceb3a42008-07-15 11:12:43 +0000337 //
338 // Check the input parameters
339 //
jji4f1db45f2008-11-18 11:33:48 +0000340 ASSERT (InputSection != NULL);
lgao40fa00152007-09-30 09:01:06 +0000341 ASSERT (OutputBuffer != NULL);
342 ASSERT (AuthenticationStatus != NULL);
343
344 //
lgao4eceb3a42008-07-15 11:12:43 +0000345 // Search the match registered extract handler for the input guided section.
lgao40fa00152007-09-30 09:01:06 +0000346 //
347 for (Index = 0; Index < mNumberOfExtractHandler; Index ++) {
348 if (CompareGuid (&mExtractHandlerGuidTable[Index], &(((EFI_GUID_DEFINED_SECTION *) InputSection)->SectionDefinitionGuid))) {
lgao4b911d092008-08-18 12:11:37 +0000349 //
350 // Call the match handler to extract raw data for the input section data.
351 //
352 return mExtractDecodeHandlerTable [Index] (
353 InputSection,
354 OutputBuffer,
355 ScratchBuffer,
356 AuthenticationStatus
357 );
lgao40fa00152007-09-30 09:01:06 +0000358 }
359 }
360
361 //
362 // Not found, the input guided section is not supported.
363 //
lgao4b911d092008-08-18 12:11:37 +0000364 return RETURN_UNSUPPORTED;
lgao40fa00152007-09-30 09:01:06 +0000365}
ydong109be899c2010-11-04 05:51:32 +0000366
367/**
368 Retrieves handlers of type EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER and
369 EXTRACT_GUIDED_SECTION_DECODE_HANDLER for a specific GUID section type.
370
371 Retrieves the handlers associated with SectionGuid and returns them in
372 GetInfoHandler and DecodeHandler.
373
374 If the GUID value specified by SectionGuid has not been registered, then
375 return RETURN_NOT_FOUND.
376
377 If SectionGuid is NULL, then ASSERT().
378
379 @param[in] SectionGuid A pointer to the GUID associated with the handlersof the GUIDed
380 section type being retrieved.
381 @param[out] GetInfoHandler Pointer to a function that examines a GUIDed section and returns
382 the size of the decoded buffer and the size of an optional scratch
383 buffer required to actually decode the data in a GUIDed section.
384 This is an optional parameter that may be NULL. If it is NULL, then
385 the previously registered handler is not returned.
386 @param[out] DecodeHandler Pointer to a function that decodes a GUIDed section into a caller
387 allocated output buffer. This is an optional parameter that may be NULL.
388 If it is NULL, then the previously registered handler is not returned.
389
390 @retval RETURN_SUCCESS The handlers were retrieved.
391 @retval RETURN_NOT_FOUND No handlers have been registered with the specified GUID.
392
393**/
394RETURN_STATUS
395EFIAPI
396ExtractGuidedSectionGetHandlers (
397 IN CONST GUID *SectionGuid,
398 OUT EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER *GetInfoHandler, OPTIONAL
399 OUT EXTRACT_GUIDED_SECTION_DECODE_HANDLER *DecodeHandler OPTIONAL
400 )
401{
402 UINT32 Index;
403
404 //
405 // Check input parameter.
406 //
407 ASSERT (SectionGuid != NULL);
408
409 //
410 // Search the match registered GetInfo handler for the input guided section.
411 //
412 for (Index = 0; Index < mNumberOfExtractHandler; Index ++) {
413 if (CompareGuid (&mExtractHandlerGuidTable[Index], SectionGuid)) {
414
415 //
416 // If the guided handler has been registered before, then return the registered handlers.
417 //
418 if (GetInfoHandler != NULL) {
419 *GetInfoHandler = mExtractGetInfoHandlerTable[Index];
420 }
421 if (DecodeHandler != NULL) {
422 *DecodeHandler = mExtractDecodeHandlerTable[Index];
423 }
424 return RETURN_SUCCESS;
425 }
426 }
427 return RETURN_NOT_FOUND;
428}