The Old New Thing
Practical development throughout the evolution of Windows.
Latest posts
Why are there both FIND and FINDSTR programs, with unrelated feature sets?
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 noted in the article, the program dates back to 1982. When it was ported to Windows NT, Unicode support was added. But nobody bothered to add any features to it. It was intended to be a straight port of the old MS-DOS program. Meanwhile, one of my colleagues ove...
Security vulnerability reports as a way to establish your l33t kr3|)z
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 and chest-thumping. (You may also have noticed a bug.) Here is the script with all the fluff removed: This could've been conveyed in a simple sentence: "Create a one-byte file consisting of a single null byte." But if you did that, then you wouldn't get your chance t...
Puzzling triple rainbow clearly identifies location of pot of gold
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 potential for rainbows. A friend of mine was lucky enough to capture a photo of a puzzling triple rainbow this past weekend. The primary and secondary rainbows we all know about, but what's that vertical rainbow shooting straight up into the sky? (And observe that the landi...
How does the window manager decide where to place a newly-created window?
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 chooses those coordinates is up to the application. On the other hand, if the application passes , this means that the application is saying, "I have no opinion where the window should go. Please pick a place for me." If this is the first top-level window created by the app...
The Hater's Guide to the Williams-Sonoma Catalog
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 square waffle-maker.)
When studying performance, you need to watch out not only for performance degradation, but also unexpected performance improvement
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 metrics look for are sudden drops in performance. If an operation that used to consume 500KB of memory now consumes 750KB of memory, then you need to investigate why you're using so much memory all of a sudden. The reasons for the increase might be obvious, like "Oh, rats...
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
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 worked great, but if they built the template at run-time, keyboard navigation wasn't working right. Specifically, one of their child dialogs contained an edit control, and while you could put focus on it with the mouse, it was not possible to tab to the control. On the...
It rather involved being on the other side of this airtight hatchway: Silently enabling features
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 enabled, so that to presence of malware is more easily determined. Okay, first of all, before we get to the security part of this issue, let's look at the user interface design. The proposed change is that, when the XYZ feature is enabled programmatically, the user receive...
How do I use group policy to improve security of USB thumb drives in my organization?
A customer wanted to know how they could improve the security of USB thumb drives in their organization. Specifically, they wanted to block access to removable media devices (primarily USB thumb drives), but provide a list of exceptions for specific thumb drives. Fortunately, there's a whitepaper that covers exactly this topic and explains how to set up your policies to accomplish this. Step-By-Step Guide to Controlling Device Installation Using Group Policy