Lobsters - 03 Dec 2026

Page 6 of 10

If you've ever watched a calligrapher stretch a line, the top of that list looks familiar. The long stroke after an initial seen, and the pull before a final heh or alef, are where they usually stretch. The chosen place gets the first priority in the line layout (LineServices, also in the tree, under windows/richedit/lssrc) and the spaces get the second, so the slack in every justified line goes to kashidas first and only what's left goes to the spaces. In linesrv.cxx that's prior = 1 for the chosen letter (iBestPr) and prior = 2 for the space (iPropL), in a branch that only runs while the kashida share is exactly 100, which is what it is when nobody has set it.

case styleTextJustifyNotSet:

case styleTextJustifyKashida:

case styleTextJustifyAuto:

if (flKashidaPct == 100)

{

if (iBestPr >= 0)

{

rgExpType[iBestPr] = exptAddInkContinuous;

rgexpinfo[iBestPr].prior = 1;

rgexpinfo[iBestPr].duMax = lsexpinfInfinity;

rgexpinfo[iBestPr].fCanBeUsedForResidual = FALSE;

rgexpinfo[iBestPr].u.AddInkContinuous.duMin = iKashidaWidth;

}

rgExpType[iPropL] = exptAddInkContinuous;

rgexpinfo[iPropL].prior = 2;

rgexpinfo[iPropL].duMax = lsexpinfInfinity;

rgexpinfo[iPropL].fCanBeUsedForResidual = TRUE;

rgexpinfo[iPropL].u.AddInkContinuous.duMin = 1;

}

One IE-only value and two IE-only properties steer it. The value is text-justify: kashida, which is also what the default did, so justified Arabic in IE was elongated without anybody asking. The property text-kashida-space sets the share of the slack that goes to elongation instead of spaces. The other, text-kashida, breaks every line a little short on purpose so there's always something to elongate. As far as I can tell, text-kashida-space never worked as intended. CSS percentages are stored multiplied by a hundred, and linesrv.cxx reads the raw number.

if (!plsrun->_pPF->_cuvTextKashidaSpace.IsNull())

{

flKashidaPct = plsrun->_pPF->_cuvTextKashidaSpace.GetUnitValue();

}

if (flKashidaPct == 0)

{

iWhiteWidth = iKashidaWidth;

iKashidaWidth = 1;

}

else if (flKashidaPct < 100)

{

iWhiteWidth = max((int)((float)iKashidaWidth * ((100 - flKashidaPct) / flKashidaPct)), 1);

}

So 50% arrives as 5000, which is neither 0 nor under 100 here and isn't exactly 100 in the priority code either. Every value from 2% to 100% lands in the same fallback branch, which gives the stretch and the space the same priority. Setting text-kashida-space: 100% explicitly turned kashida-first justification off.

The blog demo justifies the paragraph that opened that article both ways, and has a switch that makes text-kashida-space work the way it was presumably meant to. My hand-set mockup there put the elongations where I thought they belonged, and IE's rules put them in the same place in 13 of the 17 words it justifies. In three of the four it disagrees with, IE goes for the stroke after a seen or sad, which the published rules rank above everything except a tatweel that is already there.

text-align: justify, which can only stretch the spaces. On the right, a reconstruction of IE6: one place per word, chosen with IE's ranking from the letter classes Microsoft published, then LineServices spending each line's slack on those places first. Tick "mark where each word stretches" to see the choices, and drag the width. , which can only stretch the spaces. On the right, a reconstruction of IE6: one place per word, chosen with IE's ranking from the letter classes Microsoft published, then LineServices spending each line's slack on those places first. Tick "mark where each word stretches" to see the choices, and drag the width.

text-kashida-space at 0% gives you what every browser does today, and "as built" and "as intended" switch between the percentage the code actually received and the one it was written for. The elongation is drawn with tatweel characters, so it looks straighter than a calligrapher's stroke.

