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

IBM, Running Out of Things It Can Sell, is Selling Software Patents
IBM is not just pathetic; it's actively harmful because it lobbies for software patents and spreads software patents around
The 'Church' of Moglen/Stallman
'reunion' with Eben Moglen
Microsoft Has Fallen to #3 in Singapore
There are many technically talented people in Singapore or overseas workers who lodge in Singapore
 
As Expected, Facebook Collapses, Microsoft Hides Massive Debt
GAFAM is a giant mountain of debt
At The Register MS "PARTNER CONTENT" Means Company Writing Fake Articles About Itself and Its Own Products
At The Register MS, content-farming has become a thing
Staff of EPO Cautions Against Unlawful Weaponisation of PIPs Against Industrial Actions That Protest Corruption
PIP-like sanctions against anybody who does not toe the line of Cocaine King?
Gemini Links 29/07/2026: Star Trek, Retirement, and ODEs in GNU Octave
Links for the day
Links 29/07/2026: "BuzzFeed Lays Off 33 Percent of Remaining Staff" (Trying LLM Slop Some More), Scam Altman Mocked by the Media
Links for the day
GNOME Curated and Censored by IBM (Under the Guise of "Code of Conduct")
Felipe Borges (IBM) has just posted a follow-up
Digital Mass Surveillance as a Hallmark of Failed Societies
"small leap forward in tech ethics"
I Found a Typo, Don't Vote!
Social control media isn't good at adding any meaningful signal
Jeremy Sands Explained the Harms of Codes of Conduct
next week the 500th show milestone [is reached]
Tonight's Earnings Report From Microsoft and Facebook ('Meta') Will be Faked Because They Hide Almost a Trillion Dollars in Debt
The US economic system is only as honest as the people who govern it
The Vacuum Syndrome
Parables help
The Only Old People Who Can Survive IBM Are the CEO and His Circle of Enablers
very similar to what's happening at the EPO
Microsoft Layoffs Aren't Done Ahead of the Need to Tell Shareholders About "Efficiency" (Tonight)
Microsoft layoffs won't be "Done" until what's left of Microsoft is "None"
Microsoft Lacks Growth. Ahead of 'Results' The UK's Competition and Markets Authority (CMA) Finds Merit in Allegations Slop is Microsoft's Excuse for Price Hikes (Piggybacking Vendor Lock-in).
At this stage it's not hard to see why many nations gravitate away from Microsoft
Parliament leaks confidential cult inquiry witness contact list (COFG Victoria)
Reprinted with permission from Daniel Pocock
Troll-Feeding is Time-Wasting
in social control media
WordPress is Technical Debt
There are a number of technical tasks underway and maybe some testing (this coming weekend or later)
Will Red Hat Still Exist in 2027 or Just Become a "Brand" at IBM?
Whistleblowers told us IBM was laying off about 500 Red Hat engineers earlier this year
Call for IBM Whistleblowers
If you work for IBM and have something material (like balance sheets) to prove financial misconduct, please try to 'touch base' and establish a secure communication channel we can both use
EPO Series on EU and Pan-European Corruption, Vote-Rigging, Extending Beyond the EPO Itself
By Saturday it will be August already, so we'll start preparing for Rianne's birthday
SLAPP Censorship - Part 133 Out of 200: Lies by Omission
As usual, the other side wants people to ignore how much they lost
European Patent Office (EPO) Series: Streamlining the Decision-Making Process
Negrão was one of 17 applicants for the position but he somehow managed to end up as the sole candidate on the shortlist prepared by the Management Board in June 2020
Links 29/07/2026: "Hugging Face Has a Deepfake Nudes Problem" and "$1.5B Anthropic Copyright Infringement Ruling" (Plagiarism is Not "Training")
Links for the day
Comments on Today's Judgment
It hopefully helps clarify what actually happened
Thank You, Andy
Burnham and "Tech Rights"
Solicitors Regulation Authority (SRA) Inaction and Incompetence - Part II - 77 Messages Sent, Did Not Even Investigate or Examine Any of the Actual Evidence (British Taxpayers' Money Wasted)
SRA has become known (even notorious) for inaction
Inevitable Politics
In technology, provided the work you do has growing impact (we served almost 2 million requests yesterday), things will inevitably become more political - whether you like it or not does not matter
Not Only "Loonies Take on Farage"
pretending that the opposition to the right wing is "Loonies"
Brigading Against Women - Part I - Bypassing the Legal System by Threatening Companies in Another Continent
In the next part we'll begin to connect Lozza's online activities (and court activities) to those of Garrett
IBM is Trying to Turn Debt (Borrowed Money) Into Fake Growth and It'll Worsen Matters
they put in their balance sheets a fake "growth" in something that does not even exist
Microsoft Relies on Misleading Narrative of Studios Going 'Independent'; in Reality There Are Mass Layoffs in Them
This is not a good narrative for Microsoft
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Tuesday, July 28, 2026
IRC logs for Tuesday, July 28, 2026
Gemini Links 29/07/2026: Arosa, Tired Tuesday, and Constellation Browser
Links for the day
In IBM, PIPs and RAs (Layoffs) Have Become Almost the Same Thing, Workers 'Expire' With Age (Seniority, Experience) and Empathy is Punishable by Termination
IBM does seem like a dead company
At Microsoft, PIPs Are Sometimes Known as "LITE" (a Silent Layoffs Legal Hack or a Shrewd Workaround to Skirt WARN Act)
Zero "layoffs" to report
Gemini Links 28/07/2026: “Strategies Against Algorithms” and DIYers
Links for the day
"Social Dialogue" With the Man Who Never Faced Real Competition at the European Patent Office (EPO), He Buys the Voters and Eliminates Rivals
Will the "Pretender" write back?
Digital Restrictions (DRM) and Microsoft: What Kills XBox Will Kill Windows Next
Microsoft wrongly and very arrogantly assumed that users would tolerate everything it throws their way
GNU/Linux in Afghanistan Reaches 7%
For many years it was stuck at less than 1%
Greenwashing Corruption With a "Chief Sustainability Officer", Who Infamously Defended Battisetelli's Crimes at the EPO and Petitioned for Him
She was rewarded for conspiring against EPO staff, as usual
What I Explained to Police About Blackmail and Death Threats via Burner Accounts (a Practice Which Generally Constitutes a Crime)
Today I've communicated several times with police
Links 28/07/2026: "People’s Claude Chats Are Publicly Accessible Online" and SpaceX Stock Crashes Like Its Products
Links for the day
UK tech sector missing from democratic process
Reprinted with permission from Daniel Pocock
How Not to Cover Elections (Democracy Relies on Reliable, Complete Information)
Misinformed voters are a recipe for disaster
Microsoft E.E.E. (and "Bait and Switch") Going Exactly According to Plan
That is what they are trying to tell us and the companies that employ us
IBM: An Old Company That Hates Old People
Remember that's coming to Red Hat workers in 2 months
Strict Policy on Violence and Violent Language
This matter is now being escalated to law firms
Avoiding Discrimination Against People With Disabilities
work underway to improve the system which runs the sites
Links 28/07/2026: XBox DRM Doomed Everyone (Cannot Play Anything), Slop (Ponzi Scheme) Being Pinkwashed Now
Links for the day
Gemini Links 28/07/2026: Ethics, GIMP Script-Fu, SMTP Versus Gemini, and Proposal for Better TOFU
Links for the day
To a Sociopath, Ethical People Are Bad People. Don't Fall for It.
If you put sociopaths on a pedestal, the pedestal will break
Improving the Static Site Generator
Our system has fixes triaged
Diversity in Debian
bringing up the topic is the real problem, diversity itself is a taboo subject
GNU/Linux in Brazil. The B in BRIC(S).
the "market share" is assessed to be around 5%
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Monday, July 27, 2026
IRC logs for Monday, July 27, 2026
Hate Consumes the Haters
If you hate someone (or something) and you're willing to do anything for "hate rituals", then at the end the emotion will outweigh reason and it'll backfire, surely
GNU/Linux Rises Some More Internationally, statCounter Now Estimates Its Usage on Desktops/Laptops at 7.7%
significant growth for GNU/Linux in Japan, China, Thailand, Vietnam, Indonesia and Cambodia
IBMers on PIPs and the Age (or Cost) Factor
People in their 50s seem to be targeted as they are considered "expensive"
Sad State of Troll-Feeding British Media (Establishment Channels Promoting Total Idiots)
Breeding ignorance means people will assume they have a choice between two pieces of trash: "Nige" or a literal trash can
Links 27/07/2026: Sleepless Japan PM Takaichi Becomes Unpopular and Data Centre Magnate Confiscate Land Without Consent
Links for the day
A Few Hours Ago The Register MS Published an 'Article' With "AI" 32 Times in It, Including First Word in Headline and Summary. It Was Paid SPAM "Sponsored by Hammerspace".
The lost media is engaging in self-harm
Microsoft is Down
This relates in a timely fashion to what we published yesterday
In Techrights, Gemini and HTTP/HTML Are Very Different
Those were never equivalents or mirrors, those are two things that are inherently different and are maintained by different teams
Gemini Links 27/07/2026: Gemified Internet RFCs, “Junk DNA” Is Commented-Out Code, and More
Links for the day
The Techrights Gemini Capsule Was Never a Mirror
Techrights has long taken accessibility quite seriously
Americans Are Not Our Masters
If you are subjected to online abuse, don't give up
Daniel Pocock Campaigns Around "Safety of Children Online" and "Cybersecurity"
There seems to be a growing 'coalition' in the UK based around important issues which impact the entire planet
XBox the Console is Practically Finished (Unofficially), Even the Streaming ("Live") or DRM Service is Dead
XBox has never been closer to profitability
Many CEOs Are Just Glorified Scammers With Suits and Ties
Economies cannot function when few people abuse them for self-enrichment
After statCounter Figures Out Many "Unknowns" Were in Fact GNU/Linux the "Market Share" Estimate in China More Than Doubles
Japan is the same for similar reasons
peppe8o - a Site About Raspberry Pi, Arduino and Electronics - Has Turned Into a Slopfarm
We won't be linking to it anymore
Feeding 'the Children'
Maybe some time soon we'll do a fund-raiser to help feed the birds
Japan: GNU/Linux Crosses the 5% Threshold, Two Years Ago It Was Only 1%
Now it's at over 5%
We Need More Transparency
Our heads of state are very much aware of and concerned about SLAPPs and censorship
"The War on Children" Explained by The Cyber Show
Consumer protection and the war on children
EPO Cocainegate and Current EPO/EU Series to Carry on for Months to Come
Another week has begun
When IBM "Managers Have to Mark 15% of Their Teams as Low Performers" a PIP Means Likely Layoffs (Disguised as a Performance Issue)
"IBM is a Law firm with an I/T department."
Links 27/07/2026: Chatbots Lead to Suicides, Social Control Media Intentionally Designed for Addiction
Links for the day
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Sunday, July 26, 2026
IRC logs for Sunday, July 26, 2026