| 237 | } |
| 238 | |
| 239 | EFI_STATUS |
| 240 | EFIAPI |
| 241 | OcUnicodeSafeSPrint ( |
| 242 | OUT CHAR16 *StartOfBuffer, |
| 243 | IN UINTN BufferSize, |
| 244 | IN CONST CHAR16 *FormatString, |
| 245 | ... |
| 246 | ) |
| 247 | { |
| 248 | EFI_STATUS Status; |
| 249 | VA_LIST Marker; |
| 250 | VA_LIST Marker2; |
| 251 | UINTN NumberOfPrinted; |
| 252 | |
| 253 | ASSERT (StartOfBuffer != NULL); |
| 254 | ASSERT (BufferSize > 0); |
| 255 | ASSERT (FormatString != NULL); |
| 256 | |
| 257 | VA_START (Marker, FormatString); |
| 258 | |
| 259 | VA_COPY (Marker2, Marker); |
| 260 | NumberOfPrinted = SPrintLength (FormatString, Marker2); |
| 261 | VA_END (Marker2); |
| 262 | |
| 263 | if (BufferSize - 1 >= NumberOfPrinted) { |
| 264 | UnicodeVSPrint (StartOfBuffer, BufferSize, FormatString, Marker); |
| 265 | Status = EFI_SUCCESS; |
| 266 | } else { |
| 267 | Status = EFI_OUT_OF_RESOURCES; |
| 268 | } |
| 269 | |
| 270 | VA_END (Marker); |
| 271 | |
| 272 | return Status; |
| 273 | } |
nothing calls this directly
no test coverage detected