at 0% gives you what every browser does today, and "as built" and "as intended" switch between the percentage the code actually received and the one it was written for. The elongation is drawn with tatweel characters, so it looks straighter than a calligrapher's stroke.

GDI had kashida code too, separate from IE's. Samer Arafeh wrote it for the complex-script language pack in March 1998, and it splices real tatweel glyphs into the text for programs that call GetCharacterPlacement with GCP_KASHIDA. XP's Arial and Times New Roman ship with OpenType justification tables listing kashida glyphs as short as an eighth of an em. So in 2001 Windows could elongate Arabic in GDI, in its fonts and in its browser, and the browser did it by default. Then IE lost, the kashida value was taken out of the CSS drafts, and the browsers I wrote about in my earlier article stretched the spaces. Last month a Chromium contributor filed an Intent to Prototype for CSS kashida justification, proposing text-justify: kashida and text-kashida-space as "previously supported in Internet Explorer and EdgeHTML", so IE's design might be coming back twenty-five years later. I hope they read the percentage properly this time.

A couple of other Arabic details I liked. On a machine with a right-to-left keyboard installed, IE's Find dialog had three extra checkboxes, "Match diacritic", "Match kashida" and "Match alef hamza", all off by default. A search for found and , and matched , and . And when Windows mirrors a window for a right-to-left language, which it does by flipping the whole coordinate system (the SetLayout code by Mohamed Abdel-Hamid, December 1997), the help button's question mark comes out mirrored. That's fine for Arabic, whose is a mirrored question mark, and wrong for Hebrew, which uses the Latin one, so USER draws the question mark again, unmirrored, when the interface language is Hebrew.

How licensing worked

For a buyer of boxed Windows, the change in XP came after entering the twenty-five characters on the yellow sticker. That part was old. XP was the first Windows to ask a normal retail customer to activate the installed copy with Microsoft, by telephone or over the Internet, within thirty days. Microsoft had already tried it with Office in several countries. Its announcement for Windows and Office worldwide came in February 2001, and the example it gave a friendly name to was "casual copying", one disc passing around a household or workplace.

The part I wanted to read first is missing. Setup registers licdll.dll under the rather promising name "Windows Product Activation (WPA) Active X control". You get its name, the names of a few other files, descriptions like "WPA license store" and "WPA balloon reminder", and no source for the agent itself. On the other hand I could read pretty much every word Microsoft put in front of the customer, including what happened when the customer kept saying no. There's also an older licensing system for servers, considerably more of which survives.

The five boxes live on three different setup pages. Buy the box and Windows sends you to "the yellow sticker on the back of your Windows CD folder". Buy a computer with Windows on it and the answer is on "the lower section of your Certificate of Authenticity". At work you were supposed to find your "License Agreement Administrator". The boxes themselves turn everything into capitals and switch off the East Asian input method. Keys entered there, supplied in an unattended setup file, or given to the first-run wizard all reach pidgen.dll. The description in the DLL is "Pid3.0 generation".

//

// eat spaces

//

if ((msg == WM_CHAR) && (wParam == VK_SPACE)) {

return(0);

}

