Compares two Null-terminated Unicode strings, and returns the difference between the first mismatched Unicode characters. This function compares the Null-terminated Unicode string FirstString to the Null-terminated Unicode string SecondString. If FirstString is identical to SecondString, then 0 is returned. Otherwise, the value returned is the first mismatched Unicode character in
| 258 | |
| 259 | **/ |
| 260 | INTN |
| 261 | EFIAPI |
| 262 | StrCmp ( |
| 263 | IN CONST CHAR16 *FirstString, |
| 264 | IN CONST CHAR16 *SecondString |
| 265 | ) |
| 266 | { |
| 267 | // |
| 268 | // ASSERT both strings are less long than PcdMaximumUnicodeStringLength |
| 269 | // |
| 270 | // ASSERT (StrSize (FirstString) != 0); |
| 271 | // ASSERT (StrSize (SecondString) != 0); |
| 272 | if ((StrSize (FirstString) == 0) && (StrSize (SecondString) == 0)) { |
| 273 | return 0; |
| 274 | } |
| 275 | |
| 276 | if (StrSize (FirstString) == 0) { |
| 277 | return -1; |
| 278 | } |
| 279 | if (StrSize (SecondString) == 0) { |
| 280 | return 1; |
| 281 | } |
| 282 | |
| 283 | |
| 284 | while ((*FirstString != L'\0') && (*FirstString == *SecondString)) { |
| 285 | FirstString++; |
| 286 | SecondString++; |
| 287 | } |
| 288 | return *FirstString - *SecondString; |
| 289 | } |
| 290 | |
| 291 | /** |
| 292 | Compares up to a specified length the contents of two Null-terminated Unicode strings, |
no test coverage detected