-
-
Save egonelbre/a5a82c17cdec87c4dc7d to your computer and use it in GitHub Desktop.
DnsNameCompare_W from ReactOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BOOL WINAPI DnsNameCompare_W( PCWSTR name1, PCWSTR name2 ) | |
{ | |
PCWSTR p, q; | |
if (!name1 && !name2) return TRUE; | |
if (!name1 || !name2) return FALSE; | |
p = name1 + lstrlenW( name1 ) - 1; | |
q = name2 + lstrlenW( name2 ) - 1; | |
while (*p == '.' && p >= name1) p--; | |
while (*q == '.' && q >= name2) q--; | |
if (p - name1 != q - name2) return FALSE; | |
while (name1 <= p) | |
{ | |
if (towupper( *name1 ) != towupper( *name2 )) | |
return FALSE; | |
name1++; | |
name2++; | |
} | |
return TRUE; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment