Lobsters - 03 Dec 2026

Page 2 of 10

An American export restriction survives in the Windows service for protecting an application's stored secrets, DPAPI. In GetSaltForExportControl the programmer describes the defect in the key Windows has just derived. The thing could have more than forty secret bits.

// USEC -- (US Export Controls)

DWORD GetSaltForExportControl(

HCRYPTPROV hProv,

HCRYPTKEY hKey,

PBYTE* ppbSalt,

DWORD* pcbSalt)

{

DWORD dwRet;

// fix bug: derived keys will be > 40 bits in length

// fix is to stomp derived key with exposed salt (Provider knows what is legal!!)

The provider supplied the allowable amount of salt. Windows supplied fresh random bytes for it, then saved those bytes with the result, so whoever had the encrypted data had that part too. A provider without salt support gave the helper nothing to replace. It mattered which provider and key type were in use, and DPAPI here already defaulted to 3DES. On January 18, 2000 Microsoft announced that the relaxed American rules let it put 128-bit encryption in Windows 2000 for customers worldwide. There's a Mozilla announcement with the same date that I think puts the old regime rather well. People working on the browser could finally publish the security source and accept changes from developers abroad.

The blue screen

The file responsible for the blue screen is base/ntos/ke/bugcheck.c, although if you go by what Mark Lucovsky put at the top of the file back in 1990 you would think you were reading stubs.c. KeBugCheck2 stops the other processors and takes over the display. The blue part is literally a rectangle, 640 by 480, and it sets white as the colour for printing on it.

if (InbvIsBootDriverInstalled()) {

InbvAcquireDisplayOwnership();

InbvResetDisplay();

InbvSolidColorFill(0,0,639,479,4); // make the screen blue

InbvSetTextColor(15);

InbvInstallDisplayStringFilter((INBV_DISPLAY_STRING_FILTER)NULL);

InbvEnableDisplayString(TRUE); // enable display string

InbvSetScrollRegion(0,0,639,475); // set to use entire screen

}

Something I like about the big names printed on that screen is that you can go looking for the error message and be looking in exactly the right place and still find an empty line. Open base/ntos/nls/bugcodes.mc at 0x7A, for instance. That's an empty English message, one of 160 in a list of 227 fatal codes. The detail you need to know is in another program altogether, sdktools/mc, which builds the messages and substitutes the name when there's nothing else to use. Go down one entry to 0x7B (Windows can't find the disk it needs to start) and there's advice written for the user. When you get that one you don't see the name. Whether someone had intended to write all 160 messages and never got around to it, I have no idea.

MessageId=0x007A Facility=Kernel Severity=Fatal SymbolicName=KERNEL_DATA_INPAGE_ERROR

Language=English

.

MessageId=0x007B Facility=Kernel Severity=Fatal SymbolicName=INACCESSIBLE_BOOT_DEVICE

Language=English

Check for viruses on your computer. Remove any newly installed

hard drives or hard drive controllers. Check your hard drive

to make sure it is properly configured and terminated.

Run CHKDSK /F to check for hard drive corruption, and then

restart your computer.

.

Another thing about looking up a blue screen is quite a lot of the diagnosis has happened before you ever get to see it. Suppose the original error was IRQL_NOT_LESS_OR_EQUAL, 0xA. KeBugCheck2 has the address of the instruction that went wrong. Its first checks are for instructions in the pool and system-PTE allocators, which can change the number to one of three codes saying a driver corrupted something. If it was an instruction in a driver you get DRIVER_IRQL_NOT_LESS_OR_EQUAL, 0xD1. There's another possibility, that the instruction really is in the kernel but the memory it touched belongs to a driver. For this one you get 0xD3 and the filename goes on screen.

case IRQL_NOT_LESS_OR_EQUAL:

ExecutionAddress = (PVOID)BugCheckParameter4;

if (ExecutionAddress >= ExPoolCodeStart && ExecutionAddress < ExPoolCodeEnd) {

KiBugCheckData[0] = DRIVER_CORRUPTED_EXPOOL;

}

else if (ExecutionAddress >= MmPoolCodeStart && ExecutionAddress < MmPoolCodeEnd) {

KiBugCheckData[0] = DRIVER_CORRUPTED_MMPOOL;

}

else if (ExecutionAddress >= MmPteCodeStart && ExecutionAddress < MmPteCodeEnd) {

KiBugCheckData[0] = DRIVER_CORRUPTED_SYSPTES;

}

It does much the same with a page fault. What you saw on the screen was already somebody's theory about whose fault it was. Now suppose the screen said 0x0000008E. You restart and there's 1000008e in that little "Windows has recovered from a serious error" report. It was the same crash both times. XP, once it had finished drawing the screen, added a flag (0x10000000) to certain codes when writing out a small memory dump. In Microsoft's documentation you can find the second number under the old name with an _M on the end.

There's at least one case where it knows exactly whom to blame. The PS/2 keyboard driver on a suitably configured XP machine let the operator request a crash dump. Its code is 0xE2, MANUALLY_INITIATED_CRASH. The English message reads "The end-user manually generated the crashdump."

bootvid draws it: palette slot 4 for the background, slot 15 for the text, and the 8 by 13 font from draws it: palette slot 4 for the background, slot 15 for the text, and the 8 by 13 font from

bootdata.c, fourteen pixels a line. The texts are the ones in the message file, including the empty ones that come out as symbolic names. Compare the first two scenarios: the same 0x0000000A becomes 0x000000D1 when the failing instruction was in the driver, and 0x000000D3 when it was in the kernel touching an address inside the driver. The machine details are made up; the rules are the kernel's, down to the dump counter redrawing itself with a bare carriage return.

, fourteen pixels a line. The texts are the ones in the message file, including the empty ones that come out as symbolic names. Compare the first two scenarios: the same 0x0000000A becomes 0x000000D1 when the failing instruction was in the driver, and 0x000000D3 when it was in the kernel touching an address inside the driver. The machine details are made up; the rules are the kernel's, down to the dump counter redrawing itself with a bare carriage return.

Abandoned Talisman

How much of a graphics workstation could you get into a cheap PC? Microsoft's 1996 answer was Talisman, which saved some of the work of drawing a 3D scene by keeping pictures of the objects in it. Objects would be rendered into separate image layers. Between fresh 3D renders, hardware could move, rotate, scale and skew those layers, then composite them at the display's refresh rate.

The XP tree preserves substantial unfinished DirectDraw work for that model. ddsprite.c has over three thousand lines implementing SetSpriteDisplayList, that was checking transforms, filtering and alpha support, clipping sprites, and collecting the sprites from different windows into a master list for the driver. A nearby colour-key check in ddsckey.c was disabled with the explanation "Talisman overlay sprite might not use overlay surface!" But ddsprite.c is commented out of the source list, and the callback that would expose the operation is behind POSTPONED2.

#ifdef POSTPONED2

ddSurface7Callbacks.AlphaBlt = (LPVOID)DD_Surface_AlphaBlt;

ddSurface7Callbacks.SetSpriteDisplayList = (LPVOID)DD_Surface_SetSpriteDisplayList;

ddSurface7Callbacks.Resize = (LPVOID)DD_Surface_Resize;

#endif //POSTPONED2

John Carmack had tried a similar shortcut in Quake. In a 1997 interview he described saving a rendered model as a sprite and putting the same picture up again in the next frame. It worked for too few frames before they had to draw the model again. He also argued that faster, cheaper memory had weakened Talisman's original premise. Asked what Microsoft should do with it, he said, "It should just quietly go away."

Even with Carmack's objection you can see how much work had already gone into it. For instance, each application could supply sprites, and Windows had to gather them up before giving the driver the list.

Graphics layer demonstration

A lot of XP was a web page

By 2001 there were web pages in all sorts of places you wouldn't have thought to open in IE. User Accounts is one. The first-run screens, Help and Support, System Restore, Remote Assistance and the photo publishing wizards are others. Even the Find and Print Preview dialogs in IE use its engine this way. The pages are HTML with script that can ask C++ objects to do things for them. You see some of the pages loose on disk. For the ones built into DLLs and EXEs the resource scripts list 345 entries marked HTML, which includes things like a stylesheet or an image so you shouldn't read that as 345 pages. This is also where you run into a limit of what got leaked. JScript, VBScript, Windows Script Host, MSXML, you can read their interfaces, but try following one of those into the actual engine. In the case of XMLHTTP my one lead is a WinHTTP source file thanking the MSXML people for the code. The path it gives starts with inetcore\xml, which is missing.

* Much of this code was stolen from our Xml-Http friends over in

* inetcore\xml\http\xmlhttp.cxx. Thanks very much!

There are 253 HTML files in base/ntsetup/oobe, where the first-run setup lives. The XP build uses them to make 122 pages. According to the notes they were ported "from the Millenium source tree", so there's some Windows Me you're looking at on your first XP boot. I don't know why these pages and their scripts all need a pass through the C preprocessor before they're ready for the CD. None has a #if or even a #include. About all I can see it doing here is stripping the comments. There are also 122 names the scripts on those pages can ask for on window.external. HasTablet, CalledFromMsn and InHighContrastMode are the sort of things setup wants to know. PlayBackgroundMusic is something it wants done. Twelve names give it another object, and for each of those some C++ programmer had to write the table saying which names that object answers to.

DISPATCHLIST SystemClockExternalInterface[] =

{

{ L"set_TimeZone", DISPID_SYSTEMCLOCK_SETTIMEZONE },

{ L"set_Time", DISPID_SYSTEMCLOCK_SETTIME },

{ L"set_Date", DISPID_SYSTEMCLOCK_SETDATE },

// new oobe2 methods below, others are currently unused

{ L"Init", DISPID_SYSTEMCLOCK_INIT },

{ L"get_AllTimeZones", DISPID_SYSTEMCLOCK_GETALLTIMEZONES },

{ L"get_TimeZoneIdx", DISPID_SYSTEMCLOCK_GETTIMEZONEIDX },

{ L"set_TimeZoneIdx", DISPID_SYSTEMCLOCK_SETTIMEZONEIDX },

{ L"set_AutoDaylight", DISPID_SYSTEMCLOCK_SETAUTODAYLIGHT },

{ L"get_AutoDaylight", DISPID_SYSTEMCLOCK_GETAUTODAYLIGHT },

{ L"get_DaylightEnabled", DISPID_SYSTEMCLOCK_GETDAYLIGHT_ENABLED },

{ L"get_TimeZonewasPreset", DISPID_SYSTEMCLOCK_GETTIMEZONEWASPRESET }

};

Take get_AllTimeZones. You might expect a list of names to fill the box with. It hands the page one string with the OPTION tags around all the time zones already, so into the select box it goes.

<script language="javascript">

document.write(window.parent.external.SystemClock.get_AllTimeZones);

</script>

If you remember the little question mark that talked you through setup, its lines of dialogue account for 7,185 lines of JScript, including 751 calls to Agent_Speak. What do you do about the speech balloon in a language for which you haven't got a speech engine? In Chinese and Japanese they padded the line with zero-width spaces to give you time to read it. Even the music starts in JScript. A call to window.external.PlayBackgroundMusic() points an embedded Windows Media Player at title.wma. The design note wanted people to be able to develop a module "with little help from OOBE development". PC makers even had an OEM API for replacing the question mark with a character they chose. The people writing the main page had plenty of trouble. Four times they explain in a comment that they had to resort to a hack to make the selected item in a menu visible. Farther on somebody has added "these hacks dont work anymore".

User Accounts came out of the control-panel file nusrmgr.cpl as an HTML Application. That is a page you run as a program with mshta.exe. There's no browser window around it. You saw this one on Home or on a Professional machine outside a domain. On 64-bit Windows and in the other cases you got the old dialog. One detail I like in the HTML version is where it puts the window sizing. It asks for at most 730 by 530 pixels before the declaration that makes the page an application. If you reversed those two you'd see the window change size.

// Set the initial size of the window. This must come before

// the HTA:APPLICATION tag, otherwise we'd see the window resize

var cxWidth = Math.min(730, screen.availWidth);

var cyHeight = Math.min(530, screen.availHeight);

window.resizeTo(cxWidth, cyHeight);

window.moveTo((screen.availWidth - cxWidth) / 2, (screen.availHeight - cyHeight) / 4);

</SCRIPT>

<HTA:APPLICATION

id=idUM

applicationName="User Account Manager"

contextMenu=no

icon=users.ico

scroll=no

scrollFlat=yes

selection=no

singleInstance=yes

version=1.0

innerBorder=on

/>

What became of an HTML attribute once the browser had read it? In this page scroll and scrollFlat set flags on the hosted browser. Others can go right down to an ordinary Win32 window style. Trident defines caption=yes as WS_CAPTION, though User Accounts doesn't use that one. The Franklin Gothic for the headings is in the page. To get the colours right under Luna, a page behaviour asks the theme manager for the current scheme and loads cpwebvw.css from the theme DLL. The blue, olive green and silver versions thus come with different instructions for colouring the same page.

One of the User Accounts tasks is an offer to associate your local login with a .NET Passport. The wizard could save the credentials, so the online identity would work for single sign-on. In WinInet, the Windows HTTP client, the constructor tests for Whistler, XP's name during development. It clears _fDisableTweener there and sets it on older systems. Clear the disable flag and Passport 1.4 is supported by default.

if (GlobalPlatformWhistler)

{

_fDisableTweener = FALSE; // Tweener (Passport1.4 is enabled by default for Windows XP)

}

else

{

_fDisableTweener = TRUE; // by default disable Tweener for downlevels

}

You still had to agree to the association in the wizard. For some idea why that particular offer was sitting next to the ordinary account settings, look at Microsoft's March 2001 announcement of HailStorm, subsequently .NET My Services. Passport was to establish who you were. Your calendar, contacts and documents could then be made available to programs on whichever device you were at, including an XP computer.

The consumer service Microsoft meant to host itself was shelved in 2002. The New York Times spoke to Microsoft's Charles Fitzgerald about the change. Passport survived it. In 2005 the company's identity architect Kim Cameron made the distinction quite nicely. On MSN, Microsoft was already in a relationship with the customer. On another company's site neither the proprietor nor the customer particularly wanted to bring Microsoft into it. In Cameron's judgment, "Passport failed in its mission of being an identity system for the Internet." The client code for that mission had made it into Control Panel.

System Restore and Help and Support run on a small in-house framework called Mars, which wraps IE's engine in a window declared in XML. System Restore's window is one trusted Trident panel called Contents. It fills the window and loads start.htm from rstrui.exe.

<Mars_App>

<!-- the "Panels" tag contains all panels that will be created initially -->

<Panels>

<!-- here's our cool DHTML dynamic content -->

<Panel PanelType="Trident" Trusted="true">

<Name>Contents</Name>

<Layout>

<Position>Window</Position>

</Layout>

<StartUrl>res://rstrui.exe/start.htm</StartUrl>

</Panel>

</Panels>

System Restore's scriptable object, CRestoreShell, has called itself "merely a dummy ActiveX control" since the XP rewrite, a wrapper in front of the class that does the work. A behaviour on the pages cancels F5, Ctrl+N, dragging and text selection everywhere, and the context menu and Backspace outside text boxes.

switch ( event.keyCode )

{

case VK_F5 : // Disable refresh!

{

event.cancelBubble = true;

event.returnValue = false;

return false;

}

case VK_N :

{

if( event.ctrlKey == true )

{

event.cancelBubble = true;

event.returnValue = false;

return false;

}

break;

The calendar with the restore dates in bold is a general-purpose calendar behaviour from 1999, forked for System Restore with a numbered list of "Changes for SR UI" at the top. Help and Support uses five Mars panels, and its pages come from hcp://system/. It needed a fix inside IE itself. After a redraw bug moved its navigation bar a few pixels, IE6 learned to recognise the Help Center (a flag called _fInWindowsXP_HSS) and skip drawing a border for it. The email approving the fix is pasted into an interface file, ending "!!NEVER!! change GUID for SID_SMarsPanel and IMarsPanel." Remote Assistance is 69 more HTML files, under the code name Salem.

XP was also moving away from all this. Windows 98, Me and 2000 drew folders with HTML templates called folder.htt, and XP replaced them with native task panes in DirectUI, the markup from the Start page prototype. If an administrator switched the old view back on, Explorer hashed a folder's template and compared it with 18 MD5 fingerprints of the stock 98, Me and 2000 ones, so it could swap those for the new view and leave customised ones alone. By SP1 even Add or Remove Programs had a DirectUI version, with the old HTML one still compiled in beside it.

Next page | Previous page | More Lobsters | Headlines

Original: https://lr0.org/blog/p/winxp/