TianoCore EDK2 master
Loading...
Searching...
No Matches
ShellManParser.c
Go to the documentation of this file.
1
10#include "Shell.h"
11
12#define SHELL_MAN_HII_GUID \
13{ \
14 0xf62ccd0c, 0x2449, 0x453c, { 0x8a, 0xcb, 0x8c, 0xc5, 0x7c, 0xf0, 0x2a, 0x97 } \
15}
16
17EFI_HII_HANDLE mShellManHiiHandle = NULL;
18EFI_HANDLE mShellManDriverHandle = NULL;
19
20SHELL_MAN_HII_VENDOR_DEVICE_PATH mShellManHiiDevicePath = {
21 {
22 {
25 {
26 (UINT8)(sizeof (VENDOR_DEVICE_PATH)),
27 (UINT8)((sizeof (VENDOR_DEVICE_PATH)) >> 8)
28 }
29 },
30 SHELL_MAN_HII_GUID
31 },
32 {
33 END_DEVICE_PATH_TYPE,
34 END_ENTIRE_DEVICE_PATH_SUBTYPE,
35 {
36 (UINT8)(END_DEVICE_PATH_LENGTH),
37 (UINT8)((END_DEVICE_PATH_LENGTH) >> 8)
38 }
39 }
40};
41
52CHAR16 *
54 IN CONST CHAR16 *NameString
55 )
56{
57 CHAR16 *Buffer;
58 CHAR16 *SuffixStr;
59
60 if (NameString == NULL) {
61 return (NULL);
62 }
63
64 //
65 // Fix the file name
66 //
67 if (StrnCmp (NameString+StrLen (NameString)-StrLen (L".efi"), L".efi", StrLen (L".efi")) == 0) {
68 Buffer = AllocateCopyPool (StrSize (NameString), NameString);
69 } else if (StrnCmp (NameString+StrLen (NameString)-StrLen (L".man"), L".man", StrLen (L".man")) == 0) {
70 Buffer = AllocateCopyPool (StrSize (NameString), NameString);
71 if (Buffer != NULL) {
72 SuffixStr = Buffer+StrLen (Buffer)-StrLen (L".man");
73 StrnCpyS (SuffixStr, StrSize (L".man")/sizeof (CHAR16), L".efi", StrLen (L".efi"));
74 }
75 } else {
76 Buffer = AllocateZeroPool (StrSize (NameString) + StrLen (L".efi")*sizeof (CHAR16));
77 if (Buffer != NULL) {
78 StrnCpyS (
79 Buffer,
80 (StrSize (NameString) + StrLen (L".efi")*sizeof (CHAR16))/sizeof (CHAR16),
81 NameString,
82 StrLen (NameString)
83 );
84 StrnCatS (
85 Buffer,
86 (StrSize (NameString) + StrLen (L".efi")*sizeof (CHAR16))/sizeof (CHAR16),
87 L".efi",
88 StrLen (L".efi")
89 );
90 }
91 }
92
93 return (Buffer);
94}
95
107CHAR16 *
109 IN CONST CHAR16 *ManFileName
110 )
111{
112 CHAR16 *Buffer;
113
114 if (ManFileName == NULL) {
115 return (NULL);
116 }
117
118 //
119 // Fix the file name
120 //
121 if (StrnCmp (ManFileName+StrLen (ManFileName)-4, L".man", 4) == 0) {
122 Buffer = AllocateCopyPool (StrSize (ManFileName), ManFileName);
123 } else {
124 Buffer = AllocateZeroPool (StrSize (ManFileName) + 4*sizeof (CHAR16));
125 if (Buffer != NULL) {
126 StrnCpyS (
127 Buffer,
128 (StrSize (ManFileName) + 4*sizeof (CHAR16))/sizeof (CHAR16),
129 ManFileName,
130 StrLen (ManFileName)
131 );
132 StrnCatS (
133 Buffer,
134 (StrSize (ManFileName) + 4*sizeof (CHAR16))/sizeof (CHAR16),
135 L".man",
136 4
137 );
138 }
139 }
140
141 return (Buffer);
142}
143
160 IN CONST CHAR16 *FileName,
161 OUT SHELL_FILE_HANDLE *Handle
162 )
163{
164 CHAR16 *FullFileName;
165 EFI_STATUS Status;
166
167 if ( (FileName == NULL)
168 || (Handle == NULL)
169 || (StrLen (FileName) == 0)
170 )
171 {
172 return (EFI_INVALID_PARAMETER);
173 }
174
175 FullFileName = ShellFindFilePath (FileName);
176 if (FullFileName == NULL) {
177 return (EFI_NOT_FOUND);
178 }
179
180 //
181 // now open that file
182 //
183 Status = EfiShellOpenFileByName (FullFileName, Handle, EFI_FILE_MODE_READ);
184 FreePool (FullFileName);
185
186 return (Status);
187}
188
209 IN SHELL_FILE_HANDLE Handle,
210 IN CONST CHAR16 *Sections,
211 OUT CHAR16 **HelpText,
212 OUT UINTN *HelpSize,
213 IN BOOLEAN Ascii
214 )
215{
216 EFI_STATUS Status;
217 CHAR16 *ReadLine;
218 UINTN Size;
219 BOOLEAN CurrentlyReading;
220 CHAR16 *SectionName;
221 UINTN SectionLen;
222 BOOLEAN Found;
223
224 if ( (Handle == NULL)
225 || (HelpText == NULL)
226 || (HelpSize == NULL)
227 )
228 {
229 return (EFI_INVALID_PARAMETER);
230 }
231
232 Status = EFI_SUCCESS;
233 CurrentlyReading = FALSE;
234 Size = 1024;
235 Found = FALSE;
236
237 ReadLine = AllocateZeroPool (Size);
238 if (ReadLine == NULL) {
239 return (EFI_OUT_OF_RESOURCES);
240 }
241
242 for ( ; !ShellFileHandleEof (Handle); Size = 1024) {
243 Status = ShellFileHandleReadLine (Handle, ReadLine, &Size, TRUE, &Ascii);
244 if (ReadLine[0] == L'#') {
245 //
246 // Skip comment lines
247 //
248 continue;
249 }
250
251 //
252 // ignore too small of buffer...
253 //
254 if (Status == EFI_BUFFER_TOO_SMALL) {
255 Status = EFI_SUCCESS;
256 }
257
258 if (EFI_ERROR (Status)) {
259 break;
260 } else if (StrnCmp (ReadLine, L".TH", 3) == 0) {
261 //
262 // we hit the end of this commands section so stop.
263 //
264 break;
265 } else if (StrnCmp (ReadLine, L".SH", 3) == 0) {
266 if (Sections == NULL) {
267 CurrentlyReading = TRUE;
268 continue;
269 }
270
271 //
272 // we found a section
273 //
274 if (CurrentlyReading) {
275 CurrentlyReading = FALSE;
276 }
277
278 //
279 // is this a section we want to read in?
280 //
281 for ( SectionName = ReadLine + 3
282 ; *SectionName == L' '
283 ; SectionName++)
284 {
285 }
286
287 SectionLen = StrLen (SectionName);
288 SectionName = StrStr (Sections, SectionName);
289 if (SectionName == NULL) {
290 continue;
291 }
292
293 if ((*(SectionName + SectionLen) == CHAR_NULL) || (*(SectionName + SectionLen) == L',')) {
294 CurrentlyReading = TRUE;
295 }
296 } else if (CurrentlyReading) {
297 Found = TRUE;
298 //
299 // copy and save the current line.
300 //
301 ASSERT ((*HelpText == NULL && *HelpSize == 0) || (*HelpText != NULL));
302 StrnCatGrow (HelpText, HelpSize, ReadLine, 0);
303 StrnCatGrow (HelpText, HelpSize, L"\r\n", 0);
304 }
305 }
306
307 FreePool (ReadLine);
308 if (!Found && !EFI_ERROR (Status)) {
309 return (EFI_NOT_FOUND);
310 }
311
312 return (Status);
313}
314
336BOOLEAN
338 IN CONST CHAR16 *Command,
339 IN CHAR16 *Line,
340 OUT CHAR16 **BriefDesc OPTIONAL,
341 OUT UINTN *BriefSize OPTIONAL,
342 OUT BOOLEAN *Found
343 )
344{
345 // The states of a simple state machine used to recognize a title header line
346 // and to extract the Short Description, if desired.
347 typedef enum {
348 LookForThMacro, LookForCommandName, CompareCommands, GetBriefDescription, Final
349 } STATEVALUES;
350
351 STATEVALUES State;
352 UINTN CommandIndex; // Indexes Command as we compare its chars to the MAN file.
353 BOOLEAN ReturnValue; // TRUE if this the Title Header line of *some* MAN file.
354 BOOLEAN ReturnFound; // TRUE if this the Title Header line of *the desired* MAN file.
355
356 ReturnValue = FALSE;
357 ReturnFound = FALSE;
358 CommandIndex = 0;
359 State = LookForThMacro;
360
361 do {
362 if (*Line == L'\0') {
363 break;
364 }
365
366 switch (State) {
367 // Handle "^\s*.TH\s"
368 // Go to state LookForCommandName if the title header macro is present; otherwise,
369 // eat white space. If we see something other than white space, this is not a
370 // title header line.
371 case LookForThMacro:
372 if ((StrnCmp (L".TH ", Line, 4) == 0) || (StrnCmp (L".TH\t", Line, 4) == 0)) {
373 Line += 4;
374 State = LookForCommandName;
375 } else if ((*Line == L' ') || (*Line == L'\t')) {
376 Line++;
377 } else {
378 State = Final;
379 }
380
381 break;
382
383 // Handle "\s*"
384 // Eat any "extra" whitespace after the title header macro (we have already seen
385 // at least one white space character). Go to state CompareCommands when a
386 // non-white space is seen.
387 case LookForCommandName:
388 if ((*Line == L' ') || (*Line == L'\t')) {
389 Line++;
390 } else {
391 ReturnValue = TRUE; // This is *some* command's title header line.
392 State = CompareCommands;
393 // Do not increment Line; it points to the first character of the command
394 // name on the title header line.
395 }
396
397 break;
398
399 // Handle "(\S)\s"
400 // Compare Command to the title header command name, ignoring case. When we
401 // reach the end of the command (i.e. we see white space), the next state
402 // depends on whether the caller wants a copy of the Brief Description.
403 case CompareCommands:
404 if ((*Line == L' ') || (*Line == L'\t')) {
405 ReturnFound = TRUE; // This is the desired command's title header line.
406 State = (BriefDesc == NULL) ? Final : GetBriefDescription;
407 } else if (CharToUpper (*Line) != CharToUpper (*(Command + CommandIndex++))) {
408 State = Final;
409 }
410
411 Line++;
412 break;
413
414 // Handle "[\s01]*(.*)$"
415 // Skip whitespace, '0', and '1' characters, if any, prior to the brief description.
416 // Return the description to the caller.
417 case GetBriefDescription:
418 if ((*Line != L' ') && (*Line != L'\t') && (*Line != L'0') && (*Line != L'1')) {
419 *BriefSize = StrSize (Line);
420 *BriefDesc = AllocateZeroPool (*BriefSize);
421 if (*BriefDesc != NULL) {
422 StrCpyS (*BriefDesc, (*BriefSize)/sizeof (CHAR16), Line);
423 }
424
425 State = Final;
426 }
427
428 Line++;
429 break;
430
431 default:
432 break;
433 }
434 } while (State < Final);
435
436 *Found = ReturnFound;
437 return ReturnValue;
438}
439
462 IN SHELL_FILE_HANDLE Handle,
463 IN CONST CHAR16 *Command,
464 OUT CHAR16 **BriefDesc OPTIONAL,
465 OUT UINTN *BriefSize OPTIONAL,
466 IN OUT BOOLEAN *Ascii
467 )
468{
469 EFI_STATUS Status;
470 CHAR16 *ReadLine;
471 UINTN Size;
472 BOOLEAN Found;
473 UINTN Start;
474
475 if ( (Handle == NULL)
476 || (Command == NULL)
477 || ((BriefDesc != NULL) && (BriefSize == NULL))
478 )
479 {
480 return (EFI_INVALID_PARAMETER);
481 }
482
483 Status = EFI_SUCCESS;
484 Size = 1024;
485 Found = FALSE;
486
487 ReadLine = AllocateZeroPool (Size);
488 if (ReadLine == NULL) {
489 return (EFI_OUT_OF_RESOURCES);
490 }
491
492 //
493 // Do not pass any leading path information that may be present to IsTitleHeader().
494 //
495 Start = StrLen (Command);
496 while ( (Start != 0)
497 && (*(Command + Start - 1) != L'\\')
498 && (*(Command + Start - 1) != L'/')
499 && (*(Command + Start - 1) != L':'))
500 {
501 --Start;
502 }
503
504 for ( ; !ShellFileHandleEof (Handle); Size = 1024) {
505 Status = ShellFileHandleReadLine (Handle, ReadLine, &Size, TRUE, Ascii);
506 //
507 // ignore too small of buffer...
508 //
509 if (EFI_ERROR (Status) && (Status != EFI_BUFFER_TOO_SMALL)) {
510 break;
511 }
512
513 Status = EFI_NOT_FOUND;
514 if (IsTitleHeader (Command+Start, ReadLine, BriefDesc, BriefSize, &Found)) {
515 Status = Found ? EFI_SUCCESS : EFI_NOT_FOUND;
516 break;
517 }
518 }
519
520 FreePool (ReadLine);
521 return (Status);
522}
523
557 IN CONST CHAR16 *ManFileName,
558 IN CONST CHAR16 *Command,
559 IN CONST CHAR16 *Sections OPTIONAL,
560 OUT CHAR16 **BriefDesc OPTIONAL,
561 OUT CHAR16 **HelpText
562 )
563{
564 CHAR16 *TempString;
565 SHELL_FILE_HANDLE FileHandle;
566 EFI_HANDLE CmdFileImgHandle;
567 EFI_STATUS Status;
568 UINTN HelpSize;
569 UINTN BriefSize;
570 UINTN StringIdWalker;
571 BOOLEAN Ascii;
572 CHAR16 *CmdFileName;
573 CHAR16 *CmdFilePathName;
574 EFI_DEVICE_PATH_PROTOCOL *FileDevPath;
576 EFI_HII_PACKAGE_LIST_HEADER *PackageListHeader;
577
578 if ( (ManFileName == NULL)
579 || (Command == NULL)
580 || (HelpText == NULL)
581 )
582 {
583 return (EFI_INVALID_PARAMETER);
584 }
585
586 HelpSize = 0;
587 BriefSize = 0;
588 StringIdWalker = 0;
589 TempString = NULL;
590 Ascii = FALSE;
591 CmdFileName = NULL;
592 CmdFilePathName = NULL;
593 CmdFileImgHandle = NULL;
594 PackageListHeader = NULL;
595 FileDevPath = NULL;
596 DevPath = NULL;
597
598 //
599 // See if it's in HII first
600 //
601 TempString = ShellCommandGetCommandHelp (Command);
602 if (TempString != NULL) {
604 if (FileHandle == NULL) {
605 Status = EFI_OUT_OF_RESOURCES;
606 goto Done;
607 }
608
609 HelpSize = StrLen (TempString) * sizeof (CHAR16);
610 ShellWriteFile (FileHandle, &HelpSize, TempString);
611 ShellSetFilePosition (FileHandle, 0);
612 HelpSize = 0;
613 BriefSize = 0;
614 Status = ManFileFindTitleSection (FileHandle, Command, BriefDesc, &BriefSize, &Ascii);
615 if (!EFI_ERROR (Status) && (HelpText != NULL)) {
616 Status = ManFileFindSections (FileHandle, Sections, HelpText, &HelpSize, Ascii);
617 }
618
619 ShellCloseFile (&FileHandle);
620 } else {
621 //
622 // If the image is a external app, check .MAN file first.
623 //
624 FileHandle = NULL;
625 TempString = GetManFileName (ManFileName);
626 if (TempString == NULL) {
627 return (EFI_INVALID_PARAMETER);
628 }
629
630 Status = SearchPathForFile (TempString, &FileHandle);
631 if (EFI_ERROR (Status)) {
632 FileDevPath = FileDevicePath (NULL, TempString);
633 if (FileDevPath == NULL) {
634 Status = EFI_OUT_OF_RESOURCES;
635 goto Done;
636 }
637
638 DevPath = AppendDevicePath (ShellInfoObject.ImageDevPath, FileDevPath);
639 if (DevPath == NULL) {
640 Status = EFI_OUT_OF_RESOURCES;
641 goto Done;
642 }
643
644 Status = InternalOpenFileDevicePath (DevPath, &FileHandle, EFI_FILE_MODE_READ, 0);
645 SHELL_FREE_NON_NULL (FileDevPath);
646 SHELL_FREE_NON_NULL (DevPath);
647 }
648
649 if (!EFI_ERROR (Status)) {
650 HelpSize = 0;
651 BriefSize = 0;
652 Status = ManFileFindTitleSection (FileHandle, Command, BriefDesc, &BriefSize, &Ascii);
653 if (!EFI_ERROR (Status) && (HelpText != NULL)) {
654 Status = ManFileFindSections (FileHandle, Sections, HelpText, &HelpSize, Ascii);
655 }
656
657 ShellInfoObject.NewEfiShellProtocol->CloseFile (FileHandle);
658 if (!EFI_ERROR (Status)) {
659 //
660 // Get help text from .MAN file success.
661 //
662 goto Done;
663 }
664 }
665
666 //
667 // Load the app image to check EFI_HII_PACKAGE_LIST_PROTOCOL.
668 //
669 CmdFileName = GetExecuatableFileName (TempString);
670 if (CmdFileName == NULL) {
671 Status = EFI_OUT_OF_RESOURCES;
672 goto Done;
673 }
674
675 //
676 // If the file in CWD then use the file name, else use the full
677 // path name.
678 //
679 CmdFilePathName = ShellFindFilePath (CmdFileName);
680 if (CmdFilePathName == NULL) {
681 Status = EFI_NOT_FOUND;
682 goto Done;
683 }
684
685 DevPath = ShellInfoObject.NewEfiShellProtocol->GetDevicePathFromFilePath (CmdFilePathName);
686 Status = gBS->LoadImage (FALSE, gImageHandle, DevPath, NULL, 0, &CmdFileImgHandle);
687 if (EFI_ERROR (Status)) {
688 //
689 // With EFI_SECURITY_VIOLATION retval, the Image was loaded and an ImageHandle was created
690 // with a valid EFI_LOADED_IMAGE_PROTOCOL, but the image can not be started right now.
691 // If the caller doesn't have the option to defer the execution of an image, we should
692 // unload image for the EFI_SECURITY_VIOLATION to avoid the resource leak.
693 //
694 if (Status == EFI_SECURITY_VIOLATION) {
695 gBS->UnloadImage (CmdFileImgHandle);
696 }
697
698 *HelpText = NULL;
699 goto Done;
700 }
701
702 Status = gBS->OpenProtocol (
703 CmdFileImgHandle,
704 &gEfiHiiPackageListProtocolGuid,
705 (VOID **)&PackageListHeader,
707 NULL,
708 EFI_OPEN_PROTOCOL_GET_PROTOCOL
709 );
710 if (EFI_ERROR (Status)) {
711 *HelpText = NULL;
712 goto Done;
713 }
714
715 //
716 // If get package list on image handle, install it on HiiDatabase.
717 //
718 Status = gBS->InstallProtocolInterface (
719 &mShellManDriverHandle,
720 &gEfiDevicePathProtocolGuid,
722 &mShellManHiiDevicePath
723 );
724 if (EFI_ERROR (Status)) {
725 goto Done;
726 }
727
728 Status = gHiiDatabase->NewPackageList (
730 PackageListHeader,
731 mShellManDriverHandle,
732 &mShellManHiiHandle
733 );
734 if (EFI_ERROR (Status)) {
735 goto Done;
736 }
737
738 StringIdWalker = 1;
739 do {
740 SHELL_FREE_NON_NULL (TempString);
741 if (BriefDesc != NULL) {
742 SHELL_FREE_NON_NULL (*BriefDesc);
743 }
744
745 TempString = HiiGetString (mShellManHiiHandle, (EFI_STRING_ID)StringIdWalker, NULL);
746 if (TempString == NULL) {
747 Status = EFI_NOT_FOUND;
748 goto Done;
749 }
750
752 if (FileHandle == NULL) {
753 Status = EFI_OUT_OF_RESOURCES;
754 goto Done;
755 }
756
757 HelpSize = StrLen (TempString) * sizeof (CHAR16);
758 ShellWriteFile (FileHandle, &HelpSize, TempString);
759 ShellSetFilePosition (FileHandle, 0);
760 HelpSize = 0;
761 BriefSize = 0;
762 Status = ManFileFindTitleSection (FileHandle, Command, BriefDesc, &BriefSize, &Ascii);
763 if (!EFI_ERROR (Status) && (HelpText != NULL)) {
764 Status = ManFileFindSections (FileHandle, Sections, HelpText, &HelpSize, Ascii);
765 }
766
767 ShellCloseFile (&FileHandle);
768 if (!EFI_ERROR (Status)) {
769 //
770 // Found what we need and return
771 //
772 goto Done;
773 }
774
775 StringIdWalker += 1;
776 } while (StringIdWalker < 0xFFFF && TempString != NULL);
777 }
778
779Done:
780 if (mShellManDriverHandle != NULL) {
781 gBS->UninstallProtocolInterface (
782 mShellManDriverHandle,
783 &gEfiDevicePathProtocolGuid,
784 &mShellManHiiDevicePath
785 );
786 mShellManDriverHandle = NULL;
787 }
788
789 if (mShellManHiiHandle != NULL) {
790 HiiRemovePackages (mShellManHiiHandle);
791 mShellManHiiHandle = NULL;
792 }
793
794 if (CmdFileImgHandle != NULL) {
795 Status = gBS->UnloadImage (CmdFileImgHandle);
796 }
797
798 SHELL_FREE_NON_NULL (TempString);
799 SHELL_FREE_NON_NULL (CmdFileName);
800 SHELL_FREE_NON_NULL (CmdFilePathName);
801 SHELL_FREE_NON_NULL (FileDevPath);
802 SHELL_FREE_NON_NULL (DevPath);
803
804 return (Status);
805}
UINT64 UINTN
UINTN EFIAPI StrSize(IN CONST CHAR16 *String)
Definition: String.c:72
RETURN_STATUS EFIAPI StrCpyS(OUT CHAR16 *Destination, IN UINTN DestMax, IN CONST CHAR16 *Source)
Definition: SafeString.c:226
CHAR16 EFIAPI CharToUpper(IN CHAR16 Char)
Definition: String.c:307
INTN EFIAPI StrnCmp(IN CONST CHAR16 *FirstString, IN CONST CHAR16 *SecondString, IN UINTN Length)
Definition: String.c:162
RETURN_STATUS EFIAPI StrnCatS(IN OUT CHAR16 *Destination, IN UINTN DestMax, IN CONST CHAR16 *Source, IN UINTN Length)
Definition: SafeString.c:507
RETURN_STATUS EFIAPI StrnCpyS(OUT CHAR16 *Destination, IN UINTN DestMax, IN CONST CHAR16 *Source, IN UINTN Length)
Definition: SafeString.c:310
UINTN EFIAPI StrLen(IN CONST CHAR16 *String)
Definition: String.c:30
CHAR16 *EFIAPI StrStr(IN CONST CHAR16 *String, IN CONST CHAR16 *SearchString)
Definition: String.c:224
#define HARDWARE_DEVICE_PATH
Definition: DevicePath.h:68
#define HW_VENDOR_DP
Definition: DevicePath.h:133
EFI_DEVICE_PATH_PROTOCOL *EFIAPI FileDevicePath(IN EFI_HANDLE Device OPTIONAL, IN CONST CHAR16 *FileName)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI AppendDevicePath(IN CONST EFI_DEVICE_PATH_PROTOCOL *FirstDevicePath OPTIONAL, IN CONST EFI_DEVICE_PATH_PROTOCOL *SecondDevicePath OPTIONAL)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
VOID *EFIAPI AllocateCopyPool(IN UINTN AllocationSize, IN CONST VOID *Buffer)
EFI_FILE_PROTOCOL * CreateFileInterfaceMem(IN CONST BOOLEAN Unicode)
EFI_STRING EFIAPI HiiGetString(IN EFI_HII_HANDLE HiiHandle, IN EFI_STRING_ID StringId, IN CONST CHAR8 *Language OPTIONAL)
Definition: HiiString.c:211
VOID EFIAPI HiiRemovePackages(IN EFI_HII_HANDLE HiiHandle)
Definition: HiiLib.c:253
#define NULL
Definition: Base.h:319
#define CONST
Definition: Base.h:259
#define TRUE
Definition: Base.h:301
#define FALSE
Definition: Base.h:307
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
SHELL_FILE_HANDLE EFIAPI ConvertEfiFileProtocolToShellHandle(IN CONST EFI_FILE_PROTOCOL *Handle, IN CONST CHAR16 *Path)
BOOLEAN EFIAPI ShellFileHandleEof(IN SHELL_FILE_HANDLE Handle)
CHAR16 *EFIAPI ShellCommandGetCommandHelp(IN CONST CHAR16 *CommandString)
CHAR16 *EFIAPI StrnCatGrow(IN OUT CHAR16 **Destination, IN OUT UINTN *CurrentSize, IN CONST CHAR16 *Source, IN UINTN Count)
EFI_STATUS EFIAPI ShellFileHandleReadLine(IN SHELL_FILE_HANDLE Handle, IN OUT CHAR16 *Buffer, IN OUT UINTN *Size, IN BOOLEAN Truncate, IN OUT BOOLEAN *Ascii)
EFI_STATUS EFIAPI ShellSetFilePosition(IN SHELL_FILE_HANDLE FileHandle, IN UINT64 Position)
CHAR16 *EFIAPI ShellFindFilePath(IN CONST CHAR16 *FileName)
EFI_STATUS EFIAPI ShellWriteFile(IN SHELL_FILE_HANDLE FileHandle, IN OUT UINTN *BufferSize, IN VOID *Buffer)
Definition: UefiShellLib.c:947
EFI_STATUS EFIAPI ShellCloseFile(IN SHELL_FILE_HANDLE *FileHandle)
Definition: UefiShellLib.c:969
CHAR16 * GetExecuatableFileName(IN CONST CHAR16 *NameString)
EFI_STATUS ManFileFindSections(IN SHELL_FILE_HANDLE Handle, IN CONST CHAR16 *Sections, OUT CHAR16 **HelpText, OUT UINTN *HelpSize, IN BOOLEAN Ascii)
CHAR16 * GetManFileName(IN CONST CHAR16 *ManFileName)
EFI_STATUS ProcessManFile(IN CONST CHAR16 *ManFileName, IN CONST CHAR16 *Command, IN CONST CHAR16 *Sections OPTIONAL, OUT CHAR16 **BriefDesc OPTIONAL, OUT CHAR16 **HelpText)
EFI_STATUS SearchPathForFile(IN CONST CHAR16 *FileName, OUT SHELL_FILE_HANDLE *Handle)
BOOLEAN IsTitleHeader(IN CONST CHAR16 *Command, IN CHAR16 *Line, OUT CHAR16 **BriefDesc OPTIONAL, OUT UINTN *BriefSize OPTIONAL, OUT BOOLEAN *Found)
EFI_STATUS ManFileFindTitleSection(IN SHELL_FILE_HANDLE Handle, IN CONST CHAR16 *Command, OUT CHAR16 **BriefDesc OPTIONAL, OUT UINTN *BriefSize OPTIONAL, IN OUT BOOLEAN *Ascii)
EFI_STATUS InternalOpenFileDevicePath(IN OUT EFI_DEVICE_PATH_PROTOCOL *DevicePath, OUT SHELL_FILE_HANDLE *FileHandle, IN UINT64 OpenMode, IN UINT64 Attributes OPTIONAL)
EFI_STATUS EFIAPI EfiShellOpenFileByName(IN CONST CHAR16 *FileName, OUT SHELL_FILE_HANDLE *FileHandle, IN UINT64 OpenMode)
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
#define EFI_SUCCESS
Definition: UefiBaseType.h:112
EFI_HANDLE gImageHandle
EFI_BOOT_SERVICES * gBS
EFI_HII_DATABASE_PROTOCOL * gHiiDatabase
VOID * EFI_HII_HANDLE
@ EFI_NATIVE_INTERFACE
Definition: UefiSpec.h:1193
EFI_DEVICE_PATH_PROTOCOL * ImageDevPath
DevicePath for ourselves.
Definition: Shell.h:108