The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

There’s camping, and then there’s luxury camping, and then there’s ridiculous luxury camping
Jan 27, 2009
Post comments count 0
Post likes count 0

There’s camping, and then there’s luxury camping, and then there’s ridiculous luxury camping

Raymond Chen
Raymond Chen

Back in 2002, I read an article about luxury camping in the Wall Street Journal, and it struck me as kind of missing the point of camping. For campers too busy to shop for marshmallows, one place stocks a s'mores kit -- skewers included -- in its gourmet general store. Another provides blow dryers, putting an end to "river hair." When Karen Schaupeter and her husband arrived at El Capitan Canyon in Santa Barbara, Calif., they were chauffeured to their campsite in a golf cart. Dinner was tamales with mango salsa prepared by the staff, in front of a roaring bonfire -- also prepared by the staff. In the mornin...

Why can’t I see all of the 4GB of RAM in my machine?, redux
Jan 27, 2009
Post comments count 0
Post likes count 0

Why can’t I see all of the 4GB of RAM in my machine?, redux

Raymond Chen
Raymond Chen

Phil Taylor gives another few reasons why machine with 4GB of RAM doesn't show up as such. (Here's my earlier posting on this subject, for reference.) These articles about possible reasons for memory not showing up are not intended to be comprehensive. It is entirely possible that the problem you are experiencing is not one described here.

I think I can read the bassoonist’s music from here
Jan 26, 2009
Post comments count 0
Post likes count 0

I think I can read the bassoonist’s music from here

Raymond Chen
Raymond Chen

An insane 1.4-gigapixel image of Obama's inaugural address. All it needs is a guy in the audience dressed like Waldo.

But then we ran into problems when we started posting 10,000 messages per second
Jan 26, 2009
Post comments count 0
Post likes count 0

But then we ran into problems when we started posting 10,000 messages per second

Raymond Chen
Raymond Chen

Once upon a time, a long, long time ago, there was a research team inside Microsoft who was working on alternate models for handling input. I don't know what eventually came of that project, and I don't even remember the details of the meeting, but I do remember the punch line, so I'm just going to make up the rest. The research project broke up the duties of their system into a few components. The two that are important to the story are a driver component which received information from various hardware devices and transmitted that information via the function to another component whose job it was to study th...

Why can’t you apply ACLs to registry values?
Jan 23, 2009
Post comments count 0
Post likes count 0

Why can’t you apply ACLs to registry values?

Raymond Chen
Raymond Chen

Someone wondered why you can't apply ACLs to individual registry values, only to the containing keys. You already know enough to answer this question; you just have to put the pieces together. In order for a kernel object to be ACL-able, you need to be able to create a handle to it, since it is the act of creating the handle that performs the access check. Creating a handle to the value means that we would need a function like and corresponding and functions which take not a registry key handle but a registry value handle. And then you've basically come full circle. You've reinvented the 16-bit reg...

Why do I get the error REGDB_E_IIDNOTREG when I call a method that returns an interface?
Jan 22, 2009
Post comments count 0
Post likes count 0

Why do I get the error REGDB_E_IIDNOTREG when I call a method that returns an interface?

Raymond Chen
Raymond Chen

This is another manifestation of the missing marshaller problem. IContextMenu *pcm; HRESULT hr = psf->GetUIObjectOf(hwnd, 1, &pidl, IID_IContextMenu, NULL, &pcm); // fails with REGDB_E_IIDNOTREG The IContextMenu interface does not have a proxy/stub factory (as of this writing). Recall that shell objects, as a rule, are apartment model. If you create the object from a multi-threaded apartment, COM needs to build a wrapper object which can marshal calls from off-thread back onto the original thread, in order to adhere to the threading rules for apartment-model objects. And if the C...

If you have full trust, then you can do anything, so don’t be surprised that you can do bad things, too
Jan 21, 2009
Post comments count 0
Post likes count 0

If you have full trust, then you can do anything, so don’t be surprised that you can do bad things, too

Raymond Chen
Raymond Chen

This is another example of the dubious security vulnerability known as wrapping a simple idea inside layers of obfuscation and then thinking that somehow the obfuscation is the source of the problem. First of all, consider this: Suppose a program calls one of its own functions but gets the calling convention wrong and ends up corrupting its stack. Is that a security vulnerability in the operating system? No, it's a bug in the program. Now, maybe a bad guy can try to exploit this bug in the program, but if such an exploit could be found, it's naturally a vulnerability in the program, not in the operating syste...

If you didn’t like the answer, asking the same question again is unlikely to help
Jan 20, 2009
Post comments count 0
Post likes count 0

If you didn’t like the answer, asking the same question again is unlikely to help

Raymond Chen
Raymond Chen

I find it surprising how often this happens. A customer liaison will send a question to a mailing list like this: From: X To: Gizmo Discussion Hi, everybody. My customer is using the Gizmo Toolkit and wants to frob a gizmo without first registering as a frobber. They created the gizmo with , passing all the default flags, and then they call to attach the gizmo to a sprocket. When the sprocket detects that its host is decycling, it tries to frob the gizmo by calling , but the call fails. They can't register the sprocket as a frobber because the sprocket doesn't have the right frob context. They tried setti...

May the Horse Be With You: Stories from the racetrack
Jan 19, 2009
Post comments count 0
Post likes count 0

May the Horse Be With You: Stories from the racetrack

Raymond Chen
Raymond Chen

Only a Game interviews Harvey Pack [real], author of May the Horse Be With You, a collection of stories about horse racing. I don't really care much about horse racing, but I do love a good story, and Harvey Pack has a bazillion good stories.