if ((msg == WM_CHAR)) {

//

// First override: if we have the max characters in the current edit

// box, let's post the character to the next box and set focus to that

// control.

//

There's even code for what becomes of a stray sixth character. It gets posted to the next box, just as backspace in an empty box takes you back one. Somebody wrote the error message twice. "The CD Key you entered is not valid." on a retail CD, and "The Product Id you entered is not valid." on the other two.

There's a build of pidgen.dll for each edition. They each carry two public keys as resources, one to recognise a product key issued for retail and one for a key issued through a PC maker. Setup could tell when the key belonged to a different edition.

#ifdef BUILD_PRO

1 BINK DISCARDABLE "00044.pub"

2 BINK DISCARDABLE "00045.pub"

#endif

#ifdef BUILD_PER

1 BINK DISCARDABLE "00042.pub"

2 BINK DISCARDABLE "00043.pub"

#endif

#ifdef BUILD_TRIAL

1 BINK DISCARDABLE "00000.pub"

2 BINK DISCARDABLE "00001.pub"

#endif

PRO is Professional and PER is Personal, which is what the build called Home Edition. TRIAL was the pair the betas used. A Professional CD wouldn't take a Home key or a retail installation an OEM one. The instruction to swap the beta pair for the final public keys at release is, I assume, why XP beta keys stopped working on the finished product. They left the server on the trial pair. The reason given was "we are not shipping SRV". It was another year and a half before it shipped as Windows Server 2003.

What pidgen hands back is two things. One is the Product ID you could read on the General tab of System Properties. The other is a binary record that setup puts in the registry as DigitalProductId.

wsprintfA(

lpstrPid2,

"%s-%03.3ld-%07.7ld-%s",

lpstrRpc,

(LONG)dwSeq1,

(LONG)dwSeq2,

szRand);

The number on the screen had five digits for the product, three and seven worked out from the key's serial number, and five more. On a copy that came with a PC the group of three was replaced by OEM. You could tell where your Windows came from without leaving System Properties.

The binary record says more about how the copy was sold. Its header lists seven licence types.

typedef enum {

ltFPP,

ltCCP,

ltOEM,

ltSelect,

ltMLP,

ltMOLP,

ltMSDN

} LICENSETYPE;

FPP is the full packaged product, the box in the shop. CCP is the cheaper upgrade. The code calls the check "Compliance Checking", since you had to own something to upgrade from. OEM was the computer maker's copy. Select, MLP and MOLP were company licensing programmes (MOLP is Open License, if I'm reading the initials right), and MSDN was the developer subscription. An upgrade CD needed an upgrade key and a full CD a full key when you ran winnt32 from inside the old Windows. The PC makers had upgrade discs that came with full keys, so their media got an exception the comment describes as "broken by design". There's another comment on trying a clean install with an upgrade. "Bad user, bad."

if (SourceInstallType != OEMInstall){

// we want OEM FPP and CCP keys to be accepted by either media. It seems like

// there will be OEM CCP media, but only FPP keys, which is why we aren't

// checking to make sure they match, as it's broken by design.

if (UpgradeOnly != fStepUp){

// user is trying to do a clean install with upgrade only media. Bad user, bad.

PidMatchesMedia = FALSE;

return FALSE;

}

}

About ninety lines up, ValidatePidEx hands pidgen a made-up SKU ending in XYZZY. According to the comment the SKU mattered to system setup and hardly at all to winnt32. That makes another appearance for Colossal Cave's magic word, after Minesweeper.

Windows 2000's volume media didn't ask for a key at all. The superseded path is still in XP's setup, commented out with a note about Select media. XP asked companies for a key too, which is why there's a third version of the key page. Microsoft's deployment guide says volume copies didn't require activation. At the end of setup, Windows asks the licence agent whether this copy needs activating. On a volume installation it deletes both Activate Windows shortcuts.

Service Pack 1 was the first time I found setup turning particular leaked keys away. Microsoft said in August 2002 that SP1 wouldn't install on copies using either of two widely circulated volume keys, as The Register reported at the time. There's a short list of rejected keys in SP1's pidgen. The release build also rejects the range issued for the service pack's beta. SP1 acquired a new message which Microsoft later quoted in its support article on changing a volume licence key.

"The Product Key used to install Windows is invalid."

You were to go back to your administrator or the retailer for a valid one. If you suspected you'd been sold a pirated copy, the rest of the message invited you to write to Microsoft's Anti-Piracy Team and promised to keep whatever personal information you sent them in strict confidence.

"Ready to activate Windows?" asked the first-boot wizard. It would take care of it over the Internet there and then, and in bold it promised "You don't need to give your name or other personal information when you activate Windows." You could put it off for a few days. The version on the Start menu also let you call Microsoft. "Just four steps, and you're done..." was the page where you read a long installation ID to a person or an automated line, then typed the confirmation ID they read back to you. The little question mark tried to explain why, with the example of a bank asking you to activate a new credit or debit card. I liked the instructions for when the wizard itself failed. "Setup encountered and unexpected error. Please contact the SetupHot alias." That's msoobe.exe telling a member of the public to write to an internal Microsoft mailing list. The "and" is in the file too.

