Showing results for November 2012 - The Old New Thing

Nov 30, 2012
0
0

The debugger lied to you because the CPU was still juggling data in the air

Raymond Chen
Raymond Chen

A colleague was studying a very strange failure, which I've simplified for expository purpose. The component in question has the following basic shape, ignoring error checking: There are two parts of the object. One part that is essential to the object's task, and another part that is needed only when updating. The parts related to updating ...

Other
Nov 29, 2012
0
0

Various ways of performing an operation asynchronously after a delay

Raymond Chen
Raymond Chen

Okay, if you have a UI thread that pumps messages, then the easiest way to perform an operation after a delay is to set a timer. But let's say you don't have a UI thread that you can count on. One method is to burn a thread: Less expensive is to borrow a thread from the thread pool: But both of these methods hold a thread hostage for the ...

Code
Nov 28, 2012
0
0

Why are there both FIND and FINDSTR programs, with unrelated feature sets?

Raymond Chen
Raymond Chen

Jonathan wonders why we have both and , and furthermore, why the two programs have unrelated features. The program supports UTF-16, which doesn't; on the other hand, the program supports regular expressions, which does not. The reason why their feature sets are unrelated is that the two programs are unrelated. The program came first. As I ...

History
Nov 27, 2012
0
0

Security vulnerability reports as a way to establish your l33t kr3|)z

Raymond Chen
Raymond Chen

There is an entire subculture of l33t l4x0rs who occasionally pop into our world, and as such have to adapt their communication style to match their audience. Sometimes the adaptation is incomplete. You may have trouble finding the exploit buried in that perl script, because the perl script consists almost entirely of graffiti and posturing ...

Other
Nov 26, 2012
0
0

Puzzling triple rainbow clearly identifies location of pot of gold

Raymond Chen
Raymond Chen

I noted to some friends that the weather forecast for Seattle two weekends ago called for rain on Friday, rain on Saturday, and rain on Sunday. But at least on Monday, the forecast was not for rain. It was for heavy rain. One of the consequences of Seattle's annual Rain Festival (runs from January 1 to December 31) is that we get plenty of ...

Non-Computer
Nov 26, 2012
0
0

How does the window manager decide where to place a newly-created window?

Raymond Chen
Raymond Chen

Amit wonders how Windows chooses where to place a newly-opened window on a multiple-monitor system and gives as an example an application whose monitor choice appears inconsistent. The easy part is if the application specifies where it wants the window to be. In that case, the window is placed at the requested location. How the application ...

Code
Nov 23, 2012
0
0

The Hater's Guide to the Williams-Sonoma Catalog

Raymond Chen
Raymond Chen

Today is the traditional start of the holiday shopping season in the United States. If you are thinking of getting something from Williams-Sonoma, Drew Margary has selected a few items of note for your consideration (NSFW: language). (It cracks me up that the model is using the batter dispenser which "measures out uniform circles" to fill a ...

Non-Computer
Nov 23, 2012
0
0

When studying performance, you need to watch out not only for performance degradation, but also unexpected performance improvement

Raymond Chen
Raymond Chen

In addition to specific performance tests run by individual feature teams, Windows has a suite of automated performance tests operated by the performance team, and the results are collated across a lot of metrics. When a number is out of the ordinary, the test results are flagged for further investigation. The obvious thing that the performance ...

Other
Nov 22, 2012
0
0

The resource compiler will helpfully add window styles for you, but if you're building a dialog template yourself, you don't get that help

Raymond Chen
Raymond Chen

A customer was having trouble with nested dialogs. They were doing something very similar to a property sheet, with a main frame dialog, and then a collection of child dialogs that take turns appearing inside the frame dialog based on what the user is doing. The customer found that if they created the child dialogs with the function, everything ...

Code
Nov 21, 2012
0
0

It rather involved being on the other side of this airtight hatchway: Silently enabling features

Raymond Chen
Raymond Chen

A security vulnerability report arrived which went roughly like this: When you programmatically enable the XYZ feature, the user receives no visual alert that it is enabled. As a result, malware can enable this feature and use it as part of an attempt to turn the machine into a botnet zombie. The XYZ feature should notify the user when it is ...

Other