+
+
+/**
+ Set the Curent Working Directory (CWD). If a call is made to EfiOpen () and
+ the path does not contain a device name, The CWD is prepended to the path.
+
+ @param Cwd Current Working Directory to set
+
+
+ @return EFI_SUCCESS CWD is set
+ @return EFI_INVALID_PARAMETER Cwd is not a valid device:path
+
+**/
+EFI_STATUS
+EfiSetCwd (
+ IN CHAR8 *Cwd
+ )
+{
+ EFI_OPEN_FILE *File;
+
+ File = EfiOpen (Cwd, EFI_FILE_MODE_READ, 0);
+ if (File == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ EfiClose (File);
+
+ if (gCwd != NULL) {
+ FreePool (gCwd);
+ }
+
+ gCwd = AllocatePool (AsciiStrSize (Cwd));
+ if (gCwd == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+ AsciiStrCpy (gCwd, Cwd);
+ return EFI_SUCCESS;
+}
+
+
+/**
+ Set the Curent Working Directory (CWD). If a call is made to EfiOpen () and
+ the path does not contain a device name, The CWD is prepended to the path.
+ The CWD buffer is only valid until a new call is made to EfiSetCwd(). After
+ a call to EfiSetCwd() it is not legal to use the pointer returned by
+ this funciton.
+
+ @param Cwd Current Working Directory
+
+
+ @return NULL No CWD set
+ @return 'other' Returns buffer that contains CWD.
+
+**/
+CHAR8 *
+EfiGettCwd (
+ VOID
+ )
+{
+ return gCwd;
+}
+
+