Bonum Certa Men Certa

[Resurrected] 'We Are Morons': A Quick Look at the Win2k Source

The last copy of this article is in the Wayback Machine (the original was removed not long ago), so it's outside of search engines' reach. We're fixing that today.




Overview


Several days ago, two files containing Microsoft source code began circulating on the Internet. One contains a majority of the NT4 source code: this is not discussed here. The other contains a fraction of the Windows 2000 source code, reportedly about 15% of the total. This includes some networking code including winsock and inet; as well as some shell code. Some other familiar items include the event log, and some of the default screensavers.

The timestamps on the files generally say 25 July 2000. The source is contained in a Zip file of size 213,748,207 bytes, named windows_2000_source_code.zip, which has been widely circulated on P2P networks. Some dummy files of similar size, containing just strings of zeroes, have also circulated.



There has been some speculation that while the bulk of the source is genuine, some of the comments have been tampered with to embarrass Microsoft. This is difficult to disprove, but I find it implausible. The embarrassing comments occur on thousands of lines, in realistic places. Furthermore, if someone had done that, it would have been easy to make the comments far more incriminating.



Embarrassments
In the struggle to meet deadlines, I think pretty much all programmers have put in comments they might later regret, including swearwords and acerbic comments about other code or requirements. Also, any conscientious coder will put in prominent comments warning others about the trickier parts of the code. Comments like "UGLY TERRIBLE HACK" tend to indicate good code rather than bad: in bad code ugly terrible hacks are considered par for the course. It would therefore be both hypocritical and meaningless to go through the comments looking for embarrassments. But also fun, so let's go.



Curse words: there are a dozen or so "fucks" and "shits", and hundreds of "craps". Some dissatisfaction with the compiler is expressed in private\shell\shell32\util.cpp:

// the fucking alpha cpp compiler seems to fuck up the goddam type "LPITEMIDLIST", so to work
// around the fucking peice of shit compiler we pass the last param as an void *instead of a LPITEMIDLIST


Some insight into Microsoft's famous daily build process is given in private\windows\media\avi\verinfo.16\verinfo.h:

* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* !!!!!!!IF YOU CHANGE TABS TO SPACES, YOU WILL BE KILLED!!!!!!!
* !!!!!!!!!!!!!!DOING SO FUCKS THE BUILD PROCESS!!!!!!!!!!!!!!!!
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


There are also various references to idiots and morons, some external, some within Microsoft. The file private\ntos\rtl\heap.c, which dates from 1989, tells us

// The specific idiot in this case is Office95, which likes
// to free a random pointer when you start Word95 from a desktop
// shortcut.


The file private\ntos\w32\ntuser\kernel\swp.c from 11-Jul-1991 points at

