| 1378 | } |
| 1379 | |
| 1380 | BOOLEAN |
| 1381 | IsPatchEnabled (const XString8& MatchOSEntry, const XString8& CurrOS) |
| 1382 | { |
| 1383 | BOOLEAN ret = FALSE; |
| 1384 | |
| 1385 | if (MatchOSEntry.isEmpty() || CurrOS.isEmpty()) { |
| 1386 | return TRUE; //undefined matched corresponds to old behavior |
| 1387 | } |
| 1388 | |
| 1389 | XString8Array mos = Split<XString8Array>(MatchOSEntry, ","_XS8).trimEachString(); |
| 1390 | |
| 1391 | if ( mos[0] == "All"_XS8) { |
| 1392 | return TRUE; |
| 1393 | } |
| 1394 | |
| 1395 | for (size_t i = 0; i < mos.size(); ++i) { |
| 1396 | // dot represent MatchOS |
| 1397 | if ( |
| 1398 | ( mos[i].contains("."_XS8) && IsOSValid(mos[i], CurrOS)) || // MatchOS |
| 1399 | ( mos[i].contains(CurrOS) ) // MatchBuild |
| 1400 | ) { |
| 1401 | //DBG("\nthis patch will activated for OS %ls!\n", mos->array[i]); |
| 1402 | ret = TRUE; |
| 1403 | break; |
| 1404 | } |
| 1405 | } |
| 1406 | return ret; |
| 1407 | } |
| 1408 | |
| 1409 | |
| 1410 | BOOLEAN IsOSValid(const XString8& MatchOS, const XString8& CurrOS) |
no test coverage detected