The Old New Thing

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

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 ...

Why do we need IsDialogMessage at all?

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...
Comments are closed.0 0
Code

You already know the answer since you do it yourself

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 ...
Comments are closed.0 0
Code

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

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...

Microspeak: scoped to

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...

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

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...
Comments are closed.0 0
Code

Registration-free COM the old-fashioned way: The car mp3 player

Windows XP introduced Registration-Free COM, permitting you to place your COM object registrations in a manifest rather than in the registry. Very handy when you want to support xcopy deployment or running directly off a thumb drive. And very much in keeping with the principle of not using a global solution for a local problem. (If you ...
Comments are closed.0 0
Code

You can use an OVERLAPPED structure with synchronous I/O, too

Even if you didn't open a file with , you can still use the structure when you issue reads and writes. Mind you, the I/O will still complete synchronously, but you can take advantage of the other stuff that has to offer. Specifically, you can take advantage of the and members to issue the I/O against a file location different from the ...
Comments are closed.0 0
Code

I totally presented to an executive the wrong way

Some time ago, Gray Knowlton wrote an article on how to present to an executive. As you might have guessed, I've done it completely the wrong way. Many years ago, I was part of a group presenting to a senior-level executive. I was the one who wrote the document establishing the background for the topic and laying out the various options ...