* for idiots like MS-Access 2.0 who SetWindowPos( SWP_BOZO
* and blow away themselves on the shell, then lets
* just ignore their plea to be removed from the tray


Morons also abound, as in this selection

private\genx\shell\inc\prsht.w:
// we are such morons. Wiz97 underwent a redesign between IE4 and IE5



private\shell\ext\ftp\ftpdrop.cpp:
We have to do this only because Exchange is a moron.



private\shell\shdoc401\unicpp\desktop.cpp:
// We are morons. We changed the IDeskTray interface between IE4



private\shell\browseui\itbar.cpp:
// should be fixed in the apps themselves. Morons!



Microsoft programmers also take their duty to warn others seriously. There are over 4,000 references to "hacks", mostly warnings. These include



private\inet\mshtml\src\core\cdbase\baseprop.cxx:
// HACK! HACK! HACK! (MohanB) In order to fix #64710 at this very late



private\inet\mshtml\src\core\cdutil\genutil.cxx:
// HACK HACK HACK. REMOVE THIS ONCE MARLETT IS AROUND



private\inet\mshtml\src\other\moniker\resprot.cxx:
// <HACK>
goto EndHack;
// </HACK>



private\inet\mshtml\src\site\layout\flowlyt.cxx:
// God, I hate this hack ...



private\inet\wininet\urlcache\cachecfg.cxx:
// Dumb hack for back compat. *sigh*

private\inet\wininet\urlcache\filemgr.cxx:
// ACHTUNG!!! this is a special hack for IBM antivirus software



private\ispu\pkitrust\trustui\acuictl.cpp:
// HACK ALERT, believe it or not there is no way to get the height of the current
// HACK ON TOP OF HACK ALERT,



private\ntos\udfs\devctrl.c:
// Add the hack-o-ramma to fix formats.

private\shell\shdoc401\unicpp\sendto.cpp:
// Mondo hackitude-o-rama.

private\ntos\w32\ntcon\server\link.c:
// HUGE, HUGE hack-o-rama to get NTSD started on this process!

private\ntos\w32\ntuser\client\dlgmgr.c:
// HACK OF DEATH:



private\shell\lib\util.cpp:
// TERRIBLE HORRIBLE NO GOOD VERY BAD HACK



private\ntos\w32\ntuser\client\nt6\user.h:
* The magnitude of this hack compares favorably with that of the national debt.



While surprisingly informal, there are limits to how far the programmers go. There are no derogatory references to Microsoft or Windows themselves. Bill Gates is never mentioned. There are no racist or homophobic slurs. I saw only one drug reference.

private\shell\ext\tweakui\genthunk.c:
* CallProc32W is insane. It's a variadic function that uses
* the pascal calling convention. (It probably makes more sense
* when you're stoned.)


Quality
Despite the above, the quality of the code is generally excellent. Modules are small, and procedures generally fit on a single screen. The commenting is very detailed about intentions, but doesn't fall into "add one to i" redundancy.



There is some variety in the commenting style. Sometimes blocks use a // at every line, sometimes the /* */ style. In some modules functions have a history, some do not. Some functions describe their variables in a comment block, some don't. Microsoft appears not to have fallen into the trap of enforcing over-rigid standards or universal use of over-complicated automatic tools. They seem to trust their developers to comment well, and they do.



However, not everything is so rosy. Some of the modules are clearly suffering from the hacks upon hacks mentioned earlier. As someone who struggled immensely trying to get the MSInet control working not long after this code was released, it's a relief to see that the inet code is as bad as I thought.



From the comments, it also appears that most of the uglier hacks are due to compatibility issues: either backward-compatibility, hardware compatibility or issues caused by particular software. Microsoft's vast compatibility strengths have clearly come at a cost, both in developer-sweat and the elegance (and hence stability and maintainability) of the code.



Open Source
It's been widely rumored for a while that Microsoft relies on stolen open source code. The rumor has faced widespread skepticism too. Microsoft has hundreds of millions of lines of code, most of it highly specialized. Hardly any of that could benefit from stealing: it hardly seems worth the legal risk. It's true that early versions of the TCP-IP stack were (legally) taken from BSD: but that was a long time ago, when Microsoft was much smaller.



Searching the code for "linux" and "GPL" finds no references. "BSD" finds only a couple of references to BSD-convention strings. "GNU" finds a lot of references to a GNUmakefile in private\genx\shell, which in turn mentions a "mode for Emacs." This is apparently legitimate: simply using a makefile does not apply the makefile's copyright to the resulting code.



Therefore, a superficial look at the code finds no evidence that Microsoft has violated the GPL or stolen other open source code. Closer examination might turn something up.

Favoritism
It's noticeable that a lot of the "hacks" refer to individual applications. In some cases they are non-Microsoft, such as this case: a Borland compiler came to depend on an existing bug, so their fix worked to preserve some of the bug's behaviour. But just as often these application-specific fixes are for Microsoft's own apps. There seems to be an informal hierarchy when it comes these: Microsoft apps take precedence, then major software companies like IBM and Borland.

It's also interesting to finally see references to the notorious undocumented features, which Microsoft application developers have long been known to use.

private\mvdm\wow32\wcntl32.c:
// These undocumented messages are used by Excel 5.0



private\mvdm\wow32\wgdi31.c:
// InquireVisRgn is an undocumented Win 3.1 API. This code has been
// suggested by ChuckWh. If this does not fix the s 2.0
// problem, then ChuckWh would be providing us with an private entry
// point.



private\mvdm\wow32\wgfont.c:
* This thunk implements the undocumented Win3.0 and Win3.1 API
* GetCurLogFont (GDI.411). Symantec QA4.0 uses it.
* To implement this undocumented API we will use the NT undocumented API



In some cases, the programmers themselves appear to have been frustrated or surprised.

private\ntos\w32\ntuser\kernel\mnpopup.c:
// Set the GlobalPopupMenu variable so that EndMenu works for popupmenus so
// that WinWart II people can continue to abuse undocumented functions.



private\windows\shell\accesory\hypertrm\emu\minitel.c:
// Guess what? Latent background color is always adopted for mosaics.
// This is a major undocumented find...



private\windows\shell\accesory\hypertrm\emu\minitelf.c:
// Ah, the life of the undocumented. The documentation says
// that this guys does not validate, colors, act as a delimiter
// and fills with spaces. Wrong. It does validate the color.
// As such its a delimiter. If...



Conclusions
The security risks from this code appear to be low. Microsoft do appear to be checking for buffer overruns in the obvious places. The amount of networking code here is small enough for Microsoft to easily check for any vulnerabilities that might be revealed: it's the big applications that pose more of a risk. This code is also nearly four years old: any obvious problems should be patched by now.



Microsoft's fears that this code will be pirated by its competitors also seem largely unfounded. With application code this would be a risk, but it's hard to see Microsoft's operating system competitors taking advantage of it. Neither Apple nor Linux are in a much of position to steal code and get away with it, even if it was useful to them.



In short, there is nothing really surprising in this leak. Microsoft does not steal open-source code. Their older code is flaky, their modern code excellent. Their programmers are skilled and enthusiastic. Problems are generally due to a trade-off of current quality against vast hardware, software and backward compatibility. ⬆

Recent Techrights' Posts

Creditors beware: VMS Enterprises Ltd vs Brexit Party (Reform UK Party Ltd)
Reprinted with permission from Daniel Pocock
 
Brigading Against Women - Part XIV - Mastery of Distraction
The finger-pointing actions themselves prove the saying that even an accusation is likely a confession
Links 02/10/2026: "McDonald's Caught Cheating Consumers for Profit" and "It's Not Illegal If You Buy New Laws"
Links for the day
EPO "Cocaine Communication Manager" - Part XVII - A Vote for Campinos This Month (Reappointment) Would be an Endorsement of Cocaine
The harder they try to silence critics, the worse it'll get
The Cyber Show on "Career Scientists" (Resellers of Establishment Brands Like GAFAM)
"The "career scientist" - with PhD and research office by their mid-twenties - follows well oiled tracks and institutional signposts, steering away from controversial or "difficult" subjects."
Reporting Court Matters While Preserving Dignity of Staff
There's a high and growing probability we'll take our appeal to the Court of Appeal next year
Broligarchs Speech-Policing, Faux 'Community' or 'Hub' in 'User-Driven' Clothing
Until a broligarch decides to "flag" inconvenient stories
Gemini Links 02/10/2026: Haiku, Microsoft EEE ('Linux' as a Container in Windows), and ROOPHLOCH 2026 Roundup
Links for the day
Microsoft Promised Them Bonuses, Instead They May Get Laid Off
Laid off or paid off?
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Thursday, October 01, 2026
IRC logs for Thursday, October 01, 2026
Lots of People Left Red Hat This Week, No Announcement Made of Layoffs
Companies just find ways and excuses not to announce their layoffs
Gemini Links 01/10/2026: Gemini-to-Web Proxies Considered Harmful, ROOPHLOCH 2026 at Griffith Park Observatory
Links for the day
"SPONSORED FEATURE" of HPE and NVIDIA at The Register MS Has Just Mentioned "AI" 68 Times in One Page!
Meanwhile, grown-ups ignore the hype and get work done without slop
Microsoft's XBox Layoffs Not Finished, Won't be Finished, It's Called "Forever Layoffs"
Microsoft will shut down (XBox) after shrinking it, there's no need to sell anything (a straw man)
IBM's Red Hat Lost Lots of People Today, Chief People Officer (CPO) Dethroned
Headcount falls shortly in secret.
Microsoft is "Pushing Up Daisies" Amid Mass Layoffs (Secret Ones)
"Longtime Microsoft research leader Peter Lee and former LinkedIn CEO Ryan Roslansky to depart"
Links 01/10/2026: "Lawyer Cites ChatGPT-Invented Fake Witnesses in Murder Appeal" and The 'Linux' Foundation Technical Advisory Board (TAB) Has Vacuum
Links for the day
Brigading Against Women - Part XIII - The Offer We Didn't Ask For (and Under Threats to a Lady at the Webhost, a Form of Extortion From America)
Two and a half months ago Garrett made an offer to my wife
Techrights Turning 20 Next Month
Our image is under attack, our finances are constantly under attack and so on
Links 01/10/2026: "Meat Proxies" and "Japan’s Far Right Is Courting Young Voters"
Links for the day
Red Hat Being Phased Out of Existence (Like Many Other Companies That IBM Bought)
The "Red Hat" brand (and badge) is being dissolved some more today [...] IBM is imploding 'creatively'.
IBM Layoffs Cover-up
thelayoff.com is censoring threads
"Restricted Boot" Garrett's State is Now Implementing Kill Switches (Just What We've Warned About All Along)
The underlying concept is hardly new
Brett Wilson LLP Has Had No Annual Report in 16 Months
A cynic might hint that they try to hide something
Reform UK last minute accounts filing
Reprinted with permission from Daniel Pocock
Gemini Links 01/10/2026: "Babel With Better Hardware", Software Input That's Slop, and DWeb Cascadia 2026
Links for the day
Today is D-Day at Red Hat and People Leave in Droves
They said there would be "bluewashing", we're mostly seeing people announcing they're leaving
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Wednesday, September 30, 2026
IRC logs for Wednesday, September 30, 2026
Gemini Links 30/09/2026: Fish Leather, Slop Formation, and ROOPHLOCH
Links for the day
In a Lot of Europe (or EU) Android (With Linux) is Bigger Than Windows
For example in Greece
Slop-Posting is a New Form of S---posting
We recently caught several more "linux" sites (with "linux" in their domain name) turning to slop
EPO Cocainegate: Lots of Money (Over a Million Euros) for Cocaine Addicts, Not for Children With Special Needs
Next month we'll bring out some more Campinos scandals
High Court victory: Nigel Farage is 'the Company's own candidate'
Reprinted with permission from Daniel Pocock
It Took GNOME's Code of Conduct Committee (CoCC) Over 8 Months to Realise CoC Reports Went Into /dev/null/
It would be ironic if the blunder's culprits were punished for it, would it not?
Links 30/09/2026: Microsoft "OpenAI Ignored Employees’ Warnings About Safely" and "Pentagon Personnel Agency Data Breach Impacts 3 Million People"
Links for the day
The Register MS "Events" As Paid Spam That Promotes and Keeps Afloat Hype About Slop
This dreary sort of media reads like a soup of words, i.e. like the thing it is advertising
Digital Independence in the UK and in Western Europe
We have the technical capacity and skilled personnel to achieve this
IBM's Anderon as a Mass Layoffs Ritual With a Bailout (From US Taxpayers to IBM) and Other Perks
Like those empty promises in the first term of the Cheeto dictator
Gemini Links 30/09/2026: David Bowie, Web Rendering Proxy, Ink and Letters, Gemlog Nostalgia
Links for the day
EPO Annual General Meeting (AGM) Will Speak of Financial State of the EPO's Union
Their work is needed because the EPO breaks the law
Rust Causes Upgrade Issues in Ubuntu
They could just keep GNU coreutils in place (nothing was broken about it) and avoid Microsoft's back doors and TPMs
Losses From Slop Are "Investment", Hundreds of Billions in Debt Are "Growth Opportunity", Layoffs Are "Great to See", and Loss of Business Means "We Need a Slowdown" (for "Safety")
Microsoft is removing staff, as investment is apparently the act of shrtinking
Brigading Against Women - Part XII - Toxic Masculinity, Hunting Women, Will Code for Sex
Who says things like these?
The Microsoft Lunduke Slop Problem
Microsoft Lunduke does not support Software Freedom; he serves to discredit many ideas championed by Free software or ideals articulated which are apolitical for the most part
Links 30/09/2026: "Understanding the LLM Bubble" and "Florida Senate Threatened Legal Action Against Newspapers"
Links for the day
It Looks Like Mass Layoffs at "Nordcloud, an IBM Company" Today (a Day Ahead of Red Hat)
Expect the same from Red Hat next
British Prime Minister Recognises Social Control Media as National Cohesion Problem
one has to wonder if addiction to social control media is not compatible with peace
The Future Isn't Social Control Media (Nothing Will be Left of It, Not Even Archives)
"Error code: 502 Bad Gateway"
GNU/Linux Usage in China is Increasing
China is leaving Microsoft and Windows behind
43 Years of GNU and GAFAM's (Especially Microsoft's) Attacks On It
GNU is very widely used (when people say "Linux commands" they typically mean "GNU programs"), hence it's being attacked a lot
CDMAG Covers Free Software, New Magazine From Decent People
If enough people accessed their site, they would not rely on social control media (third parties, censorship platforms)
Brigading Against Women - Part XI - An Abject Lack of Social Skills (and Not Knowing How to Handle Women)
GGG enjoy - if that's the right term - very bizarre or esoteric sex life
Gemini Links 30/09/2026: Accelerationism, "The Billionaire is Wrong", Rant About LLM-generated Support E-mails
Links for the day
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Tuesday, September 29, 2026
IRC logs for Tuesday, September 29, 2026