Lobsters - 03 Dec 2026
Page 3 of 10
The browser's place inside Windows was also being negotiated in court. XP SP1 added Set Program Access and Defaults, the Add or Remove Programs page for choosing competing browsers and other programs and hiding access to Microsoft's equivalents. Microsoft's SP1 announcement explicitly ties these changes to its antitrust settlement. The implementation leaves a very literal trace. Hiding Internet Explorer sets the hidden and system attributes on iexplore.exe, while leaving it on disk. That decision then has to spread through the rest of the shell. The code that supplies Open With's applications checks for those attributes before offering IE.
// however, if the EXE has been marked as superhidden,
// then the consent decree UI has hidden the app
// and it should not show up under the open with either
if (fRet)
{
fRet = !(IS_SYSTEM_HIDDEN(GetFileAttributes(szExe)));
}
"Consent decree UI" is a comment in the file-association code. A legal remedy has become a test of two filesystem attribute bits.
But another path in the same shell shows how much work it took to make a default browser mean what it said. A music folder's task pane offered "Shop for music online". Its handler gets the shopping URL and passes it to the current shell browser.
// Nope - look for the regular music buy URL
hr = pThis->_GetShoppingBrowsePidl(pv, psiItemArray, pbc, &c_BuyMusic, &pidl);
if (SUCCEEDED(hr))
{
hr = pThis->_BrowseObject(pidl, SBSP_NEWBROWSER);
ILFree(pidl);
}
_BrowseObject asks the current shell browser to navigate, with SBSP_NEWBROWSER requesting a new window. Following the call takes you through shdocvw into Windows's browser-frame machinery. It can reuse an existing built-in window or create one. It does not go through the user's registered alternative browser. On 15 January 2004, the Justice Department identified this exact shopping task as violating Section III.H of the final judgment because it opened IE even when the user had selected Netscape, Opera or Mozilla. Microsoft agreed to remove the override, without necessarily accepting the Department's interpretation. This SP1 tree predates that remedy. The distinction between opening a URL and telling the built-in browser to navigate it ended up in a federal compliance advisory.
The script ran on the same objects web developers were using at the time, and some of it is recognisable. XMLHttpRequest is in the published interface definitions as a 14-member COM interface, much of it recognisable in today's API. Two members the web never took up were responseBody and responseStream. In inetcore/webcontrols there's a 374-line behaviour from 2000 that turns an element into a web-service client, calling SOAP services asynchronously through XMLHTTP. It isn't part of the XP build, and it looks like an early version of the WebService behaviour Microsoft later offered as a download.
var fAsync = mode == "async";
__aryCall[iC].xmlHttp.open("POST", oService.soap.uri, fAsync);
__aryCall[iC].xmlHttp.setRequestHeader("SOAPAction",
oService.soap.methods[args[1]].soapAction);
__aryCall[iC].xmlHttp.setRequestHeader("Content-Type", "text/xml");
var szPayload = "<?xml version='1.0'?>"
+ "<Envelope xmlns='http://schemas.xmlsoap.org/soap/envelope/'>"
+ "<Body>"
+ szParams
+ "</Body>"
+ "</Envelope>";
if (fAsync)
{
__aryCall[iC].xmlHttp.send(szPayload);
__aryCall[iC].xmlHttp.onreadystatechange = getResult;
}
That's the pattern that got named AJAX five years later. It does set onreadystatechange after calling send(), though, the reverse of the usual order. The rest of IE6 is here too, and it explains a few things web developers remember. Its browser shell replaced a server's error page with a "friendly" page it generated when the body was 512 bytes or shorter (256 for a few codes), which is why people padded their custom 404 pages with junk.
//
// When an http error occurs the server generally returns a page. The
// threshold value this function returns is used to determine if the
// server page is displayed (if the size of the returned page is greater than
// the threshold) or if an internal error page is shown (if the returned page
// is smaller than the threshold).
//
IE6's Privacy slider was doing more than choosing whether to accept cookies. It read a compact P3P statement in a site's HTTP headers about what the site said it did with the data, and compared it with the rules for the level you picked. The default Medium setting is two long strings of boolean expressions in inetcore/wininet/http/cookiepolicy.cxx, one for the site you're visiting and one for sites embedded in it. Alongside accept and reject, the cookie code has two decisions called "leash" and "downgrade".
// "leash" means that the cookie will only be used in 1st party context
if (pState->dwPolicyState==COOKIE_STATE_LEASH)
dwImpliedFlags |= INTERNET_COOKIE_IS_RESTRICTED;
// "downgrade" option forces cookies to session
if (pState->dwPolicyState==COOKIE_STATE_DOWNGRADE)
dwImpliedFlags |= INTERNET_COOKIE_IS_SESSION;
A leashed cookie can be sent when you visit the site that set it, but not when that site is embedded in somebody else's page. A downgraded cookie becomes a session cookie, so it is no longer saved for later browser sessions. Microsoft's flag definitions spell out those storage and sending rules. Windows was trying to have the browser read privacy policies for you. It could control when a cookie was sent and how long it survived. The promises about what the server did with the information were still the server's promises.
The AlphaImageLoader filter exists, its header says, for "web pages that would like to display images that contain per pixel alpha", because ordinary PNGs went through a path that offered the decoder no surface with an alpha channel. The filter can stretch or crop an image but has only a TODO for tiling one, which is why you couldn't use it for a repeating background. CSS expression() values were handed to "the Trident recalc engine", which tracks dependencies between properties like a spreadsheet and always runs them as JavaScript. IE's conditional comments have an evaluator whose overview still shows an older syntax that could test the Java VM's version. A feature for client-side includes was never switched on.
// To enable client-side <![include "http://www.foo.com/foo.htm"]> feature,
// uncomment the following line
// Not enabled for IE 5.0 - no time to test it
// #define CLIENT_SIDE_INCLUDE_FEATURE
On XP Professional you could be on the server end of the request as well. IIS 5.1 used Denali for Active Server Pages. There's a version each for XP and .NET Server in inetsrv/iis/svcs/cmp. The compiler replaces the literal HTML between pieces of script with numbered Response.WriteBlock calls. It recognises VBScript and three names for JavaScript, JScript, JavaScript and LiveScript, the name Netscape used before December 1995. Somebody left a 1996 "Microsoft ActiveX Server" credits page beside it, a list of numbers XOR-encoded using "Denali rocks!". A marquee brings in the Denali Team, 129 people get thanks including Bill Gates, and Satchel Paige gets the last word about looking back. The build makes no mention of that page. The actual localhost page styles the product "Windows XP Server Internet Services", presumably from before the rename. It also contains a rather optimistic comment about its JavaScript running before the ASP that generated it.
Of the ASP applications I like Internet Printing best. You could read a shared printer's queue at the server's printers site. When the manufacturer supplied no status page, Windows asked the printer for its front-panel display over SNMP, using VBScript at the server. Each character went into a table cell against a grey background. The person trying to follow this in the code has the added pleasure of strBgnCol opening a row and strBgnRow opening a cell.
For i = 1 To iRow
srcIndex = 1
j = 1
While j <= iColumn
c = Mid (strArray(i - 1), srcIndex, 1)
If c = "" Then
tmpArray(j) = " "
Else
if Asc(c) <= 32 Then
tmpArray(j) = " "
Else
If strLang = "JP" Then
tmpArray(j) = OleCvt.ToUnicode (c, 932)
Else
tmpArray(j) = c
End If
End If
End If
j = j + 1
srcIndex = srcIndex + 1
Wend
strHTML = strHTML & strBgnCol
For j = 1 To iColumn
strHTML = strHTML & strBgnRow & tmpArray(j) & strEndRow
Next
strHTML = strHTML & strEndCol
Next
Certificate Services in the server editions made allowances for IE, Netscape with KEYGEN, and "Lynx or other minimal browser". The challenge in the Netscape form reads "provePequalsNP". On XP Professional the IIS query extension for the Indexing Service, idq.dll, used .htx templates to format search results. Code Red spread through that component in July 2001, a month before XP was finished. Microsoft's bulletin MS01-033 dates the XP fix to Release Candidate 1. This tree already has the fix.
The Indexing Service has a longer history than its web interface. It carries a piece of Cairo, Microsoft's early-1990s attempt to make documents searchable by their contents and properties as part of a much more ambitious operating-system design. The search engine was meant to live inside OFS, Cairo's proposed filesystem. There's a trace of the move out of it in svccatpx.hxx, the client-side proxy for the service catalog.
// File: svccatpx.hxx
//
// Contents: client-side proxy to SVC catalog.
//
// History: 28-Feb-1994 KyleP Created
// 16-Sep-1996 dlee ported from ofs to cisvc
Bartosz Milewski, who led the content-index work, wrote in December 2000 that his team had maintained two versions, the official one tied to OFS in the kernel, and another that ran in user mode against ordinary filesystems. He credits that second branch with letting the index survive OFS's cancellation. They had also used it to index NT's source code, making it valuable to developers who needed to find definitions and uses of functions. The component found a home in IIS, then Windows 2000. Microsoft's June 1996 announcement still explicitly sold the search technology, code-named Tripoli, as an element of Cairo.
The header here is part of the live implementation. Asking the Indexing Service administration code to merge an index leads through ForceMasterMerge to the CSvcCatProxy class in that header, and the library is linked into Query.dll. The history says KyleP created the file on 28 February 1994 and dlee moved it from OFS to cisvc on 16 September 1996. A component designed to make a new kind of filesystem useful survived by becoming independent of that filesystem.
XP's web services had a server side too, and some of it is here. When XP didn't know what program opened a file, it offered to "Use the Web service to find the appropriate program". The site that answered is in shell/tools/fileassoc (its notes begin "This project manages http://shell.windows.com/"), written in server-side JScript with an XML file per extension. It recommended RealPlayer, Winamp and CorelDRAW as readily as Microsoft's programs. The notes give the figures from the logs. PDF is far ahead with 231 requests (15.5660%), followed by the RealAudio playlist extension .ram with 137 (9.2318%), .rar with 89 (5.9973%), RealMedia .rm files with 78 (5.2561%), and .diz, the plain-text description inside a ZIP archive, with 37 (2.4933%).
Count Percent Extension
======= ======= =========
231 15.5660 pdf
137 9.2318 ram RAM Meta file (RealAudio) (PlayList)
89 5.9973 rar www.winrar.com (***)
78 5.2561 rm RealMedia Files
37 2.4933 diz ZIP Archive Product Description file (http://www.a-direct.com/fileid.html) (Use notepad, because always plain ascii) (***)
------------------ 38.53%
A version that would have looked the extension up in the background was switched off, an engineer explains, because they didn't want "to automatically submit the file extension of the user's file to the server without first asking for permission for personal privacy reasons". The Web Publishing and Online Print Ordering wizards work the other way round. The middle of the wizard is the provider's web page inside a native frame, the wizard's Next and Back buttons just call functions on that page, and the list of providers (MSN, Xdrive, Fujifilm, Kodak) was itself downloaded from shell.windows.com. Counting the Microsoft addresses hard-coded as strings into XP's code, I get about 280 across 24 hosts, and 161 of them go to redirectors (redir.dll and go.microsoft.com/fwlink) rather than to pages, presumably so Microsoft could move a page without patching Windows. Only one of the addresses I counted uses HTTPS, the activation address for Terminal Services licensing.
Compatibility aka lies
What I had in mind by calling it XP so far is really two somewhat different things. People who used Windows 2000 already knew the NT kernel and had good reason to worry about their games. For people coming from 95 or 98, XP was supposed to give them that kernel and still run all the stuff they had accumulated in the nineties. How? Well, look up windows/appcompat/db/dbu.xml. Seven megabytes of UTF-16, 1,988 programs from over 600 vendors, and instructions for Windows about what to do for each. There are 374 shims that get in between a program and a Windows function. There are twelve ready-made combinations of them (one is what you select by asking to run something in Windows 95 compatibility mode). Then there are 33 patches that actually change instructions in the running program. The busiest shim is hardly any code at all in principle. When asked which Windows it is, Win95VersionLie says 95. It's against 471 executables.
<SHIM NAME="Win95VersionLie" FILE="AcLayers.DLL" PURPOSE="GENERAL" ID="{D6C32382-0ABD-4BD2-AB9F-871F87EF0B6E}">
<DESCRIPTION>
Hooks the GetVersion and GetVersionEx APIs so that they return
Windows 95 version credentials. Applications often check to
ensure that they are running on a Win9x system, even though
they will run OK on an NT based system.
</DESCRIPTION>
The part I found most interesting in this otherwise fairly tedious XML is that the testers got to leave notes. Most entries have them, dated, from the people finding the bugs and the engineers having to do something about them. There are 3,622, some in pretty exasperated English. If you're only on the Windows side of this you might say, well, a program should never have depended on that, it was a complete accident that it worked on 95. From the user's side this is a program that worked before they upgraded, and passing that observation on to the user doesn't do much to get it running. XP had to reproduce a fair number of those accidents.
=EmulateHeap= is a funny name for it. HEAP.C says "Origin: Chicago", and the thing in the XP compatibility library is the Windows 95 heap manager itself. That explains those 23 HEAPCHANGE entries under one engineer's name on 9 December 2000. Grim Fandango, M1 Tank Platoon II, BattleZone and others had been getting individual fixes for using freed memory, running past allocations or expecting a resized block to stay put. Give them back the allocator whose habits they'd depended on and the same fix does for the lot. Quicken 2001 went straight on that list ("An already released heap address was being accessed"). Joel Spolsky heard from a SimCity developer about Windows changing the allocator for SimCity to let the game use freed memory. Just look how many such favours one engineer could do in a day by XP.
What was wrong with RollerCoaster Tycoon? Two bytes, to begin with. It had 16-bit stack operations that could leave a buffer two bytes out of alignment for the memory functions that took it. XP widened the operations in the running game to 32 bits. On exit it had to spare the game a call to a DirectDraw interface it had already released.
<PATCH NAME="RollerCoasterTycoon" ID="{AF2E1116-4D63-4912-B0A3-5537434E8583}">
<DESCRIPTION>
- This fixes the ORIGINAL rollercoaster tycoon (right off the cd) without
expansion packs (version 1.08.164).
- Removes the size overrides to prevent stack misalignment due to word push and
pop instructions.
- Jump around the IDirectDraw::Release to prevent an Access Violation on exit.
</DESCRIPTION>
<MATCH_BYTES MODULE="%EXE%" OFFSET="0x00026F40">66 ff 35 68</MATCH_BYTES>
<WRITE_BYTES MODULE="%EXE%" OFFSET="0x00026F40">90 ff 35 68</WRITE_BYTES>
<MATCH_BYTES MODULE="%EXE%" OFFSET="0x00026F4E">66 8f 05 68</MATCH_BYTES>
<WRITE_BYTES MODULE="%EXE%" OFFSET="0x00026F4E">90 8f 05 68</WRITE_BYTES>
XP kept three copies of that patch for three builds of rct.exe, telling them apart by file size and checksum. A neighbouring file called Tracks\Batflyer.TD4 helped identify the game. Final Fantasy VII's movies played upside down. Its fix disabled the UYVY and YUY2 video formats in the TrueMotion codec. Golden Nugget had 43 bytes of instructions made inert. Its entry ends with "What were they thinking?"
The notes on the two Red Storm games (Force 21 and Dominant Species) take some reading. You could map a file on 9x and assume you'd get back an address above two gigabytes. Now run the same game on NT. It's the same file, and you're doing the same arithmetic on an address, only Windows is perfectly entitled to put it below two gigabytes. That's enough to change the sign in the calculation those games did and let them past a limit they used to observe.
DominantSpecies contains an invalid check code that looks like the following:
mov esi,A
mov eax,B
sub eax,esi
cmp eax,ebp
jle @@Loc
mov eax,ebp
@@Loc:
In a particular case: B=-1 and A<0x80000000 this jump will be incorrectly
taken. The reason this works on Win9x is that A>0x80000000 because it's a
memory mapped file. On NT, no user mode address can normally be >2GB.
This shim patches the app with a 'cli' instruction so that it can perform
some logic when the exception gets hit. This is admittedly slow.
Why pick out Dominant Species for a fix at all? The note on its shim gives the reason. XP could correct just the comparison in that game. They'd considered arranging for mapped files in general to get high addresses, and found that "game performance suffers too much".
Next page | Previous page | More Lobsters | Headlines
Original: https://lr0.org/blog/p/winxp/