The Old New Thing
Practical development throughout the evolution of Windows.
Latest posts
When people ask for security holes as features: Privileged execution
A customer wanted to know if there was a way to execute privileged instructions without having to write a driver. "I just need to execute a few instructions, and writing a driver would be overkill since it's only three instructions. Is there a way I can execute these privileged instructions without a driver?" The whole point of having a class of modules called drivers is to prevent somebody from doing exactly what you're asking for. Only drivers can execute privileged instructions; that's why they're called privileged instructions. "Yeah, but I just need three instructions. Do I have to write a whole driver ju...
The COM marshaller uses the COM task allocator to allocate and free memory
It should be second nature to you that the code which allocates memory and the code which frees memory need to use the same allocator. Most of the time, you think of it as "If you allocate memory, you need to free it with the corresponding mechanism," but this sentence works in the reverse direction as well: If you hand memory to a function that will free it, you have to allocate the memory with the corresponding mechanism. Let's look at this question that appeared on a discussion group: I have the following method defined in my IDL file: My server implementation of this method goes like this: When I ...
We’ve got your hotel surrounded (on one side) (and not even the entire side)
A local hotel advertises itself like so: Surrounding the hotel are popular Seattle attractions such as Pike Place Market, the Space Needle, Safeco Park, home of baseball's Seattle Mariners, and Qwest Field, home of football's Seattle Seahawks, all just a short drive away. Okay, first, it's Safeco Field, not Safeco Park. Mind you, I've misspelled Qwest Field in the past, so maybe I shouldn't complain. But let's look at those Seattle attractions which "surround" the hotel: They all lie in the same direction and subtend a total of twelve degrees of arc. This is a sense of the word "surround" I was previously u...
Things I've written that have amused other people, Episode 5
A question was sent to an internal discussion list for users of the XYZ tool: From: Q To: XYZ Users The GHI function in the JKL tool doesn't work for me. «description of problem deleted» I responded with this message: To: Q, XYZ Users The JKL tool is not part of XYZ. You should contact the author of the JKL tool. The reason why people were amused by this is that the author of the JKL tool is me. (Says so right there in the online help.) As a final punch line, the person never did contact me.
We accept cash, credit cards, and Microsoft cardkeys
One of the restaurants that opened at the new Microsoft Commons is Spitfire, which opened under its own name instead of one of the many wonderful alternatives proposed. At The Commons, the dining establishments operate in a variety of ways (cafeteria, buffet, fast casual, deli, etc.) but they share the common characteristic that you pay for your meal before you sit down to eat, and you clear your own table when you're done. In other words, it's a giant upscale food court spread out over two buildings. Except for Spitfire, which has its own building and operates as a sit-down restaurant with table service. One...
What is the logic behind the thumb size and position calculation in scroll bars?
Commenter sarathc asks, "How do we implement a custom scroll bar as Windows does? What is the logic behind the thumb size and position calculation? How we could dynamically manage it?" Let's look at the three questions in turn. To implement a custom scroll bar... don't do it. It's just not worth the effort, and there will almost always be little seams, like not lighting up when the mouse hovers over them. The logic behind the thumb size and position calculation I thought I covered in my scroll bar series. The size of the thumb relative to the size of the scroll bar is the same as the page size relative to t...
Windows 95's ticking death
A few years ago, Larry Osterman explained the famous beeping death. Windows 95 had its own noise-related death, what nobody has called ticking death, but that's what I'm going to call it. (Let's see how long before somebody decide to add it to Wikipedia.) When your machine fell into ticking death, each time you moved the mouse or pressed a key, it was acknowledged with nothing more than a tiny click from the speaker. What was the cause of ticking death? When the hardware drivers report a mouse or keyboard event on Windows 95, they call the or function. Since this happens at hardware input time, th...
Should I fix the spelling in the United States Constitution?
Commenter Dave jokingly remarked, "I've grown used to handling characters with ASCII. (If it was good enough to represent every character in the US Constitution, it's good enough for me.)" But there's a double-joke in there. You see, not every character in the United States Constitution can be represented in ASCII! If you take a close look, you'll see that some words appear to be "misspelled": At the end of the second line, it says "Bleſsings of Liberty", and Article 1 Section 1 declares that "All legislative Powers herein granted shall be vested in a Congreſs of the United States." That f...
Rentonites concerned about Hooters opening in their town, but not for the reason you think
To support my claim that Renton has a reputation for being a working-class town, I submit this article from last week's news: Hooters too pretentious for us, some Renton, South Park locals say.