The Old New Thing
Practical development throughout the evolution of Windows.
Latest posts

Hunting for loopholes in Washington state's driving-while-phoning-or-texting law

Last week, a law went into effect in the state of Washington which makes driving while texting or using a hand-held phone a primary offense, meaning that you can be pulled over for doing it. (Previously, it was a secondary offense, which means that the officer must have some other reason for pulling you over.) One of my colleagues studied the new law when it was passed and believes he found a loophole. According to RCW 46.61.667 subsection (2)(c)(i), driving-while-phoning is legal if the driver is using the phone to report illegal activity. My colleague points out that the law does not say whom you have t...

Annotating function parameters and using PREfast to check them

Via the suggestion box, Sys64738 asks, whether I think is a good C/C++ programming style to add IN and OUT to function prototypes. Remember, this is my opinion. Your opinion may validly differ. I would go beyond just IN and OUT and step up to SAL annotations, which describe the semantics of function parameters in more detail than simply IN and OUT. For example, the annotation lets you specify not only that the buffer is an output parameter, but also lets you specify how big the buffer is. This added expressiveness is used by tools like PREfast and its user-mode equivalent the C/C++ Code Analysis tool. The...

My niece asked me what color seashell I would like her to draw

My niece was amusing herself by drawing pictures with crayon, and she asked me, "I'm going to draw a seashell for you. What color do you want?" I said, "Blue." She responded, "No."

How do I indicate that I want my window to follow right-to-left layout rules?

There are many ways, depending on how wide a scope you want. If there is one specific window that you want to follow right-to-left layout rules, then you pass the extended window style when you create the window. This extended style is inherited by child windows, so once you set a top-level window to have right-to-left layout, all child windows will have it, too. To block the extended style from being inherited by child windows, pass the style when you create the parent window. Sidebar: If you're calling the function, then you don't directly control the styles of the top-level window. But there's a weird ba...

When you set a 100% CPU program to real-time priority, you get what you asked for

Real-time priority is really dangerous. It's higher priority than nearly everything else. It's higher priority than mouse input, keyboard input, and the disk cache. If you foolishly set the priority class of a CPU-intensive program to real-time, it will suck up your entire processor, leaving no cycles for anything else. In particular, since not even input runs at real-time priority, you can't stop it via any interactive means, because the thread that manages input can't even run to process your input. Mind you, even if the input thread did run at real-time priority, that wouldn't really help you any. Sure, it...

When you use a term, it helps if you know what the term means

Some years ago (in a project far, far away) I received a piece of email from a member of the release management team asking me if a particular issue met the escrow reset bug bar or not, as it applied to an upcoming pre-RTM release. I asked, "What is the current escrow reset bar?" I thought this was a fair question. After all, in order to state whether or not the issue met the escrow reset criteria, I needed to know what the escrow reset criteria were. I figured they'd reply with something like "The escrow reset criteria are on this internal Web page. Please evaluate the issue against those criteria and get bac...

Proto-Microspeak: Bug-hugging

As they say, "piss or get off the pot."

Dum dee dum, just hanging around the European Conference on Computer Supported Co-op… OMG LOOK AT THOSE CUTE DUCKS!

The 10th European Conference on Computer Supported Co-operative Work was held in Limerick, Ireland, and as you'd expect there were a lot of speakers and breakout sessions and... oh my God, look at those cute ducks!

Is it real that you are still using Visual C++ 6 and 5?

Commenter Sys64738 points out that Bjarne Stroustrup's Web site says that "Literally everything at Microsoft is built using various flavors of Visual C++ - mostly 6.0 and 7.0 but we do have a few holdouts still using 5.0 :-(" and wonders if it's true. Well, let's see. Visual C++ 6 came out in 1998 and doesn't support the /GS flag, nor does it support various replacement functions like . This makes it hard for anything compiled with Visual C++ 6 to conform to Microsoft's Security Development Lifecycle which requires all code to be compiled with /GS and bans functions like . As a result, I would suspect that...