The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Dec 24, 2009
Post comments count 0
Post likes count 1

Why don't we create a special class of programs which can break the normal rules?

Raymond Chen

In response to a discussion of why the window handle limit is 10,000, commenter Juan wondered why we don't create a special class of programs which can exceed the 10,000 handle limit and otherwise bypass the normal operation of the system. This is another case of the tragedy of special treatment: Eventually, nothing is special any more. If there were a way for an application to say, "Hey, I don't want to be constrained by the normal rules that apply to your everyday boring applications," then every application would simply say it, and the net effect would be that the constraint no longer applies to anybody. ...

Dec 23, 2009
Post comments count 0
Post likes count 0

Exploiting the inattentive: The posted wine rating may not match the wine on the shelf

Raymond Chen

The Washington Post did a spot check of area wine stores and found that of the "shelf talkers" signs (those things that describe the wine and tell you what score it received from Wine Spectator magazine) it found, a quarter of them were incorrect, usually by attributing a good score to the correct wine vineyard but from a different year. So when you cruise the wine store, make sure to double-check that the information placard actually matches the wine it's posted next to.

Dec 23, 2009
Post comments count 0
Post likes count 1

Why is it possible to destroy a critical section while it is in use?

Raymond Chen

Some time back, Stu wondered why it is possible to destroy a critical section while it is in use. Well, there's nothing stopping you from creating a file that contains these lines: and then telling your compiler to turn it into a program. It's not like a bolt of lightning is going to come out of the sky and zap you before you hit the Enter key. So obviously, it's possible. On the other hand, it's a bug, just like closing a handle to a file that another thread is reading from, or like closing an event handle that another thread is waiting on. Critical sections are one of those low-level I sure hope yo...

Dec 22, 2009
Post comments count 0
Post likes count 0

Tweeting Too Hard: Best of Twitter

Raymond Chen

We had Best of Craig's List. We had Lamebook. Now we have Tweeting Too Hard, "where self-important tweets get the recognition they deserve." Examples: The people who say I'm arrogant and shallow don't see me when I'm at home with my wife. Did I mention that she's a former swimsuit model? How was it I got invite to last yrs White House Xmas party when Bush was prez; and nothing this year? I guess I must try harder 2 be fab.

Dec 22, 2009
Post comments count 0
Post likes count 1

No, you can't lock icons to the user's desktop

Raymond Chen

In another installment of I bet somebody got a really nice bonus for that feature, I submit this question for your consideration. My customer wants to know how to lock a specific icon to the upper left hand corner of the desktop. This company must be writing the most awesome program to end all programs, a program so amazingly awesome that it should appear as the very first thing on the desktop so you won't forget how awesome it is. I think their users may disagree with that assessment. And the answer is, no, there is no supported way to force a particular icon to appear at a particular desktop position.

Dec 21, 2009
Post comments count 0
Post likes count 0

Christmas gift idea for your favorite Microsoft fanboy geek with no sense of fashion or taste

Raymond Chen

Then again, the "no sense of fashion or taste" may be redundant. Perhaps you are so enamored of the Microsoft-branded Snuggie you received at the Company Meeting that you can't keep your excitement to yourself and want to share the joy with a friend. No problem. You can now pick one up at the Microsoft Company Store in Redmond, right across the hall from the Visitor Center. (The Rapture Index ticks up another notch.) "You shouldn't have." Previously, in Christmas gift ideas.

Dec 21, 2009
Post comments count 0
Post likes count 1

What version of the compiler does Raymond use?

Raymond Chen

From the suggestion box, BrianK asks, "What compiler do you and other developers use? Are you using VS2005 yet?" To be honest, I don't know what compiler I use. There is a separate part of the team that worries about things like "What compiler should we use?" They deal with nitty-gritty details like "What version of the compiler should we use and what optimizations should we enable?" as well as higher-level planning like "How are we going to organize our source code so that different parts of the project can take advantage of each others' work while still not requiring all members of the Windows team to compil...

Dec 18, 2009
Post comments count 0
Post likes count 0

The economic inefficiency of gift-giving

Raymond Chen

Economist Joel Waldfogel explains why gift-giving is bad for the economy, and why a charity gift card is the best luxury gift of all. He goes into more detail in his new book, Scroogenomics, which you can buy somebody for Christmas just to tell Waldfogel where he can stick it. ("In the bank!" he'll say as he heads out with his royalty check.) Related: Economist Tim Harford writes an advice column called Dear Economist for the Financial Times. But instead of applying economic theory to economic problems, he applies economic theory to personal problems. As Harford himself explains, "Every advice columnist n...

Dec 18, 2009
Post comments count 0
Post likes count 1

I got an array with plenty of nuthin'

Raymond Chen

A customer reported a memory leak in the function : We found the following memory leak in the function . Please fix it immediately because it causes our program to run out of memory. If the 's type is , then the corresponding is leaked and not cleaned up. Right now, we are temporarily working around this in our program by inserting code before all calls to to free the , but this is clearly an unsatisfactory solution because it will merely result in double-free bugs once you fix the bug. Please give this defect your highest priority as it is holding up deployment of our system. The value is not a va...