]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkModulePkg/Universal/FirmwareVolume/FwVolDxe/FwVolRead.c
1. According to PI errata 0000840 and PI 1.2c Vol 3 3.2.3, remove description rows...
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / FirmwareVolume / FwVolDxe / FwVolRead.c
CommitLineData
c2df8e13 1/** @file\r
2 Implements functions to read firmware file.\r
3\r
23491d5c 4 Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
c2df8e13 5\r
6 This program and the accompanying materials\r
7 are licensed and made available under the terms and conditions\r
8 of the BSD License which accompanies this distribution. The\r
9 full text of the license may be found at\r
10 http://opensource.org/licenses/bsd-license.php\r
11\r
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
14\r
15**/\r
16\r
17#include "FwVolDriver.h"\r
18\r
5eddabfc
SZ
19/**\r
20Required Alignment Alignment Value in FFS Alignment Value in\r
21(bytes) Attributes Field Firmware Volume Interfaces\r
221 0 0\r
2316 1 4\r
24128 2 7\r
25512 3 9\r
261 KB 4 10\r
274 KB 5 12\r
2832 KB 6 15\r
2964 KB 7 16\r
30**/\r
31UINT8 mFvAttributes[] = {0, 4, 7, 9, 10, 12, 15, 16};\r
c2df8e13 32\r
33/**\r
34 Convert the FFS File Attributes to FV File Attributes.\r
35\r
36 @param FfsAttributes The attributes of UINT8 type.\r
37\r
38 @return The attributes of EFI_FV_FILE_ATTRIBUTES\r
39\r
40**/\r
41EFI_FV_FILE_ATTRIBUTES\r
42FfsAttributes2FvFileAttributes (\r
43 IN EFI_FFS_FILE_ATTRIBUTES FfsAttributes\r
44 )\r
45{\r
5eddabfc
SZ
46 UINT8 DataAlignment;\r
47 EFI_FV_FILE_ATTRIBUTES FileAttribute;\r
48\r
49 DataAlignment = (UINT8) ((FfsAttributes & FFS_ATTRIB_DATA_ALIGNMENT) >> 3);\r
50 ASSERT (DataAlignment < 8);\r
51\r
52 FileAttribute = (EFI_FV_FILE_ATTRIBUTES) mFvAttributes[DataAlignment];\r
53\r
54 if ((FfsAttributes & FFS_ATTRIB_FIXED) == FFS_ATTRIB_FIXED) {\r
55 FileAttribute |= EFI_FV_FILE_ATTRIB_FIXED;\r
56 }\r
57\r
58 return FileAttribute;\r
c2df8e13 59}\r
60\r
61/**\r
62 Given the input key, search for the next matching file in the volume.\r
63\r
64 @param This Indicates the calling context.\r
65 @param Key Key is a pointer to a caller allocated\r
66 buffer that contains implementation specific\r
67 data that is used to track where to begin\r
68 the search for the next file. The size of\r
69 the buffer must be at least This->KeySize\r
70 bytes long. To reinitialize the search and\r
71 begin from the beginning of the firmware\r
72 volume, the entire buffer must be cleared to\r
73 zero. Other than clearing the buffer to\r
74 initiate a new search, the caller must not\r
75 modify the data in the buffer between calls\r
76 to GetNextFile().\r
77 @param FileType FileType is a pointer to a caller allocated\r
78 EFI_FV_FILETYPE. The GetNextFile() API can\r
79 filter it's search for files based on the\r
80 value of *FileType input. A *FileType input\r
81 of 0 causes GetNextFile() to search for\r
82 files of all types. If a file is found, the\r
83 file's type is returned in *FileType.\r
84 *FileType is not modified if no file is\r
85 found.\r
86 @param NameGuid NameGuid is a pointer to a caller allocated\r
87 EFI_GUID. If a file is found, the file's\r
88 name is returned in *NameGuid. *NameGuid is\r
89 not modified if no file is found.\r
90 @param Attributes Attributes is a pointer to a caller\r
91 allocated EFI_FV_FILE_ATTRIBUTES. If a file\r
92 is found, the file's attributes are returned\r
93 in *Attributes. *Attributes is not modified\r
94 if no file is found.\r
95 @param Size Size is a pointer to a caller allocated\r
96 UINTN. If a file is found, the file's size\r
97 is returned in *Size. *Size is not modified\r
98 if no file is found.\r
99\r
100 @retval EFI_SUCCESS Successfully find the file.\r
101 @retval EFI_DEVICE_ERROR Device error.\r
102 @retval EFI_ACCESS_DENIED Fv could not read.\r
103 @retval EFI_NOT_FOUND No matching file found.\r
104 @retval EFI_INVALID_PARAMETER Invalid parameter\r
105\r
106**/\r
107EFI_STATUS\r
108EFIAPI\r
109FvGetNextFile (\r
110 IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,\r
111 IN OUT VOID *Key,\r
112 IN OUT EFI_FV_FILETYPE *FileType,\r
113 OUT EFI_GUID *NameGuid,\r
114 OUT EFI_FV_FILE_ATTRIBUTES *Attributes,\r
115 OUT UINTN *Size\r
116 )\r
117{\r
118 EFI_STATUS Status;\r
119 FV_DEVICE *FvDevice;\r
120 EFI_FV_ATTRIBUTES FvAttributes;\r
121 EFI_FFS_FILE_HEADER *FfsFileHeader;\r
122 UINTN *KeyValue;\r
123 LIST_ENTRY *Link;\r
124 FFS_FILE_LIST_ENTRY *FfsFileEntry;\r
c2df8e13 125\r
126 FvDevice = FV_DEVICE_FROM_THIS (This);\r
127\r
128 Status = This->GetVolumeAttributes (This, &FvAttributes);\r
129 if (EFI_ERROR (Status)) {\r
130 return Status;\r
131 }\r
132\r
133 KeyValue = (UINTN *) Key;\r
134 FfsFileHeader = NULL;\r
135\r
136 //\r
137 // Check if read operation is enabled\r
138 //\r
139 if ((FvAttributes & EFI_FV2_READ_STATUS) == 0) {\r
140 return EFI_ACCESS_DENIED;\r
141 }\r
142\r
143 if (*FileType > EFI_FV_FILETYPE_SMM_CORE) {\r
144 //\r
145 // File type needs to be in 0 - 0x0D\r
146 //\r
147 return EFI_NOT_FOUND;\r
148 }\r
149\r
150 do {\r
151 if (*KeyValue == 0) {\r
152 //\r
153 // Search for 1st matching file\r
154 //\r
155 Link = &FvDevice->FfsFileListHeader;\r
156 if (Link->ForwardLink == &FvDevice->FfsFileListHeader) {\r
157 return EFI_NOT_FOUND;\r
158 }\r
159\r
160 FfsFileEntry = (FFS_FILE_LIST_ENTRY *) Link->ForwardLink;\r
161 FfsFileHeader = (EFI_FFS_FILE_HEADER *) FfsFileEntry->FfsHeader;\r
162\r
163 //\r
164 // remember the key\r
165 //\r
166 *KeyValue = (UINTN) FfsFileEntry;\r
167\r
168 //\r
169 // we ignore pad files\r
170 //\r
171 if (FfsFileHeader->Type == EFI_FV_FILETYPE_FFS_PAD) {\r
172 continue;\r
173 }\r
174\r
175 if (*FileType == 0) {\r
176 break;\r
177 }\r
178\r
179 if (*FileType == FfsFileHeader->Type) {\r
180 break;\r
181 }\r
182\r
183 } else {\r
184 //\r
185 // Getting link from last Ffs\r
186 //\r
187 Link = (LIST_ENTRY *) (*KeyValue);\r
188 if (Link->ForwardLink == &FvDevice->FfsFileListHeader) {\r
189 return EFI_NOT_FOUND;\r
190 }\r
191\r
192 FfsFileEntry = (FFS_FILE_LIST_ENTRY *) Link->ForwardLink;\r
193 FfsFileHeader = (EFI_FFS_FILE_HEADER *) FfsFileEntry->FfsHeader;\r
194\r
195 //\r
196 // remember the key\r
197 //\r
198 *KeyValue = (UINTN) FfsFileEntry;\r
199\r
200 //\r
201 // we ignore pad files\r
202 //\r
203 if (FfsFileHeader->Type == EFI_FV_FILETYPE_FFS_PAD) {\r
204 continue;\r
205 }\r
206\r
207 if (*FileType == EFI_FV_FILETYPE_ALL) {\r
208 break;\r
209 }\r
210\r
211 if (*FileType == FfsFileHeader->Type) {\r
212 break;\r
213 }\r
214 }\r
215 } while (Link->ForwardLink != &FvDevice->FfsFileListHeader);\r
216\r
217 //\r
218 // Cache this file entry\r
219 //\r
220 FvDevice->CurrentFfsFile = FfsFileEntry;\r
221\r
222 *FileType = FfsFileHeader->Type;\r
223 CopyGuid (NameGuid, &FfsFileHeader->Name);\r
224 *Attributes = FfsAttributes2FvFileAttributes (FfsFileHeader->Attributes);\r
5eddabfc
SZ
225 if ((FvDevice->FwVolHeader->Attributes & EFI_FVB2_MEMORY_MAPPED) == EFI_FVB2_MEMORY_MAPPED) {\r
226 *Attributes |= EFI_FV_FILE_ATTRIB_MEMORY_MAPPED;\r
227 }\r
c2df8e13 228\r
c2df8e13 229 //\r
230 // we need to substract the header size\r
231 //\r
23491d5c
SZ
232 if (IS_FFS_FILE2 (FfsFileHeader)) {\r
233 *Size = FFS_FILE2_SIZE (FfsFileHeader) - sizeof (EFI_FFS_FILE_HEADER2);\r
234 } else {\r
235 *Size = FFS_FILE_SIZE (FfsFileHeader) - sizeof (EFI_FFS_FILE_HEADER);\r
236 }\r
c2df8e13 237\r
238 if (CompareGuid (&gEfiFirmwareVolumeTopFileGuid, NameGuid)) {\r
239 //\r
240 // specially deal with VTF file\r
241 //\r
242 UINT8 *SrcPtr;\r
243 UINT32 Tmp;\r
244\r
23491d5c
SZ
245 if (IS_FFS_FILE2 (FfsFileHeader)) {\r
246 SrcPtr = ((UINT8 *) FfsFileHeader) + sizeof (EFI_FFS_FILE_HEADER2);\r
247 } else {\r
248 SrcPtr = ((UINT8 *) FfsFileHeader) + sizeof (EFI_FFS_FILE_HEADER);\r
249 }\r
c2df8e13 250\r
251 while (*Size >= 4) {\r
252 Tmp = *(UINT32 *) SrcPtr;\r
253 if (Tmp == 0) {\r
254 SrcPtr += 4;\r
255 (*Size) -= 4;\r
256 } else {\r
257 break;\r
258 }\r
259 }\r
260 }\r
261\r
262 return EFI_SUCCESS;\r
263}\r
264\r
265/**\r
266 Locates a file in the firmware volume and\r
267 copies it to the supplied buffer.\r
268\r
269 @param This Indicates the calling context.\r
270 @param NameGuid Pointer to an EFI_GUID, which is the\r
271 filename.\r
272 @param Buffer Buffer is a pointer to pointer to a buffer\r
273 in which the file or section contents or are\r
274 returned.\r
275 @param BufferSize BufferSize is a pointer to caller allocated\r
276 UINTN. On input *BufferSize indicates the\r
277 size in bytes of the memory region pointed\r
278 to by Buffer. On output, *BufferSize\r
279 contains the number of bytes required to\r
280 read the file.\r
281 @param FoundType FoundType is a pointer to a caller allocated\r
282 EFI_FV_FILETYPE that on successful return\r
283 from Read() contains the type of file read.\r
284 This output reflects the file type\r
285 irrespective of the value of the SectionType\r
286 input.\r
287 @param FileAttributes FileAttributes is a pointer to a caller\r
288 allocated EFI_FV_FILE_ATTRIBUTES. On\r
289 successful return from Read(),\r
290 *FileAttributes contains the attributes of\r
291 the file read.\r
292 @param AuthenticationStatus AuthenticationStatus is a pointer to a\r
293 caller allocated UINTN in which the\r
294 authentication status is returned.\r
295\r
296 @retval EFI_SUCCESS Successfully read to memory buffer.\r
297 @retval EFI_WARN_BUFFER_TOO_SMALL Buffer too small.\r
298 @retval EFI_NOT_FOUND Not found.\r
299 @retval EFI_DEVICE_ERROR Device error.\r
300 @retval EFI_ACCESS_DENIED Could not read.\r
301 @retval EFI_INVALID_PARAMETER Invalid parameter.\r
302 @retval EFI_OUT_OF_RESOURCES Not enough buffer to be allocated.\r
303\r
304**/\r
305EFI_STATUS\r
306EFIAPI\r
307FvReadFile (\r
308 IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,\r
309 IN CONST EFI_GUID *NameGuid,\r
310 IN OUT VOID **Buffer,\r
311 IN OUT UINTN *BufferSize,\r
312 OUT EFI_FV_FILETYPE *FoundType,\r
313 OUT EFI_FV_FILE_ATTRIBUTES *FileAttributes,\r
314 OUT UINT32 *AuthenticationStatus\r
315 )\r
316{\r
317 EFI_STATUS Status;\r
318 FV_DEVICE *FvDevice;\r
319 UINTN Key;\r
320 EFI_GUID SearchNameGuid;\r
321 EFI_FV_ATTRIBUTES FvAttributes;\r
322 EFI_FV_FILETYPE LocalFoundType;\r
323 EFI_FV_FILE_ATTRIBUTES LocalAttributes;\r
324 UINTN FileSize;\r
325 UINT8 *SrcPtr;\r
326 FFS_FILE_LIST_ENTRY *FfsFileEntry;\r
327 EFI_FFS_FILE_HEADER *FfsHeader;\r
328 UINT8 *FileBuffer;\r
329\r
330 if (NULL == This || NULL == NameGuid) {\r
331 return EFI_INVALID_PARAMETER;\r
332 }\r
333\r
334 FvDevice = FV_DEVICE_FROM_THIS (This);\r
335\r
336 Status = This->GetVolumeAttributes (This, &FvAttributes);\r
337 if (EFI_ERROR (Status)) {\r
338 return Status;\r
339 }\r
340 //\r
341 // First check to see that FV is enabled for reads...\r
342 //\r
343 if (0 == (FvAttributes & EFI_FV2_READ_STATUS)) {\r
344 return EFI_ACCESS_DENIED;\r
345 }\r
346\r
347 FfsHeader = NULL;\r
348\r
349 //\r
350 // Check if the file was read last time.\r
351 //\r
352 FfsFileEntry = FvDevice->CurrentFfsFile;\r
353\r
354 if (FfsFileEntry != NULL) {\r
355 FfsHeader = (EFI_FFS_FILE_HEADER *) FfsFileEntry->FfsHeader;\r
356 }\r
357\r
358 if ((FfsFileEntry == NULL) || (!CompareGuid (&FfsHeader->Name, NameGuid))) {\r
359 //\r
360 // If not match or no file cached, search this file\r
361 //\r
362 Key = 0;\r
363 do {\r
364 LocalFoundType = 0;\r
365 Status = This->GetNextFile (\r
366 This,\r
367 &Key,\r
368 &LocalFoundType,\r
369 &SearchNameGuid,\r
370 &LocalAttributes,\r
371 &FileSize\r
372 );\r
373 if (EFI_ERROR (Status)) {\r
374 return EFI_NOT_FOUND;\r
375 }\r
376 } while (!CompareGuid (&SearchNameGuid, NameGuid));\r
377\r
378 //\r
379 // Get file entry\r
380 //\r
381 FfsFileEntry = (FFS_FILE_LIST_ENTRY *) Key;\r
382\r
383 //\r
384 // Update the cache\r
385 //\r
386 FvDevice->CurrentFfsFile = FfsFileEntry;\r
387\r
388 FfsHeader = (EFI_FFS_FILE_HEADER *) FfsFileEntry->FfsHeader;\r
389\r
390 } else {\r
391 //\r
392 // Get File Size of the cached file\r
393 //\r
23491d5c
SZ
394 if (IS_FFS_FILE2 (FfsHeader)) {\r
395 FileSize = FFS_FILE2_SIZE (FfsHeader) - sizeof (EFI_FFS_FILE_HEADER2);\r
396 } else {\r
397 FileSize = FFS_FILE_SIZE (FfsHeader) - sizeof (EFI_FFS_FILE_HEADER);\r
398 }\r
c2df8e13 399 }\r
400 //\r
401 // Get file info\r
402 //\r
403 *FoundType = FfsHeader->Type;\r
404 *FileAttributes = FfsAttributes2FvFileAttributes (FfsHeader->Attributes);\r
5eddabfc
SZ
405 if ((FvDevice->FwVolHeader->Attributes & EFI_FVB2_MEMORY_MAPPED) == EFI_FVB2_MEMORY_MAPPED) {\r
406 *FileAttributes |= EFI_FV_FILE_ATTRIB_MEMORY_MAPPED;\r
407 }\r
c2df8e13 408 *AuthenticationStatus = 0;\r
409\r
410 //\r
411 // If Buffer is NULL, we only want to get some information\r
412 //\r
413 if (Buffer == NULL) {\r
414 *BufferSize = FileSize;\r
415 return EFI_SUCCESS;\r
416 }\r
417\r
23491d5c
SZ
418 if (IS_FFS_FILE2 (FfsHeader)) {\r
419 SrcPtr = ((UINT8 *) FfsHeader) + sizeof (EFI_FFS_FILE_HEADER2);\r
420 } else {\r
421 SrcPtr = ((UINT8 *) FfsHeader) + sizeof (EFI_FFS_FILE_HEADER);\r
422 }\r
c2df8e13 423\r
424 if (CompareGuid (&gEfiFirmwareVolumeTopFileGuid, NameGuid)) {\r
425 //\r
426 // specially deal with VTF file\r
427 //\r
428 UINT32 Tmp;\r
429\r
430 while (FileSize >= 4) {\r
431 Tmp = *(UINT32 *) SrcPtr;\r
432 if (Tmp == 0) {\r
433 SrcPtr += 4;\r
434 FileSize -= 4;\r
435 } else {\r
436 break;\r
437 }\r
438 }\r
439 }\r
440 //\r
441 // If we drop out of the above loop, we've found the correct file header...\r
442 //\r
443 if (*Buffer == NULL) {\r
444 FileBuffer = AllocateCopyPool (FileSize, SrcPtr);\r
445 if (FileBuffer == NULL) {\r
446 return EFI_OUT_OF_RESOURCES;\r
447 }\r
448\r
449 *BufferSize = FileSize;\r
450 *Buffer = FileBuffer;\r
451\r
452 return EFI_SUCCESS;\r
453 }\r
454 //\r
455 // If the user's buffer is smaller than the file size, then copy as much\r
456 // as we can and return an appropriate status.\r
457 //\r
458 if (FileSize > *BufferSize) {\r
459 CopyMem (*Buffer, SrcPtr, *BufferSize);\r
460 *BufferSize = FileSize;\r
461 return EFI_WARN_BUFFER_TOO_SMALL;\r
462 }\r
463 //\r
464 // User's buffer size is ok, so copy the entire file to their buffer.\r
465 //\r
466 *BufferSize = FileSize;\r
467 CopyMem (*Buffer, SrcPtr, *BufferSize);\r
468\r
469 return EFI_SUCCESS;\r
470}\r
471\r
472/**\r
473 Locates a section in a given FFS File and\r
474 copies it to the supplied buffer (not including section header).\r
475\r
476 @param This Indicates the calling context.\r
477 @param NameGuid Pointer to an EFI_GUID, which is the\r
478 filename.\r
479 @param SectionType Indicates the section type to return.\r
480 @param SectionInstance Indicates which instance of sections with a\r
481 type of SectionType to return.\r
482 @param Buffer Buffer is a pointer to pointer to a buffer\r
483 in which the file or section contents or are\r
484 returned.\r
485 @param BufferSize BufferSize is a pointer to caller allocated\r
486 UINTN.\r
487 @param AuthenticationStatus AuthenticationStatus is a pointer to a\r
488 caller allocated UINT32 in which the\r
489 authentication status is returned.\r
490\r
491 @retval EFI_SUCCESS Successfully read the file section into\r
492 buffer.\r
493 @retval EFI_WARN_BUFFER_TOO_SMALL Buffer too small.\r
494 @retval EFI_NOT_FOUND Section not found.\r
495 @retval EFI_DEVICE_ERROR Device error.\r
496 @retval EFI_ACCESS_DENIED Could not read.\r
497 @retval EFI_INVALID_PARAMETER Invalid parameter.\r
498\r
499**/\r
500EFI_STATUS\r
501EFIAPI\r
502FvReadFileSection (\r
503 IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,\r
504 IN CONST EFI_GUID *NameGuid,\r
505 IN EFI_SECTION_TYPE SectionType,\r
506 IN UINTN SectionInstance,\r
507 IN OUT VOID **Buffer,\r
508 IN OUT UINTN *BufferSize,\r
509 OUT UINT32 *AuthenticationStatus\r
510 )\r
511{\r
512 EFI_STATUS Status;\r
513 EFI_FV_ATTRIBUTES FvAttributes;\r
514 EFI_FV_FILETYPE FileType;\r
515 EFI_FV_FILE_ATTRIBUTES FileAttributes;\r
516 UINTN FileSize;\r
517 UINT8 *FileBuffer;\r
518 EFI_SECTION_EXTRACTION_PROTOCOL *Sep;\r
519 UINTN StreamHandle;\r
520\r
521 if (NULL == This || NULL == NameGuid || Buffer == NULL) {\r
522 return EFI_INVALID_PARAMETER;\r
523 }\r
524\r
525 Status = This->GetVolumeAttributes (This, &FvAttributes);\r
526 if (EFI_ERROR (Status)) {\r
527 return Status;\r
528 }\r
529 //\r
530 // First check to see that FV is enabled for reads...\r
531 //\r
532 if (0 == (FvAttributes & EFI_FV2_READ_STATUS)) {\r
533 return EFI_ACCESS_DENIED;\r
534 }\r
535 //\r
536 // Read the whole file into buffer\r
537 //\r
538 FileBuffer = NULL;\r
539 Status = This->ReadFile (\r
540 This,\r
541 NameGuid,\r
542 (VOID **) &FileBuffer,\r
543 &FileSize,\r
544 &FileType,\r
545 &FileAttributes,\r
546 AuthenticationStatus\r
547 );\r
548\r
549 if (EFI_ERROR (Status)) {\r
550 return Status;\r
551 }\r
552 //\r
553 // Check to see that the file actually HAS sections before we go any further.\r
554 //\r
555 if (FileType == EFI_FV_FILETYPE_RAW) {\r
556 FreePool (FileBuffer);\r
557 return EFI_NOT_FOUND;\r
558 }\r
559 //\r
560 // Located the protocol\r
561 //\r
562 Status = gBS->LocateProtocol (\r
563 &gEfiSectionExtractionProtocolGuid,\r
564 NULL,\r
565 (VOID **) &Sep\r
566 );\r
567 if (EFI_ERROR (Status)) {\r
568 FreePool (FileBuffer);\r
569 return Status;\r
570 }\r
571\r
572 Status = Sep->OpenSectionStream (\r
573 Sep,\r
574 FileSize,\r
575 FileBuffer,\r
576 &StreamHandle\r
577 );\r
578\r
579 if (EFI_ERROR (Status)) {\r
580 FreePool (FileBuffer);\r
581 return Status;\r
582 }\r
583\r
584 if (SectionType == 0) {\r
585 //\r
586 // We need the whole section stream\r
587 //\r
588 Status = Sep->GetSection (\r
589 Sep,\r
590 StreamHandle,\r
591 NULL,\r
592 NULL,\r
593 0,\r
594 Buffer,\r
595 BufferSize,\r
596 AuthenticationStatus\r
597 );\r
598 } else {\r
599 Status = Sep->GetSection (\r
600 Sep,\r
601 StreamHandle,\r
602 &SectionType,\r
603 NULL,\r
604 SectionInstance,\r
605 Buffer,\r
606 BufferSize,\r
607 AuthenticationStatus\r
608 );\r
609 }\r
610 //\r
611 // Handle AuthenticationStatus if necessary\r
612 //\r
613 Sep->CloseSectionStream (Sep, StreamHandle);\r
614\r
615 FreePool (FileBuffer);\r
616\r
617 return Status;\r
618}\r