Lobsters - 03 Dec 2026
Page 7 of 10
What happened next depended on a choice the administrator made when installing the server. Per Server meant buying a number of simultaneous connections to one machine, at least five. The warnings began at about 90 to 95 percent of what you'd bought. For a while you could go over the limit with a warning that new requests "may not be granted", and beyond that margin it turned them away. Per Seat meant buying a Client Access License for each computer to use the organisation's servers. In this mode the service recorded who connected and directed the administrator to the Licensing tool to see how many licences to buy. The licence allowed one change from Per Server to Per Seat. The applet asks "Do you want to cancel this request?" and makes Yes the default.
CAPTION "License Violation"
FONT 8, "MS Shell Dlg"
BEGIN
LTEXT "You have requested a change that violates the license agreement. The license for this product only allows for a one-time change from a Per Server to a Per Seat configuration.",
401, 30, 6, 207, 29
LTEXT "Do you want to cancel this request?", 402, 30, 41, 207,
8
DEFPUSHBUTTON "&Yes", IDCANCEL, 45, 57, 40, 14
PUSHBUTTON "&No", IDOK, 101, 57, 40, 14
The counts travelled up the network from each member server to a domain controller in the same site, and from there to a "site license master". Whoever wrote the replication thread in ds/netapi/svcdlls/lls/server/repl.c describes its wait for work as waiting "to be given the opportunity to serve the greater good".
//
// Loop forever waiting to be given the opportunity to serve the
// greater good.
//
for ( ; ; ) {
//
// Wait to be notified that there is work to be done
//
Status = NtWaitForSingleObject( ReplicationEvent, TRUE, NULL );
A few lines further down, before it sends anything, "So they said, go replicate my son... Yeah, but first we must ask the master for permission." The same code was compiled into Not For Resale editions with the count fixed at three or five connections for BackOffice kits, ten for a special NT Server. The applet holds the NFR edition of Small Business Server to two users. The 1996 readme has this just after the list. "Marketing forces being what they are, I'm sure more versions will appear."
Terminal Services counted its users in License Logging as TermService, but its licences came from a separate server. The messages call it the Hydra License Server, from Terminal Server's old code name. Until it had been activated with Microsoft over the Internet, by web page or by telephone it could only issue temporary licences. Each licensing mode got a small policy class. There was Per Seat, Per Session (formerly Concurrent), Remote Desktop for Administration with its two connections, and XP's single-user Remote Desktop. XP's whole policy takes 63 lines and introduces itself as "A dummy licensing policy for Personal TS." A small table in the module answers a different question, whether the client already has a licence included. The rows are other, Windows 2000, XP and later clients. In the Windows 2000 server column the other-client row is denied and the next three are allowed, which is where the entitlement for Windows 2000 and XP Professional clients comes from. The next two columns, XP-generation and later servers, deny a built-in licence to all four.
#define DENY_BUILTIN 0
#define ALLOW_BUILTIN 1
static char LicenseTable[NUMBER_OF_CLIENT_OS][NUMBER_OF_TERMSRV_OS] =
{
{DENY_BUILTIN, DENY_BUILTIN, DENY_BUILTIN },
{ALLOW_BUILTIN, DENY_BUILTIN, DENY_BUILTIN },
{ALLOW_BUILTIN, DENY_BUILTIN, DENY_BUILTIN },
{ALLOW_BUILTIN, DENY_BUILTIN, DENY_BUILTIN }
};
To find its licence server, the terminal server tried the administrator's list, then servers published in Active Directory, then the local domain or workgroup. The comment in efind.cpp is "TODO: add error codes/handling to all of this". In Active Directory the code tries its site first. If that fails, it asks the other sites using a separate search filter.
#define LICENSE_SETTINGS L"TS-Enterprise-License-Server"
#define LICENSE_SETTINGS_FORMAT L"LDAP://CN=%ws,CN=%ws,CN=%ws,%ws"
#define LICENSE_SETTINGS_SIZE CWSTR_SIZE(LICENSE_SETTINGS)
#define LICENSE_SETTINGS_FORMAT_SIZE CWSTR_SIZE(LICENSE_SETTINGS_FORMAT)
#define SITES L"sites"
#define SITES_SIZE CWSTR_SIZE(SITES)
#define CONFIG_CNTNR L"ConfigurationNamingContext"
#define CONFIG_CNTNR_FORMAT L"LDAP://CN=%ws,%ws"
#define CONFIG_CNTNR_FORMAT_SIZE CWSTR_SIZE(CONFIG_CNTNR_FORMAT)
#define ROOT_DSE_PATH L"LDAP://RootDSE"
#define ADS_PATH L"ADsPath"
#define SEARCH_FILTER L"(CN=TS-Enterprise-LicenseServer)"
Setup creates the object as TS-Enterprise-License-Server. The search of the other sites runs License and Server together, and I couldn't find that spelling anywhere else in the tree. As far as I can tell, that search would miss the object. I haven't been able to test it.
Odds and ends
- Many of the drivers that came with XP show 7/1/2001 and version 5.1.2535.0 in Device Manager, although XP was build 2600 and was finished in August. Both of those numbers are written down in tools/razzle.cmd. tools/razzle.cmd, lines 194 to 196@rem Set the default inf stamp date for WinXp.
set STAMPINF_DATE=07/01/2001
set STAMPINF_VERSION=5.1.2535.0 Unless a component asks for a different date or version, those are the values the build stamps into its INF file.
- Notepad decides whether a file without a byte-order mark is Unicode by asking IsTextUnicode. "If it doesn't, bug IsTextUnicode", says the caller about the possibility of it getting the answer wrong. The heuristic compares how much the high and low bytes of each 16-bit unit vary. An ordinary English sentence can look like 16-bit text to that test. In the well-known four-word example the text comes back as .
- Bliss, often called the most viewed photograph ever, is in the tree as a 51 KB JPEG. Setup converts it to a 1.4 MB BMP "since user can't handle .jpg's and we don't want to force Active Desktop on".
- XP's graphical setup kept a couple of the developers' debugging hooks in the shipping build. One carried the note "Can be turned off before we ship if we don't find use for this". It stayed on, which is why setup pauses for two seconds before getting under way.
- When the Pentium division bug turned up in 1994, NT gained a boot test that divided 4195835 by 3145727, multiplied the result by 3145727 again and checked that 4195835 came back. base/ntos/ke/i386/kernlini.c, lines 2234 to 2243Dividend = 4195835.0;
Divisor = 3145727.0;
_asm {
fld Dividend
fdiv Divisor ; test known faulty divison
fmul Divisor ; Multiple quotient by divisor
fcomp Dividend ; Compare product and dividend
fstsw ax ; Move float conditions to ax
sahf ; move to eflags On a flawed chip NT could switch off the floating-point unit and handle those instructions in software in ntdll. The emulator's files say "by Tim Paterson". The Tim Paterson who wrote 86-DOS was back at Microsoft then, so I think it's very likely him. In XP nothing sets the variable that runs the test. The code was still in the tree.
- IE6 decides between its quirks and standards modes in one function. The Windows 2000 help files get special consideration because, as the comment points out, "Windows 2000 is already shipped". One old doctype is a "Netscrape bookmark file". In wininet you can also find HttpOnly, a cookie flag familiar from much later web applications. It debuted in IE6 SP1 in about a dozen lines of code.
- There's an email thread in the font subsetter, windows/core/ntgdi/fondrv, complete with instructions to "Read this email thread in reverse order". The subject in April 1996 was "Middle Dot". Why should byte 0xB7 in the Windows character set show a bullet? In 1992 Word had been using the glyph to mark the spaces when you showed the formatting. The true middle dot ran into the letters next to it at small sizes. Apparently the decision still needed explaining four years later.
- XP's first firewall put the log format on a separate line. The header of every log began "#Verson: 1.0".
- How does Explorer go from the list of files you're copying to a number of minutes left? In shell/shell32/copy.c a file counts for one point, a folder for one, and 32 KiB of data for another. Move within a drive and no points go on copying the data. Move to another drive and each file and folder counts twice since the old one has to be deleted after the new one is made. Every two seconds the dialog counts how many points it got through. To estimate the rate for the rest it gives that new speed one vote and the previous speed two, then divides the points left by the resulting average. It takes a while for news of a slow disk to get through to the dialog.
shell/shell32/copy.c, lines 3101 to 3112else if (dwTimeLeft > 60)
{
// Note that dwTime is at least 2, so we only need a plural form
LoadString(HINST_THISDLL, IDS_TIMEEST_MINUTES, szFmt, ARRAYSIZE(szFmt));
dwTime = (dwTimeLeft / 60) + 1;
}
else
{
LoadString(HINST_THISDLL, IDS_TIMEEST_SECONDS, szFmt, ARRAYSIZE(szFmt));
// Round up to 5 seconds so it doesn't look so random
dwTime = ((dwTimeLeft+4) / 5) * 5;
} The final adjustment is for the person sitting there watching. Seconds go up to the nearest five "so it doesn't look so random". Over sixty seconds it's rounded up to minutes, over four hours the dialog stops offering a figure. A comment says it updates every ten seconds. The actual timer says 2,000 milliseconds. Raymond Chen wrote in 2004 that you can know the amount of work left perfectly well and still have to guess what the disk or the network will do next.
What was cleaned out of the comments
We have something better than an impression that the comments were tidied up. Kuro5hin quoted the Windows 2000 originals in 2004 in "We Are Morons: a quick look at the Win2k source", counting "a dozen or so" f-words and s-words. Take XP SP1's C, C++, assembly and header files and search for the f-word. Zero. Take some of the surrounding words from the Kuro5hin piece and they're still here. There's a particularly obliging pair in shell32's util.cpp.
In Windows 2000 the offending party is "the fucking alpha cpp compiler" which "seems to fuck up the goddam type "LPITEMIDLIST"". After another few words for the compiler ("fucking peice of shit") the writer explains passing the final parameter as a void pointer.
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
In the SP1 tree the instruction to the next programmer is the same. The description of the compiler has acquired a certain restraint.
"alpha cpp compiler confused by the type "LPITEMIDLIST", so to work around this we pass the last param as an void *instead of a LPITEMIDLIST".
They left the space in "void *instead" just where it was. In another file "DOING SO FUCKS THE BUILD PROCESS" turns into "DOING SO MESSES UP THE BUILD PROCESS". Rather nicely, whoever altered that line removed four exclamation marks from the end of it so the box it was drawn in still lined up.
/*
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* !!!!!!!IF YOU CHANGE TABS TO SPACES, YOU WILL BE KILLED!!!!!!!
* !!!!!!!!!!!!!!DOING SO MESSES UP THE BUILD PROCESS!!!!!!!!!!!!
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
*/
Was it PoliCheck? Microsoft had such a tool, and Michael Kaplan wrote about it in 2010, but that doesn't tell us what ran on these files. Common controls still get "stinking piece of shit", Notepad gets "such a #@@!@#@ an app", and Calculator gets as far as explaining "what the [censored] I did here". Leave the speech dictionaries aside and there are two traces of the f-word elsewhere. One's a label in a prebuilt DLL from the 16-bit compiler tools, cut off after 31 characters at JMPLOADZEROBECAUSETHISFUCKINGLA. In its source the same label now reads JMPLoadZeroBecauseThisLanguageHasNoFarConditionalJump. The other is on line 1252 of junkmail.lko, in the 1998 spam filter. For everything that went into getting that word out of the tree, the email model only gave it a weight of 0.028.
As for "we are such morons", the developers were talking amongst themselves. What went to the public SDK depended on hsplit, rewritten in 1996, which split a .w file into public and private headers. The complaint about a wizard redesign between IE4 and IE5 is in the private part of shell/published/inc/prsht.w. There were two unrelated wizard styles with similar names to accommodate. What people outside Microsoft saw of the discussion was one flag, PSH_WIZARD97.
#if (_WIN32_IE >= 0x0400)
//----- New flags for wizard97 -----------
;begin_internal
// we are such morons. Wiz97 underwent a redesign between IE4 and IE5
// so we have to treat them as two unrelated wizard styles that happen to
// have frighteningly similar names.
#define PSH_WIZARD97IE4 0x00002000
#define PSH_WIZARD97IE5 0x01000000
;end_internal
#if (_WIN32_IE < 0x0500)
#define PSH_WIZARD97 0x00002000
#else
#define PSH_WIZARD97 0x01000000
#endif
An exemption from checking a FAT volume gets explained as "a reasonable hack-o-rama to make BillG happy". Gates had installed Beta 3 and got chkdsk on his machine. Setup wrote to the disk late in the installation. By the time of the check, other activity on the volume had left it temporarily looking dirty. The last sentence identifies the bigger trouble. FAT didn't have a journal.
// This logic is a reasonable hack-o-rama to make BillG happy
// since his machine ran chkdsk after he installed Beta 3. Why?
// 'cause setup cracked a non-exclusive DASD handle near the
// end of setup, wrote some data, closed the handle and we
// set the verify bit ... came back around and saw that other
// arbitrary activity had left the volume in a temporarily dirty
// state.
//
// Of course, the real problem is that we don't have a journal.
Now read the FAT driver Microsoft published as an open sample on GitHub. "This logic is a reasonable change. Why?" Everything from the explanation to the sentence about the journal is still there. Only the account of BillG's machine has slipped out of the story.
The swearing that survived
You could still swear in print if you spelt things inventively. The file cache, on its way to waking the thread that writes to disk, calls a routine which under a particular condition will do nothing. The programmer had to go and read somebody else's source to find out that much. "I had to peak in the sources", the comment begins, and "Sheeeeit!" is how it ends.
// I had to peak in the sources to verify that this routine
// is a noop if the Flink is not NULL. Sheeeeit!
OLE had a master file defining extension interfaces for headers outside developers were going to use. The house rule at the top of it was "Keep random shit OUT of this subdirectory, or die."
// Warning: Keep random shit OUT of this subdirectory, or die.
"We seem to have shipped this thing with a giant leak." Disk Cleanup had already allocated a buffer by the time a cleaner could throw the pointer away. They went on allocating it because shipping customers might well have a cleaner expecting to get that buffer. The comment calls it "the dumbass part" and the variable put aside to save the buffer is wszDumbassLeakProtection.
// We seem to have shipped this thing with a giant leak. The object is supposted to set
// pClientInfo[dwClient].wcsDescription to NULL if the registry value should be used instead
// of the buffer. However we just allocated a buffer for pClientInfo[dwClient].wcsDescription
// in the code above (this is the dumbass part). All the filters then set this pointer to
// NULL and it's bye-bye buffer. I can't simply not allocate this memory because some cleaners
// might rely on being able to use this memory and we shipped it that way.
LPWSTR wszDumbassLeakProtection = pClientInfo[dwClient].wcsDescription;
The F1 help fix for the networking tools' IP address controls is described in exactly the same terms in three files, down to the two "f**king"s at the beginning and the "*SIGH*" at the end. rundll32 calls SetErrorMode to "turn off critical error bullshit". The failure code for a crash dump, over in Windows Error Reporting, goes into dwAwShit. Somebody copying a warning into nine DirectShow files had exercised their editorial discretion. A "<deleted> person" had turned the damned level 4 warnings back on in the header.
What Microsoft said about itself
Program Manager still built as progman.exe. Whoever wrote this bit of its DDE code would have liked to ask a simple question about window state and couldn't. Their professional opinion of the Windows API is that "it really is the worst windowing system I have ever used." I rather like the consolation they find for a lack of consistency in the design. "Luckily orthogonality doesn't affect stock prices :-)".
// It would be nice if there was some way to query a SW_ value
// but I guess it would too much to ask for windows to be even remotely
// orthogonal. I don't know who "designed" the Windows API but it
// really is the worst windowing system I have ever used.
// Luckily orthogonality doesn't affect stock prices :-)
The person making FTP folders work in XP thought wininet could have done something about a bug where files looked like directories. The wininet team couldn't reproduce it. "It's no repro because I did this work around!", says the person who had made the folders work.
// NOTE: IE #30208: Currently broken in wininet. The dorks in wininet never fixed this because
// they say it's no repro. It's no repro because I did this work around!$#!@@#%!!!
//
// I want to test the attribute flags but for some reason the FILE_ATTRIBUTE_DIRECTORY bit
// is also set for files!!!! (!@(*#!!!)
Next page | Previous page | More Lobsters | Headlines
Original: https://lr0.org/blog/p/winxp/