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

Raymond's highly scientific predictions for the 2008 NCAA men's basketball tournament

It's that time again: Raymond comes up with an absurd, arbitrary criterion for filling out his NCAA bracket. This time, I studied all the games played in the NCAA men's basketball tournament since 1985 and computed how many of the games were won by the favorite and how many were upsets, broken down by the numerical difference between the seeding of the two teams. I found it interesting that when the teams are seeded N and N+2, you get an upset more than half the time! If the probability of the favorite winning is p and I choose the favorite with probability q, then the prediction would be correct pq + (1&mi...

What a drag: Dragging a virtual file (IStorage edition)

I doubt anybody will ever need this.

What a drag: Dragging a virtual file (IStream edition)

The contents can be generated incrementally.

What a drag: Dragging a virtual file (HGLOBAL edition)

You need a file group descriptor and file contents.

I try not to rely on the kindness of strangers, but it's a pleasant surprise when strangers come through

I took part in a casual bike ride last month in celebration of a friend's daughter's birthday. Our first stop was Trophy Cupcakes in Wallingford. It was there that I discovered that my wallet was missing. I checked my pockets several times, but the wallet was gone. I was pretty sure I had brought it with me, but there was an outside chance that I had simply forgotten it from the get-go. The rest of the bike ride was pleasant enough. Well, I took a tumble on the Elliott Bay Bike Trail after coming down the overpass ramp: I was a bit too effective at keeping right and ended up catching the railroad tracks that pa...

Why can't you rename the Recycle Bin?

Commenter zd asks, "Why can't you rename the Recycle Bin?" This question, as do many questions, comes with implicit assumptions. In particular, the assumption that everything can be renamed by default and that somebody must have gone to the effort of blocking the rename of the Recycle Bin. Actually, reality is the reverse. Shell namespace objects cannot be renamed by default. Code has to be written to support rename. This is a special case of something Ry Jones saved, namely, that features start out nonexistent and somebody has to make them happen. To support renaming, the shell folder needs to support and...

If you grant somebody SeDebugPrivilege, you gave away the farm

By default, users can debug only processes that they own. In order to debug processes owned by other users, you have to possess the SeDebugPrivilege privilege. But don't grant this privilege casually, because once you do, you gave away the farm. If you let users debug processes owned by other users, then they can debug processes owned by System, at which point they can inject code into the process and perform the logical equivalent of , thereby elevating themselves (or anybody else) to administrator. If SeDebugPrivilege is equivalent to granting administrator privileges, why does it exist at all? It's not so mu...

What a drag: Dragging a Uniform Resource Locator (URL) and text

The same string, with two formats.

What a drag: Dragging a Uniform Resource Locator (URL)

It's still just a string.