kernel32 & winelib: Don't test string size in CompareStringW for null terminated strings

Adam Strzelecki ono at java.pl
Sun Mar 2 08:10:24 CST 2008


I believe the further discussion is pointless. If you ever dared to  
look how MSVCRT or GLIBC strlen function is implemented you would know  
that it is exactly same algorithm (that just differs in the  
implementation) using 4 byte fetching with magic bits matching, also  
described in few books and articles, let me name one: "Write Great  
Code, Volume 2: Thinking Low-Level, Writing High-Level" ISBN  
1593270658, section 10.1.1.1 about using string manipulation routines,  
so there's nothing about Microsoft's or anybody's else secret invention.

However instead of decent discussion I was pushed aside and then  
taught here not to copy copyrighted materials, so something that I'm  
already very aware and careful about. IMHO this overwhelming paranoia  
of being scared of Microsoft is against sober thinking, and this for  
sure glads greediness of this company. My mistake was I just mentioned  
MSVCRT, that raised your disquiet, while I could point you to GLIBC or  
Linux kernel sources as well, or the book above. Too bad.

To be clear, my only intention was to point you that Wine's  
CompareStringW can be better. IMHO it is very respectable to not only  
write code that is well organized and bug-free that Wine is in my  
opinion, but also to write performance aware code, which IMHO Wine is  
NOT.

Finally I just want to point you there:
http://www.ussg.iu.edu/hypermail/linux/kernel/9907.3/0434.html

Note there that Linux kernel mailing list is bit less paranoiac :P

Cheers,
-- 
Adam Strzelecki |: nanoant.com :|




More information about the wine-devel mailing list