The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

The cost of trying too hard: Splay trees
Jan 18, 2006
Post comments count 0
Post likes count 0

The cost of trying too hard: Splay trees

Raymond Chen
Raymond Chen

Often, it doesn't pay off to be too clever. Back in the 1980's, I'm told the file system group was working out what in-memory data structures to use to represent the contents of a directory so that looking up a file by name was fast. One of the experiments they tried was the splay tree. Splay trees were developed in 1985 by Sleator and Tarjan as a form of self-rebalancing tree that provides O(log n) amortized cost for locating an item in the tree, where n is the number of items in the tree. (Amortized costing means roughly that the cost of M operations is O(M log n). The cost of an individual opera...

ReadProcessMemory is not a preferred IPC mechanism
Jan 17, 2006
Post comments count 0
Post likes count 0

ReadProcessMemory is not a preferred IPC mechanism

Raymond Chen
Raymond Chen

Many limitations, some with security implications.

At least there's a funny side to spam
Jan 16, 2006
Post comments count 0
Post likes count 0

At least there's a funny side to spam

Raymond Chen
Raymond Chen

Poorly-drawn cartoons inspired by actual spam subject lines! It's pretty much what the title says. Don't forget to read the fan mail. Sometimes it's even funny.

Understanding what things mean in context: Dispatch interfaces
Jan 16, 2006
Post comments count 0
Post likes count 0

Understanding what things mean in context: Dispatch interfaces

Raymond Chen
Raymond Chen

Remember that you have to understand what things mean in context. For example, the IActiveMovie3 interface has a method called get_MediaPlayer. If you come into this method without any context, you might expect it to return a pointer to an IMediaPlayer interface, yet the header file says that it returns a pointer to an IDispatch interface instead. If you look at the bigger picture, you'll see why this makes sense. IActiveMovie3 is an IDispatch interface. As you well know, the IDispatch interface's target audience is scripting languages, primarily classic Visual Basic (and to a lesser degree, JScript). Classic Vi...

France, she is, how you say, on sale!
Jan 13, 2006
Post comments count 0
Post likes count 0

France, she is, how you say, on sale!

Raymond Chen
Raymond Chen

Marketplace reports on the start of the winter sale season in France. By law, retailers are permitted sales only twice a year, so the onset of sale season generates quite a bit of shopping madness. There is also a proposal to allow more sale periods, but opponents argue that doing so would harm smaller businesses. Coming from the land of sale fatigue (we just emerged from the after-Christmas sale season and are entering the Winter White Sale season, after which comes the President's Day season...), I find a certain appeal to the idea of limiting how often things can "go on sale". Who can forget the oriental rug...

Why do words beginning with "home" get treated as URLs?
Jan 13, 2006
Post comments count 0
Post likes count 0

Why do words beginning with "home" get treated as URLs?

Raymond Chen
Raymond Chen

Vitaly from the Suggestion Box asked (with grammatical editing), Could you explain why Windows starts the web browser if the file name passed to ShellExecute starts with "home". First thing to note is that this URL-ization happens only after the function has tried all the other possible interpretations. If a file named "homestar" is found in the current directory or on the PATH or in the App Paths, then that file will be chosen, as you would expect. Only when the function is about to give up does it try to "do what you mean". What you're seeing is autocorrection kicking in yet again. If you go to , you ...

When web sites rely on security holes
Jan 12, 2006
Post comments count 0
Post likes count 0

When web sites rely on security holes

Raymond Chen
Raymond Chen

Perhaps the biggest risk when making a change in the name of security is all the things that may have been relying on the previously-lax security settings. After all, disabling an insecure feature is easy. The hard part is disabling it while retaining compatibility with people who were relying on that feature. In the security investigations I've been involved with, perhaps the largest chunk of my time is spent trying to find a way to mitigate the security hole without breaking existing customers. (And it's the Line of Business scenario that is the biggest question mark.) Here's a real-life example: Consider a sp...

The decoy visual style
Jan 11, 2006
Post comments count 0
Post likes count 0

The decoy visual style

Raymond Chen
Raymond Chen

During the development of Windows XP, the visual design team were very cloak-and-dagger about what the final visual look was going to be. They had done a lot of research and put a lot of work into their designs and wanted to make sure that they made a big splash at the E3 conference when Luna was unveiled. Nobody outside the visual styles team, not even me, knew what Luna was going to look like. On the other hand, the programmers who were setting up the infrastructure for visual styles needed to have something to test their code against. And something had to go out in the betas. The visual styles team came...

Beware the MSJ subscription scam
Jan 9, 2006
Post comments count 0
Post likes count 0

Beware the MSJ subscription scam

Raymond Chen
Raymond Chen

Stephen Toub from MSDN Magazine alerts us to the MSJ subscription scam. Somebody has been sending out (via paper mail) a fake subscription offer for Microsoft Systems Journal, a magazine that ceased publication back in 2000. Read Stephen's article for more details as well as a copy of the scam letter itself. (The address for the "publisher" is a rented mailbox at a what appears to be a UPS Store in the Beaumont Centre mall.) Under no circumstances send these people any money!