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

An American War on GNU/Linux, Software Freedom, and British Investigative, Science-Based Reporting - Part I - A Matter of National Security
Those people are Americans who try to advance the interests of American corporations by weaponising courts abroad
 
Activism/Journalism in Our Blood
one must fight for one's principles
Gemini Protocol in Its Prime
What's particularly neat about Gemini Protocol is that it's fast and cheap
Microsofters' SLAPP Censorship - Part 6 Out of 200: Intentionally Misnaming Women, People Who Offered to Testify That They Too Had Been Subjected to Similar Abuse
Today it is International Women's Day
Even Fedora Leadership Cannot Figure Out the Microsoft Kill Switch/Back Door, 'Secure' Boot
It does not actually enhance security
Bruce Perens: Richard Stallman "Has Achieved His Goal"
Stallman's next talk is tomorrow
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Saturday, March 07, 2026
IRC logs for Saturday, March 07, 2026
Gemini Links 07/03/2026: Buying Woodland, Indra 1.3.0 Available, and LLM Exhaustion
Links for the day
The Harder They Attempt to Take Down This Site (and Take Away Liberties), the More People Will See This Site
We'll carry on as usual, as from sunlight comes justice
Why They Always Try to Shoot the Messenger (When the Message Harms Profits)
A matter of economics
Coinbase - Like Block - is in Huge Trouble, Its Debt Nearly Doubled in Half a Year
The real reason Block is collapsing is its debt
Starting Another New Series This Evening, It's About American Folly
today commences a series long in the making (years)
Nations Stand to Benefit From Gender Equality and Increased Participation by Women
International Women's Rights Day starts in about 6 hours in the UK
Microsoft is Losing It, Now It's Censoring Its Critics and Sceptics
Whether the measurements made by statCounter are accurate or not, the trends (long-term) typically make sense
WIRED (Conde Nast) Reviews Are Paid-for Marketing Spam, They Change Dates on Old 'Articles' to Make Them Look Relevant and New
The Web is fast becoming a burial ground for ads, trash, spam, and slop
Gemini Links 07/03/2026: Humour, Chilling, and Oversized 'Phones'
Links for the day
Cyber|Show by Andy and Helen Recommended by Techrights and Tux Machines
If your time is limited and you look for informative essays and shows (audio)
Links 07/03/2026: CJEU to Finally Examine Behaviour of the Illegal and Unconstitutional Unified Patent Kangaroo Court, Creative Commons (CC) Hosts Open Heritage Statement Event in Amsterdam
Links for the day
Microsoft's Thailand Problem
It's definitely not Windows
New Lows for Microsoft in Micronesia
GNU/Linux has shown some growth there too
Microsofters' SLAPP Censorship - Part 5 Out of 200: Clearly Not a Security Professional/Expert, Only Ever Pretending to be One
"The Claimant says he is “a computer security expert”, but his background and his track record in the education sense (genetics) does not support this assertion."
Links 07/03/2026: Fuel Already Running Low and "Economic Crisis of the Iran War"
Links for the day
The Corporate Media Repeated the Lies Told by Jack Dorsey ("AI" Hype), Now It Does the Same for Larry Ellison
Disregard the hundreds of headlines that say mass layoffs at Oracle are due to "AI" something
The Free Software Community is Gaining Momentum as Its Importance is More Broadly Realised
As long as "trendy" technology goes in a negative direction there will be a growing portion in society looking for alternatives
Spooking or Chasing Away Women (From Computer Science)
The status quo discourages women from even trying to study Computer Science and related disciplines
"IBM Has Changed So Much in the Last Decade to the Point It's Completely Unrecognizable."
IBM is a dying, rotting company with a morbid culture
The Register MS, Sponsored by Communist Party of China (CPC)
What will happen when the bubble crashes the economy?
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Friday, March 06, 2026
IRC logs for Friday, March 06, 2026
Gemini Links 07/03/2026: Coffee Problem, Marchintosh, Learning, and "Selectively Disabling HTTP"
Links for the day
Under IBM, Some Fedora Blog Posts Have Become LLM Slop! (Red Hat is Doomed by Slop Fanaticism)
Who would even bother reading such trash?
Lots of People Leaving IBM Today
IBM cannot be trusted
Dances With Wolves, Wakes Up With Fleas
Small minds say "td;dr" whereas the rest say, "give me information, give me time to study it"...
LLM Slop Rare and Scarce This Friday
We still hope that by the end of this year slop will become nearly extinct
Defending British Democracy From American Predators
We stand united and strong in the face of predators
Links 06/03/2026: LLM Prompt-injection Vulnerability in Microsoft's Proprietary GitHub, "260,000 Federal Jobs Lost"
Links for the day
It's Friday and Many People Publicly Announce Leaving IBM (Which is Engineering 'Willful' Departures to Mask RAs' Scale)
We understand from whistleblowers that IBM already destroyed Red Hat's culture
Dr. Richard Stallman (RMS), the Man Whose Mind Scares GAFAM et al, Began Speaking in Switzerland
His ideas and ideals are not obscene
Gemini Links 06/03/2026: "Setting up the Feed" and Using Molly Brown
Links for the day
Links 06/03/2026: Can't Copyright Slop in US, Microsoft Became Slop Provider for Militarism
Links for the day
Garrett Does Not Just Try to Cover Up for Himself, He's Clearly Covering Up for His Mates From Microsoft (and Admits Third Parties Fund His Litigation, With Their Legal Bills Estimates Already Approaching $1,000,000)
They have already sent us about 75 KG of legal papers. How is any judge supposed to keep up?
Richard Stallman in the United States - Part IV - Back to Switzerland
The "cancel mob" tried to "finish off" RMS 5 years ago
Dr. Richard Stallman in Ada Lovelace Lecture Series 20 Hours From Now in Lucerne School of Computer Science and Information Technology (Rotkreuz)
Well-connected and affluent corporations want everything to be controlled by them, ranging from culture to words and news
Threats Issued to Daniel Pocock Having Launched the JuristGate Web Site Which Covers Financial Fraud in "Legal Insurance" Clothing
Is our world governed by laws or by rich corporations (or nations/superpowers) with well-connected lawyers/politicians?
International Women's Day: At the EPO, for Women to Become Managers They Need to Sleep With Well-connected Men and Mingle With Corrupt Men
Sunday is International Women's Day
Dr. Richard Stallman Starts His Talks in Switzerland in 8 Hours
They try to assess how many people plan to attend to ensure everyone gets a seat (without compromising the privacy/identity of those attending)
IBM Red Hat Layoffs: It's Not About "AI"
"Automation" is not "AI", it's just a generic term which can describe jobs left for machines to do, sometimes computers
Microsoft Windows Used to be Identified on Over 99% of Web Requests From Benin. Now It's Around 50%.
Or a lot less
Microsoft 'Open' 'AI' Has Severe Financial Problems, Version Inflation ("GPT-5.4") is Mindless Hype and a Misleading Distraction
In practice, both users and sponsors of ChaffGPT are fleeing
The Techrights Static Site Generator (SSG) Turns 5 Next Year
It's still under active development in our Git servers
New XBox Boss (Sharma) Implicitly Confirmed XBox (the Console) is Now Dead
Vista 11 is now also known as "XBox"
Murder as a 'Joke' to GAFAM People (Sociopathy)
When it comes to Microsoft and Salesforce, they profit from this mentality
GNU/Linux Seen as Rising to 20% in Eritrea, But That's statCounter Identifying "Unknown" as GNU/Linux
What if statCounter managed to figure out what all those "unknowns" are?
Microsoft ‘Project Helix’ is Just a Tweet in MElon's "X"
Some "tweet" is easy, as words are cheap
Microsofters' SLAPP Censorship - Part 4 Out of 200: Rianne’s Version of Events and Narrative
today we tell Rianne's experience
EPO Staff to 'Meet' This Coming Tuesday to Plan Industrial Actions Including Upcoming Strikes
using Microsoft spyware to organise this can be an own goal because Microsoft serves the dictators, not the union that tries to topple them
Thousands of EPO Workers Rally Against EPO Management
The staff is furious to see what became of the EPC and the EPO. This is not sustainable.
In Argentina Firefox is Measured at Only 1%, Google Chrome (Proprietary) at About 90%
And it has long been that way
IBM's March 2026 Layoffs Already Happening (to Accelerate Soon in Europe and America)
We're probably seeing some of the last years of IBM and it's anything but certain that IBM can survive the coming decade
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Thursday, March 05, 2026
IRC logs for Thursday, March 05, 2026