The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Nov 19, 2009
Post comments count 0
Post likes count 1

We're using a smart pointer, so we can't possibly be the source of the leak

Raymond Chen

A customer reported that there was a leak in the shell, and they included the output from Application Verifier as proof. And yup, the memory that was leaked was in fact allocated by the shell: On the other hand, is an object creation function, so it's natural that the function allocate some memory. The responsibility for freeing the memory belongs to the caller. We suggested that the customer appears to have leaked the interface pointer. Perhaps there's a hole where they called and managed to avoid the matching . "Oh no," the customer replied, "that's not possible. We call this function in only one pla...

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

News flash: Healthy people live longer

Raymond Chen

Researchers have determined that people in good physical condition live longer. Who'd'a thunk it?

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

How do I move the Windows.edb and other search index files?

Raymond Chen

Nothing profound today, just a little tip. My customer is looking out for a way to change the location of the windows.edb file to another (larger) drive. From the Indexing Options Control Panel, click Advanced, and then under Index location, click Select new.

Nov 17, 2009
Post comments count 0
Post likes count 1

We found the author of Notepad, sorry you didn't go to the award ceremony

Raymond Chen

I've received independent confirmations as to the authorship of Notepad, so I'm inclined to believe it. Sorry you didn't get to go to the award ceremony. The original author of Notepad also served as the development manager for Windows 95. His job was to herd the cats that made up the programmers who worked on Windows 95, a job which you can imagine falls into the "not easy" category. After Windows 95, he retired from the software industry and became a high school science teacher. At a social event some years later, I met him again and asked about the transition from software development manager...

Nov 17, 2009
Post comments count 0
Post likes count 1

How to tell when your patent has been approved

Raymond Chen

There are a variety of ways of finding out when your patent is granted, but the quickest mechanism is to check your mailbox. But the thing to look for is not what you might think. Even before you receive word from your company's patent department, you will start receiving junk mail delivered to your home address from companies that sell patent-related novelties, pointless trinkets like pencils and mugs with your patent number on it. Nevermind that you can probably order personalized pencils for much less than what the patent-chasers were offering.

Nov 16, 2009
Post comments count 0
Post likes count 0

How to pretend that you attended my talk at UIUC Reflections|Projections 2009

Raymond Chen

Step 1: Buy a 1.55-ounce Hershey's Milk Chocolate Bar from a convenience store, supermarket, or (if truly desperate) online. Step 2: Print out this candy bar wrapper. Step 3: Trim wrapper on registration marks and wrap around candy bar. Step 4: Stay up late the night before you plan on watching the video by partying with Ryan North and teaching him how to play beer pong. Step 5: Force yourself to wake up the next morning and watch the recorded video of my talk while trying desperately to stay awake. The candy bar might help. Note: Although most steps are optional, they are essential if you want a...

Nov 16, 2009
Post comments count 0
Post likes count 1

Why does shlwapi import a nonexistent function?

Raymond Chen

Commenter charless asks why shlwapi.dll imports a nonexistent function from mpr.dll, which shows up in dependency tools as a broken import. Because that function did exist at one point, although it doesn't exist any more. The function in question was available only on Windows 95-series versions of Windows. It never existed on Windows NT or any of its successors. But remember that was originally developed for Internet Explorer, which ran on Windows 95 as well as Windows NT. Internet Explorer checked the operating system and called the Windows 95-only function only after verifying that ...

Nov 13, 2009
Post comments count 0
Post likes count 0

What a drag: You can be a drag in managed code, too

Raymond Chen

David Anson digests my earlier series on virtual drag/drop and translates it into managed code. His example of dragging his entire RSS feed is an excellent illustration of dragging dynamically-generated virtual content. (I didn't use an example like that because the purpose of the What a drag series was to get something done in the least amount of code, and generating a stream from a URL takes an awful lot of code when doing it from the unmanaged side, which would ultimately detract from the point of the example.) Bonus: He takes the example further by adding asynchronous support.

Nov 13, 2009
Post comments count 0
Post likes count 1

You thought reasoning about signals was bad, reasoning about a total breakdown of normal functioning is even worse

Raymond Chen

When things are bad, don't be surprised that they don't work.