The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Why don't I get a Caps Lock warning balloon any more?
Apr 19, 2012
Post comments count 0
Post likes count 0

Why don't I get a Caps Lock warning balloon any more?

Raymond Chen
Raymond Chen

A customer asked for help diagnosing a problem they were experiencing on Windows XP: My customer reports that on their machines, they do not get the warning balloon that appears when Caps Lock is set while you are typing into a password field. I searched for relevant KB articles but couldn't find anything related to that. Can you help? Time for the psychic powers. My psychic powers tell me that the customer disabled all balloon tips. The customer liaison replied You are right. Thanks for the help. This is a not uncommon situation with some customers. They change a setting, and then later report tha...

Why doesn't the Version tab show up for very large files?
Apr 18, 2012
Post comments count 0
Post likes count 0

Why doesn't the Version tab show up for very large files?

Raymond Chen
Raymond Chen

If you have a really large file and try to view its properties in Explorer, you may find that the Version tab doesn't appear. What's going on? The Version tab uses the family of functions to obtain version information from files. It so happens that the function works by calling and then using functions like to locate the version resource so it can allocate a buffer to hold the version resource plus additional data to assist in character set translation. If the file is larger than the available address space in the Explorer process, then the call to will fail due to lack of address space into which to map ...

There's the kernel, and there's kernel mode – confusing historical terminology
Apr 17, 2012
Post comments count 0
Post likes count 0

There's the kernel, and there's kernel mode – confusing historical terminology

Raymond Chen
Raymond Chen

A few weeks ago, I mentioned that the kernel folks decided not to expose bonus bytes to applications. Some people were confused by this statement, not for what it said, but for what it implied. "Wait, you're telling me that the heap is implemented in kernel mode?" Let's turn the clock back to 1983. The core components of Windows fell into three categories: Windows 1.0 ran on the 8086, which had no concept of CPU modes or memory protection or any stuff we take for granted nowadays. Everything ran in a single mode, and since there was only one mode, it didn't have a name. Although future versions of Win...

Why do we need IsDialogMessage at all?
Apr 16, 2012
Post comments count 0
Post likes count 0

Why do we need IsDialogMessage at all?

Raymond Chen
Raymond Chen

alv wonders why we need the function at all. "All its activity could take place inside the window procedure of the modeless dialog itself", since when it doesn't have focus, it shouldn't be responding to messages anyway. Sure, that works great if the modeless dialog has focus. But it almost never does. What has focus is a control inside the modeless dialog. And in that case, the modeless dialog never sees the message, since the rule is that keyboard messages go to the window with focus. And that ain't the modeless dialog box. Consider, for example, a message box with OK and Cancel buttons. Focus defaults to t...

You already know the answer since you do it yourself
Apr 13, 2012
Post comments count 0
Post likes count 0

You already know the answer since you do it yourself

Raymond Chen
Raymond Chen

A customer was writing a program that performed virtual drag/drop. They were using the technique but found that many applications don't support drag/drop of virtual content. They support only . What's more, often these applications query for on not because they want to access the file, but just because they want to get the file names (for example, because they want to put up the no-entry cursor if the file types are not ones the application supports). Given that we want to be able to drop content onto applications which do not support drag/drop of virtual content, we have the problem of knowing exactly when ...

What is the real maximum length of a DNS name?
Apr 12, 2012
Post comments count 0
Post likes count 2

What is the real maximum length of a DNS name?

Raymond Chen
Raymond Chen

It's 255, but you have to count it the right way.

I know that an overlapped file handle requires an lpOverlapped, but why does it (sometimes) work if I omit it?
Apr 11, 2012
Post comments count 0
Post likes count 0

I know that an overlapped file handle requires an lpOverlapped, but why does it (sometimes) work if I omit it?

Raymond Chen
Raymond Chen

A customer observed that the formal requirements for the function specify that if the handle was opened with , then the parameter is mandatory. But the customer observed that in practice, passing results in strange behavior. Sometimes the call succeeds, and sometimes it even returns (horrors!) valid data. (Actually the more horrifying case is where the call succeeds and returns bogus data!) Now sure, you violated one of the requirements for the function, so the behavior is undefined. But why doesn't just flat-out fail if you call it incorrectly? The answer is that the function doesn't know whether you're ...

Microspeak: scoped to
Apr 10, 2012
Post comments count 0
Post likes count 0

Microspeak: scoped to

Raymond Chen
Raymond Chen

The Merriam-Webster dictionary gives as the meaning of scope as a verb to look at for evaluation, as in "to scope out the competition." But that's not how we use it at Microsoft. Here are some fake citations: The Widgets pop-up shows the available widgets scoped to the current selection. The results of the search are scoped to the current folder. Workflows can be scoped to containers, content types (scopeable to containers, sites, collections, servers, or enterprises), or combinations of these. Okay, that last one wasn't fake. You can tell it's not fake because it is extra confusing. To be scoped to som...

There's the interface contract, and there are the implementations of the interface contract
Apr 9, 2012
Post comments count 0
Post likes count 0

There's the interface contract, and there are the implementations of the interface contract

Raymond Chen
Raymond Chen

Ivo wants to know whether it is legal to use as the icon parameters to . The documentation says that the parameters are optional, but some shell folder implementations treat them as mandatory. Yes, the parameters are technically optional, but it's also the case that many people mess up their implementation of the interface and treat them as mandatory, either by crashing on a null pointer or by returning . Since is an extension interface, you are pretty much at the mercy of all the implementations of that extension. Welcome to the land of application compatibility, where you have to incorporate workarounds fo...