Quantcast
Channel: The Old New Thing
Browsing all 3085 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

The more times you use the word "simply" in your instructions, the more I...

I was helping somebody look up how to enable frobbing for widgets, and I found one set of instructions on a blog somewhere. To be honest, this happened long enough ago that I forgot what it was...

View Article


Image may be NSFW.
Clik here to view.

Dubious security vulnerability: Copying a program and running the copy

This wasn't an actual security vulnerability report, but it was inspired by one. "If you take the program XYZ.EXE and you rename it or copy it to a new name that contains the letters XYX, then you can...

View Article


Image may be NSFW.
Clik here to view.

Under what conditions will the IUnknown::AddRef method return 0?

A customer was debugging their application and discovered that for one of the objects they were using, the IUnknown::Add­Ref method returns 0. How is that possible? That would imply that the object's...

View Article

Image may be NSFW.
Clik here to view.

Debugging walkthrough: Access violation on nonsense instruction, episode 2

A colleague of mine asked for help debugging a strange failure. Execution halted on what appeared to be a nonsense instruction. eax=0079f850 ebx=00000000 ecx=00000113 edx=00000030 esi=33ee06ef...

View Article

Image may be NSFW.
Clik here to view.

Does the really CLR call CoInitializeEx on the first call to unmanaged code,...

Some time ago, I called out this part of the documentation regarding managed and unmanaged threading: On the first call to unmanaged code, the runtime calls Co­Initialize­Ex to initialize the COM...

View Article


Image may be NSFW.
Clik here to view.

Microspeak: Headcount, req, and related personnel terms

For some reason, there are a lot of Microspeak terms related to personnel. (Maybe you folks can tell me how common these terms are outside Microsoft.) We start with a term that is not actually used...

View Article

Image may be NSFW.
Clik here to view.

Travel tip: Don't forget your car on the ferry

One of my colleagues lives on Bainbridge Island and has quite a long commute to work each day. From his house, he walks to the bus stop, then takes the bus to the Winslow ferry terminal, then takes...

View Article

Image may be NSFW.
Clik here to view.

Sure, we have RegisterWindowMessage and RegisterClipboardFormat, but where...

The Register­Window­Message function lets you create your own custom messages that are globally unique. But how do you free the message format when you're done, so that the number can be reused for...

View Article


Image may be NSFW.
Clik here to view.

Finding the constructor by scanning memory for the vtable

In Looking for leaked objects by their vtable, we used the object's constructor to locate the vtable, and then scanned the heap for the vtable to find the leaked object. But you can run this technique...

View Article


Image may be NSFW.
Clik here to view.

CancelIoEx can cancel I/O on console input, which is kind of nice

Today's Little Program asks you to type something, but gives you only two seconds to do it. This is not interesting in and of itself, but it shows you how to cancel console I/O. There is no motivation...

View Article

Image may be NSFW.
Clik here to view.

A Venn diagram demonstrating the dining options in one of the new cafeterias

Back in the early 2000s, a new building opened on the Microsoft main campus, and the food services department tried an experiment: Instead of creating a standard cafeteria, they decided to make the...

View Article

Image may be NSFW.
Clik here to view.

What's the difference between PathIsSystemFolder and Protected Operating...

The way to detect weird directories that should be excluded from the user interface is to check for the FILE_ATTRIBUTE_HIDDEN and FILE_ATTRIBUTE_SYSTEM attributes being set simultaneously. This is the...

View Article

Image may be NSFW.
Clik here to view.

Switching on a tuple: Sneaky trick

This is a sneaky trick, but it's sometimes a handy sneaky trick. Suppose you have two values, and you want to switch on the tuple. In other words, you want a switch statement for something like this:...

View Article


Image may be NSFW.
Clik here to view.

Flaw reported in Windows 95

One of my colleagues ran across this old news clipping from 20 years ago today. Flaw reported in Windows 95THE ASSOCIATED PRESS SAN MATEO, Calif. — Microsoft Corp.'s long-awaited Windows 95 operating...

View Article

Image may be NSFW.
Clik here to view.

How do I make a boldface item on a context menu?

Today's Little Program displays a context menu with a bold item. I sort of talked about this some time ago, but now I'm going to actually do it. Remember, the boldface item represents the default...

View Article


Image may be NSFW.
Clik here to view.

I want you to chase your sisters until they throw up

A friend of mine grew up in a rural area. The family got their water from a well and had to fluoridate it manually with tablets. When my friend was a little girl, she was playing around the house with...

View Article

Image may be NSFW.
Clik here to view.

What was the relationship between Outlook and Outlook Express?

Brian wonders whether project Stimpy became Outlook Express. As noted in the article, projects Ren and Stimpy were merged into a single project, which became Outlook. You could say that Stimpy became...

View Article


Image may be NSFW.
Clik here to view.

Under what circumstances will a dialog box not use the caption specified in...

Could it be space aliens? Under what circumstances will a dialog box not use the caption specified in the resource file? In particular, we have a modal dialog box that is not using the caption from...

View Article

Image may be NSFW.
Clik here to view.

It appears that some programmers think that Windows already ships with that...

There are some compatibility bugs we investigate where the root cause is that the application relied on time travel. Wait, let me explain. An application might issue an asynchronous request for a file...

View Article

Image may be NSFW.
Clik here to view.

Why is CreateToolhelp32Snapshot returning incorrect parent process IDs all of...

A customer reported a problem with the Create­Toolhelp32­Snapshot function. From a 32-bit process, the code uses Create­Toolhelp32­Snapshot and Process32­First/Process32­Next to identify parent...

View Article
Browsing all 3085 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>