You can go through every page of the wizard looking for those thirty days. The number isn't there. Whoever drew the screen had to ask the licence agent how long you had left, and could commit in the text only to pestering you "every few days" or "periodically". On the day the agent reported zero, the choice you'd been making all along had a new label. "No, log me off".

var L_LogMeOff_Text = "N<u>o</u>, log me off";

if (ndaysleft == "0")

{

g.act_par01_ZeroDays.style.display = "inline";

g.act_spn3.innerHTML = L_LogMeOff_Text;

if (window.external.HasTablet())

{

g.act_par03_Tablet.style.display = "inline";

}

}

The limit is written down in TechNet. You got thirty days from installation, or sixty with an MSDN copy. When they ran out you couldn't log on interactively until you activated, though the services kept running on the machine. As for the balloons that spent the month reminding you, one program was called wpabaln.exe and all I've got of it is its name in the setup list. There's a second, oobebaln.exe, with its main file missing. Its messages are still there, down to the little "Click here to activate now..." and the name of the scheduled task, "Activation reminder".

MessageId=10001 SymbolicName=MSG_DAYS_LEFT

Language=English

%1!d! days left for activation.%0

.

MessageId=10002 SymbolicName=MSG_CLICK_TO_ACTIVATE

Language=English

Click here to activate now...%0

.

MessageId=10003 SymbolicName=MSG_CONTACT_ADMIN

Language=English

Please ask your administrator to activate this computer.%0

"Activation is completely anonymous", according to the privacy statement linked from both wizards. It also explained that Windows made an identification from the hardware in your PC. No name in it, no inventory of software or data, not even the make and model of the computer, Microsoft said. So how much of your machine could you replace before Windows thought it was activating a different one? Minor upgrades were fine, a complete overhaul might mean another activation. In July 2001 a Microsoft product manager told The Register you could change four pieces of hardware. The advice on the CD was to finish your planned upgrades before activating. That same month Fully Licensed, a German company that worked on copy protection, went through a release candidate and reported that what it sent was "completely innocuous". They found you could get away with rather more changes than people had feared.

PC makers could ship Windows already activated on their machines, which Microsoft described as "locked to a machine's firmware (BIOS)". In the tree there are four oembios files marked "WPA tie file", a component description identifying them as System-Locked Preinstallation files and setup copying them into place. The SP1 Windows Update client also asked the licence DLL for an encrypted copy of the product ID. It put that in the description of the machine it sent to the update servers.

//Note: Return value is not checked because

//Any failure to get the PID is not considered as a failure on the GetSystemSpec method

//If the pid attribute is missing on the supported platforms it is still considered as

//an invalid pid case and no items will be returned in the catalog from the server

//if there is any error bstrPID will be null and it will not be added to

//the systemspec xml

The programmer's comment is quite specific about what happened to a missing ID. The client could finish gathering the system information and send the request. On the platforms the check applied to, the server treated the missing ID as invalid and returned an empty catalogue. This is in 2002. Microsoft piloted Windows Genuine Advantage in September 2004 and made its validation a requirement for Windows Update in July 2005. Security updates remained available without validation through Automatic Updates and the Download Center.

The server side is older and much bigger. NT's License Logging service generally counted the connections other services accepted. The file server, dial-up, IIS, message queuing, Internet Printing, the Unix print service, telnet and Terminal Services each called NtLicenseRequest with the product name and the user, then gave the licence back when the user left. Telnet supplied the file server's name. As far as the count went a telnet login looked like a mapped drive.

Status = NtLicenseRequestA( "SMBServer", szVersion, &( pClient->m_hLicense), &NtLSData);

Next page | Previous page | More Lobsters | Headlines

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