+ // We do not support NULL pointer\r
+ ASSERT (PcdGetPtr (PcdDefaultBootArgument) != NULL);\r
+\r
+ //\r
+ // Logic to handle ASCII or Unicode default parameters\r
+ //\r
+ if (*(CHAR8*)PcdGetPtr (PcdDefaultBootArgument) == '\0') {\r
+ CmdLineSize = 0;\r
+ CmdLineAsciiSize = 0;\r
+ DefaultBootArgument = NULL;\r
+ AsciiDefaultBootArgument = NULL;\r
+ } else if (IsUnicodeString ((CHAR16*)PcdGetPtr (PcdDefaultBootArgument))) {\r
+ // The command line is a Unicode string\r
+ DefaultBootArgument = (CHAR16*)PcdGetPtr (PcdDefaultBootArgument);\r
+ CmdLineSize = StrSize (DefaultBootArgument);\r
+\r
+ // Initialize ASCII variables\r
+ CmdLineAsciiSize = CmdLineSize / 2;\r
+ AsciiDefaultBootArgument = AllocatePool (CmdLineAsciiSize);\r
+ if (AsciiDefaultBootArgument == NULL) {\r
+ return EFI_OUT_OF_RESOURCES;\r
+ }\r
+ UnicodeStrToAsciiStr ((CHAR16*)PcdGetPtr (PcdDefaultBootArgument), AsciiDefaultBootArgument);\r
+ } else {\r
+ // The command line is a ASCII string\r
+ AsciiDefaultBootArgument = (CHAR8*)PcdGetPtr (PcdDefaultBootArgument);\r
+ CmdLineAsciiSize = AsciiStrSize (AsciiDefaultBootArgument);\r
+\r
+ // Initialize ASCII variables\r
+ CmdLineSize = CmdLineAsciiSize * 2;\r
+ DefaultBootArgument = AllocatePool (CmdLineSize);\r
+ if (DefaultBootArgument == NULL) {\r
+ return EFI_OUT_OF_RESOURCES;\r
+ }\r
+ AsciiStrToUnicodeStr (AsciiDefaultBootArgument, DefaultBootArgument);\r
+ }\r
+\r