The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

At least it'll be easy to write up the security violation report
Jul 12, 2011
Post comments count 0
Post likes count 0

At least it'll be easy to write up the security violation report

Raymond Chen
Raymond Chen

Many years ago, Microsoft instituted a new security policy at the main campus: all employees must visibly wear their identification badge, even when working in their office. As is customary with with nearly all new security policies, it was met with resistance. One of my colleagues was working late, and his concentration was interrupted by a member of the corporate security staff at his door. — Sir, can I see your cardkey? My colleague was not in a good mood (I guess it was a nasty bug), so he curtly replied, "No. I'm busy." — Sir, you have to show me your cardkey. It's part of the new security po...

Windows has supported multiple UI languages for over a decade, but nobody knew it
Jul 11, 2011
Post comments count 0
Post likes count 0

Windows has supported multiple UI languages for over a decade, but nobody knew it

Raymond Chen
Raymond Chen

In the early days of Windows, there was a separate version of Windows for each language, and once you decided to install, say, the French version of Windows, you were locked into using French. You couldn't change your mind and, say, switch to German. The reason for this is that there were bits and pieces of language-dependent information stored all over the system. One obvious place is in file names. For example, a shortcut to the calculator program was kept at %USERPROFILE%\Start Menu\Programs\Accessories\Calculator.lnk on US-English systems, but %USERPROFILE%\Startmenü\Programme\Zubehör\Rechner.lnk ...

We've traced the pipe, and it's coming from inside the process!
Jul 8, 2011
Post comments count 0
Post likes count 0

We've traced the pipe, and it's coming from inside the process!

Raymond Chen
Raymond Chen

We saw last time one of the deadlocks you can run into when playing with pipes. Today we'll look at another one: Our program runs a helper process with stdin/stdout/stderr redirected. The helper process takes input via stdin and prints the result to stdout. Sometimes we find that the from the controlling process into the stdin pipe hangs. Closer examination reveals that the helper process no longer exists. Under these conditions, should the fail, since the reader is no longer available? If you attempt to write to a pipe when there is nobody around to call to read the data out the other end, the call to ...

And… that cadence means it's halftime, concert-goers!
Jul 7, 2011
Post comments count 0
Post likes count 0

And… that cadence means it's halftime, concert-goers!

Raymond Chen
Raymond Chen

In college, one of my classmates (who is now the conductor of an orchestra, so I guess that whole music thing worked out for him) coined the term halftime to refer to a resounding cadence in the first half of a piece, the type of cadence that might fool an inattentive or unseasoned listener into thinking that the piece is over, when in fact it's just getting started. We're not talking about a false ending, which is comparatively easy to find, but rather a "big finish" when we're nowhere near the finish. Also sprach Zarathustra has a big halftime cadence, complete with a reprise of the opening fanfare, at the en...

Be careful when redirecting both a process’s stdin and stdout to pipes, for you can easily deadlock
Jul 7, 2011
Post comments count 0
Post likes count 0

Be careful when redirecting both a process’s stdin and stdout to pipes, for you can easily deadlock

Raymond Chen
Raymond Chen

Pipe in, pipe out.

The historical struggle over control of the Portuguese language
Jul 6, 2011
Post comments count 0
Post likes count 0

The historical struggle over control of the Portuguese language

Raymond Chen
Raymond Chen

Portugal has been going through a rough patch. Its international stature has diminished over the years, its economy has always struggled to remain competitive, the government had to accept a bailout to avoid defaulting on its debt, and on top of it all, it is losing control of its own language. In Portugal, the latest round of Portuguese spelling reform takes effect over a six-year transition period, leaving the Portuguese dismayed that the spelling of their language is being driven by Brazil, a former colony. I sympathize with the plight of the Portuguese, although I also understand the value of consistent sp...

Looking at the problem at the wrong level: Closing a process's stdin
Jul 6, 2011
Post comments count 0
Post likes count 1

Looking at the problem at the wrong level: Closing a process's stdin

Raymond Chen
Raymond Chen

A customer was having trouble manipulating the stdin stream that was given to a process. How do you simulate sending Ctrl+Z to a hidden console process programmatically? I am using and want to send the console a Ctrl+Z. I've tried sending ASCII code 26, but that doesn't work. supports Ctrl+C and Ctrl+Break but not Ctrl+Z. Here's what I'm doing, but it doesn't work: The customer was kind enough to do more than simply ask the question. The customer set up the scenario and even provided a code fragment that illustrates the problem. Which is good, because the original question was the wrong question. ...

Microspeak: Reporting through
Jul 5, 2011
Post comments count 0
Post likes count 0

Microspeak: Reporting through

Raymond Chen
Raymond Chen

I'll start with the citation from a hypothetical conversation: "This is being handled by Jonathan Swift." — Who does he report through? "He reports up through Jane Austen's org." The Microspeak term report through (or report up through) comes up often in situations where people from different groups are working together. In its most literal meaning, to report through someone is to have that person as your manager, or your manager's manager, or your manager's manager's manager, etc. (Not that any of those people beyond two levels actually reads any of the reports you've written!) Usually, when some...

A handful of trips through the time machine
Jul 4, 2011
Post comments count 0
Post likes count 0

A handful of trips through the time machine

Raymond Chen
Raymond Chen

A few trips through the time machine: In the Internet Explorer time machine video, I was struck by the remark, "Appearance-wise, very little had changed [in Internet Explorer 4] since IE3. Not much changed in terms of functionality, either." In fact, Internet Explorer 4 was probably the most significant revision of Internet Explorer in its history, because that's the version that completely replaced the old layout engine with a new one code-named Trident, the layout engine that continues to power Internet Explorer today. Another case of "When you change the insides, nobody notices."