| 97 | } |
| 98 | |
| 99 | STATIC |
| 100 | CHAR16 * |
| 101 | GetLogPath ( |
| 102 | IN CONST CHAR16 *LogPrefixPath |
| 103 | ) |
| 104 | { |
| 105 | EFI_STATUS Status; |
| 106 | EFI_TIME Date; |
| 107 | CHAR16 *LogPath; |
| 108 | UINTN Size; |
| 109 | |
| 110 | if (LogPrefixPath == NULL) { |
| 111 | return NULL; |
| 112 | } |
| 113 | |
| 114 | Status = gRT->GetTime (&Date, NULL); |
| 115 | if (EFI_ERROR(Status)) { |
| 116 | ZeroMem (&Date, sizeof (Date)); |
| 117 | } |
| 118 | |
| 119 | Size = StrSize (LogPrefixPath) + L_STR_SIZE (L"-0000-00-00-000000.txt"); |
| 120 | |
| 121 | LogPath = AllocatePool (Size); |
| 122 | if (LogPath == NULL) { |
| 123 | return NULL; |
| 124 | } |
| 125 | |
| 126 | UnicodeSPrint ( |
| 127 | LogPath, |
| 128 | Size, |
| 129 | L"%s-%04u-%02u-%02u-%02u%02u%02u.txt", |
| 130 | LogPrefixPath, |
| 131 | (UINT32) Date.Year, |
| 132 | (UINT32) Date.Month, |
| 133 | (UINT32) Date.Day, |
| 134 | (UINT32) Date.Hour, |
| 135 | (UINT32) Date.Minute, |
| 136 | (UINT32) Date.Second |
| 137 | ); |
| 138 | |
| 139 | return LogPath; |
| 140 | } |
| 141 | |
| 142 | EFI_STATUS |
| 143 | EFIAPI |
no test coverage detected