Returns the size of a Null-terminated Unicode string in bytes, including the Null terminator. This function returns the size of the Null-terminated Unicode string specified by String in bytes, including the Null terminator. If String is not aligned on a 16-bit boundary, then ASSERT(). @param String A pointer to a Null-terminated Unicode string. @param MaxSize The maxim
| 173 | |
| 174 | **/ |
| 175 | UINTN |
| 176 | EFIAPI |
| 177 | StrnSizeS ( |
| 178 | IN CONST CHAR16 *String, |
| 179 | IN UINTN MaxSize |
| 180 | ) |
| 181 | { |
| 182 | // |
| 183 | // If String is a null pointer, then the StrnSizeS function returns zero. |
| 184 | // |
| 185 | if (String == NULL) { |
| 186 | return 0; |
| 187 | } |
| 188 | |
| 189 | // |
| 190 | // Otherwise, the StrnSizeS function returns the size of the Null-terminated |
| 191 | // Unicode string in bytes, including the Null terminator. If there is no |
| 192 | // Null terminator in the first MaxSize characters of String, then StrnSizeS |
| 193 | // returns (sizeof (CHAR16) * (MaxSize + 1)) to keep a consistent map with |
| 194 | // the StrnLenS function. |
| 195 | // |
| 196 | return (StrnLenS (String, MaxSize) + 1) * sizeof (*String); |
| 197 | } |
| 198 | |
| 199 | /** |
| 200 | Copies the string pointed to by Source (including the terminating null char) |
no test coverage detected