The Old New Thing

When does an icon handler shell extension get unloaded?

A customer had a question about the SHGet­File­Info function. They used the function to obtain the icon for a file, and they discovered that when they asked for the icon of a particular type of file, the shell extension for the associated application was loaded. But unfortunately the third party shell extension is not getting unloaded...
Comments are closed.0 0
Code

The awesome Valentine's Day gift disguised as an uncreative one

A few years ago, one of my colleagues wanted to surprise his wife with a new laptop for Valentine's Day. (As a bonus, he set the wallpaper to one of their wedding pictures.) Now, he could just give her a neatly wrapped laptop, but he wanted this one to be a super-surprise. First, he bought a large box of chocolates. He then carefully opened ...

Why did the Windows 95 Start button have a secret shortcut for closing it?

Windows 95 had a strange feature where, if you put focus on the Start button and then hit Alt+- (That's Alt and the hyphen key), you got a system menu for the Start button which let you close it, and then the Start button vanished. Programmerman wondered why this existed. This was not a feature; it was just a bug. The person who ...

Fancy use of exception handling in FormatMessage leads to repeated "discovery" of security flaw

Every so often, somebody "discovers" an alleged security vulnerability in the Format­Message function. You can try it yourself: If you run this program under the debugger and you tell it to break on all exceptions, then you will find that it breaks on an access violation trying to write to an invalid address. Did you just find a ...
Comments are closed.0 0
Code

What is the effect of memory-mapped file access on GetLastError()?

A customer was using memory-mapped files and was looking for information as to whether access to the memory-mapped data modifies the value returned by Get­Last­Error. A member of the kernel team replied, "No, memory-mapped I/O does not ever change the value returned by Get­Last­Error." That answer is simultaneously correct ...
Comments are closed.0 0
Code

The path-searching algorithm is not a backtracking algorithm

Suppose your PATH environment variable looks like this: Suppose that you call LoadLibrary("foo.dll") intending to load the library at C:\dir2\foo.dll. If the network server is down, the LoadLibrary call will fail. Why doesn't it just skip the bad directory in the PATH and continue searching? Suppose the LoadLibrary function skipped the ...
Comments are closed.0 0
Code

Microspeak: fit

In Microspeak, fit is a predicate noun which is never used on its own but always comes with a modifying adjective. For something to be a good fit is for something to be appropriate or suitable for a particular situation. The opposite of a good fit is not a bad fit, because that's pejorative. Rather, something that is not a good fit is ...

The compatibility constraints of error codes, episode 2

A customer reported an incompatibility in Windows 7: If A: is a floppy drive and they call Load­Library("A:\\foo.dll") and there is no disk in the drive, the Load­Library call fails with the error ERROR_NOT_READY. Previous versions of Windows failed with the error ERROR_MOD_NOT_FOUND. Both error codes are reasonable responses to ...
Comments are closed.0 0
Code

When you are looking for more information, it helps to say what you need the information for

It's often the case that when a question from a customer gets filtered through a customer liaison, some context gets lost. (I'm giving the customer the benefit of the doubt here and assuming that it's the customer liaison that removed the context rather than the customer who never provided it.) Consider the following request: We would like ...