kuro5hin.org— Two years ago the source code of Windows 2000 (the basis of XP) was leaked. It's good code... but who knew Microsoft programmers swore so much?
Sep 24, 2006View in Crawl 4
A comparison to linux kernel hacks :P~/downloads/linux-2.6.18/arch/i386/kernel$ rgrep hack *apm.c: * Add hack to allow power off of SMP systems by popular request.apm.c: * Changed to use the sysrq-register hack for registering thecpu/common.c:/* This is hacky. :)cpu/common.c: * This is a horrible hack to allocate the GDT. The problemio_apic.c: * This looks a bit hackish but it's about the only one way of sendingio_apic.c: * is so screwy. Thanks to Brian Perkins for testing/hacking this beastsys_i386.c: version = call >> 16; /* hack for backward compatibility */The only difference is that the linux devs KNOW that their code will be open for public viewing where as the windows ones always thought their comments would remain locked up with the source forever. I guess they were wrongBtw, to all those who say that you're buying Windows and are getting this stuff - nope you're not, the compiler doesn't compile comments!
"It's been widely rumored for a while that Microsoft relies on stolen open source code.""Searching the code for "linux" and "GPL" finds no references."I really wouldn't expect them to be that stupid. One doesn't need college to master find and replace.
I think what nrblex is saying here is that even though the comments are removed from the program during the compiling process, we as M$ consumers (if you did pay for your copy of the product) are paying for the programmers time to write the comments. Considering the laugh we are now getting from them... well worth the money. OK, maybe not.
@xJVzIt's their convention, which was established long ago. "Besides, what looks nicer? "LPITEMIDLIST" or "ItemIDList*"?"If you have a million lines of code already using all caps for flat data structures, then LPITEMIDLIST looks nicer because it is consistent. MS APIs are almost all flat C apis which use all caps for flat C structures. Using that convention on classes would surely be blasphemy.Maybe if they could start all over they would do it that way, but that isn't going to happen. In any case, LPITEMIDLIST and ItemIDList* aren't the same thing!!! MS explicitly types pointer types, and for very good reason, to remove possible ambiguities in declarations.look at this code:LPITEMIDLIST list1, list2; // it is abundantly clear that both are pointer typesItemIDList* list1, list2; // is list2 a ItemIDList* or an ItemIDList ?I like explicitly typing pointers sometimes for this reason. So then the question is, how do you type a pointer using ItemIDList naming convention? (I'm just curious of what that would look like) maybe ItemIDListPtr ?I agree that all caps is harder to read, but it's also easier to distinguish as a type name, which is an advantage. MS has a very interesting approach to C and C++ development, they use C++ features very cautiously and typically use thin classes with mostly C-style coding conventions (for example, MS would use a named function where some other pure C++ API would use an operator overload). I actually like their C++ code, because they aren't a bunch of boost::whore's who think everything needs to be a template and abstracted to infinity. I would say their coding rules closely resemble something like Mozilla's C++ conventions (except for the naming conventions, which are a little different), which basically lock out almost all the most C++'ish features like exceptions, RTTI, and all of the controversial C++ features. They kind of take the good parts from C and leverage that with the power of C++ class semantics (leaving behind the unproven features such as exceptions and RTTI) and they compile it with the C++ compiler for the ultimate performance/development power. The result is very fast code with a few weird naming conventions ;)
PARENTAL ADVISORY WARNING: [RATED R] VULGAR SOURCE CODEI think they had bigger things to care about then worrying about appropriate commenting. Coding a server seems to be a tedious task, very tedious. So why not leave some frustration and emotion in the code? Im sure you can find a PG-13 version of the source code somewhere. // This story is entertaining but who the f**k cares.
Yes, that's what I meant, they get thrown into the work directory as classes at some point and I've read that in this process, comments get tossed. Just didn't know for sure about straight-up classes.
I agree lubos. A lot of the hacks have to do with backward binary compatibility. They once said they put a hack in Windows 98 so an old version of Sim City would still run where a pointer had released memory and then later still attempted to use it. I find myself having to recompile applications on Linux all of the time when the kernel changes or dependencies change.
linuxconvertSep 25, 2006
A comparison to linux kernel hacks :P~/downloads/linux-2.6.18/arch/i386/kernel$ rgrep hack *apm.c: * Add hack to allow power off of SMP systems by popular request.apm.c: * Changed to use the sysrq-register hack for registering thecpu/common.c:/* This is hacky. :)cpu/common.c: * This is a horrible hack to allocate the GDT. The problemio_apic.c: * This looks a bit hackish but it's about the only one way of sendingio_apic.c: * is so screwy. Thanks to Brian Perkins for testing/hacking this beastsys_i386.c: version = call >> 16; /* hack for backward compatibility */The only difference is that the linux devs KNOW that their code will be open for public viewing where as the windows ones always thought their comments would remain locked up with the source forever. I guess they were wrongBtw, to all those who say that you're buying Windows and are getting this stuff - nope you're not, the compiler doesn't compile comments!
niteskunkSep 25, 2006
Man, I wish I was more aware of things like this when the actual leak happened, I would've loved to take a peek at the code... illwill recently got busted for selling copies of it - <a class="user" href="http://www.usdoj.gov/criminal/cybercrime/genoveseCharge.htm">http://www.usdoj.gov/criminal/cybercrime/genoveseCharge.htm</a>
prthealienSep 25, 2006
If you don't know anything about programming, stay out of the programming section of digg.
ramd3zSep 25, 2006
"It's been widely rumored for a while that Microsoft relies on stolen open source code.""Searching the code for "linux" and "GPL" finds no references."I really wouldn't expect them to be that stupid. One doesn't need college to master find and replace.
wvdavisSep 25, 2006
I think what nrblex is saying here is that even though the comments are removed from the program during the compiling process, we as M$ consumers (if you did pay for your copy of the product) are paying for the programmers time to write the comments. Considering the laugh we are now getting from them... well worth the money. OK, maybe not.
zacmccormickSep 25, 2006
This is 2 year old news. It's still hilarious, but come on, we all grep'ed the source tree a long ass time ago.
zacmccormickSep 25, 2006
@xJVzIt's their convention, which was established long ago. "Besides, what looks nicer? "LPITEMIDLIST" or "ItemIDList*"?"If you have a million lines of code already using all caps for flat data structures, then LPITEMIDLIST looks nicer because it is consistent. MS APIs are almost all flat C apis which use all caps for flat C structures. Using that convention on classes would surely be blasphemy.Maybe if they could start all over they would do it that way, but that isn't going to happen. In any case, LPITEMIDLIST and ItemIDList* aren't the same thing!!! MS explicitly types pointer types, and for very good reason, to remove possible ambiguities in declarations.look at this code:LPITEMIDLIST list1, list2; // it is abundantly clear that both are pointer typesItemIDList* list1, list2; // is list2 a ItemIDList* or an ItemIDList ?I like explicitly typing pointers sometimes for this reason. So then the question is, how do you type a pointer using ItemIDList naming convention? (I'm just curious of what that would look like) maybe ItemIDListPtr ?I agree that all caps is harder to read, but it's also easier to distinguish as a type name, which is an advantage. MS has a very interesting approach to C and C++ development, they use C++ features very cautiously and typically use thin classes with mostly C-style coding conventions (for example, MS would use a named function where some other pure C++ API would use an operator overload). I actually like their C++ code, because they aren't a bunch of boost::whore's who think everything needs to be a template and abstracted to infinity. I would say their coding rules closely resemble something like Mozilla's C++ conventions (except for the naming conventions, which are a little different), which basically lock out almost all the most C++'ish features like exceptions, RTTI, and all of the controversial C++ features. They kind of take the good parts from C and leverage that with the power of C++ class semantics (leaving behind the unproven features such as exceptions and RTTI) and they compile it with the C++ compiler for the ultimate performance/development power. The result is very fast code with a few weird naming conventions ;)
nrbelexSep 25, 2006
wvdavis seems to understand...
aickieranSep 25, 2006
"arch/sparc/lib/checksum.S: *give up. I'm serious, I am going to kick the living s**t out of you, game over, lights out" That one got me,infact, <a class="user" href="http://www.geocities.com/thes**tbin1/Linux-comments.txt">http://www.geocities.com/thes**tbin1/Linux-comments.txt</a> :D
imnsiSep 26, 2006
PARENTAL ADVISORY WARNING: [RATED R] VULGAR SOURCE CODEI think they had bigger things to care about then worrying about appropriate commenting. Coding a server seems to be a tedious task, very tedious. So why not leave some frustration and emotion in the code? Im sure you can find a PG-13 version of the source code somewhere. // This story is entertaining but who the f**k cares.
hurfydurfurSep 26, 2006
geminitojanus has got it. freeze it and virtualize it. branch for progress.
golddiggaSep 26, 2006
this is funny
hurfydurfurSep 27, 2006
Yes, that's what I meant, they get thrown into the work directory as classes at some point and I've read that in this process, comments get tossed. Just didn't know for sure about straight-up classes.
ninlarSep 28, 2006
I agree lubos. A lot of the hacks have to do with backward binary compatibility. They once said they put a hack in Windows 98 so an old version of Sim City would still run where a pointer had released memory and then later still attempted to use it. I find myself having to recompile applications on Linux all of the time when the kernel changes or dependencies change.
tektalkSep 30, 2006
i wonder what they wrote for the windows media player?
dr1ft3rOct 12, 2006
I have legal access to all windows source code and there are no remarks on it that are listedfrom this 'digg'.Sorry Guys
Closed AccountFeb 25, 2008
That's great find<a class="user" href="http://www.nasavo.com">http://www.nasavo.com</a><a class="user" href="http://www.nasavo.com/acne">http://www.nasavo.com/acne</a><a class="user" href="http://www.nasavo.com/forex">http://www.nasavo.com/forex</a><a class="user" href="http://car.nasavo.com">http://car.nasavo.com</a><a class="user" href="http://tire.nasavo.com/">http://tire.nasavo.com/</a><a class="user" href="http://www.jurugan.com">http://www.jurugan.com</a><a class="user" href="http://health.jurugan.com">http://health.jurugan.com</a><a class="user" href="http://www.vrid.net">http://www.vrid.net</a><a class="user" href="http://laptop.vrid.net">http://laptop.vrid.net</a><a class="user" href="http://projector.vrid.net">http://projector.vrid.net</a><a class="user" href="http://tire.vrid.net">http://tire.vrid.net</a><a class="user" href="http://hyip.ej.am">http://hyip.ej.am</a><a class="user" href="http://car.ej.am">http://car.ej.am</a><a class="user" href="http://laptop.ej.am">http://laptop.ej.am</a><a class="user" href="http://health.bryansoft.com">http://health.bryansoft.com</a><a class="user" href="http://hyipnews.freehostia.com">http://hyipnews.freehostia.com</a><a class="user" href="http://hyipnews.freehostia.com/hyip">http://hyipnews.freehostia.com/hyip</a><a class="user" href="http://nano-tech.freehostia.com">http://nano-tech.freehostia.com</a>