The Old New Thing

Why does CoCreateInstance work even though my thread never called CoInitialize? The curse of the implicit MTA

While developing tests, a developer observed erratic behavior with respect to : In my test, I call and it fails with . Fair enough, because my test forgot to call . But then I went and checked the production code: In response to a client request, the production code creates a brand new thread to service the request. The brand new thread ...

How can I figure out which user modified a file?

The function will tell you when a file was last modified, but it won't tell you who did it. Neither will , , or , or . None of these the file system functions will tell you which user modified a file because the file system doesn't keep track of which user modified a file. But there is somebody who does keep track: The security event log...

If you don’t know what you’re going to do with the answer to a question, then there’s not much point in making others work hard to answer it

A customer asked the following question: We've found that on Windows XP, when we call the XYZ function with the Awesome flag, the function fails for no apparent reason. However, it works correctly on Windows 7. Do you have any ideas about this? So far, the customer has described what they have observed, but they haven't actually ...

Using opportunistic locks to get out of the way if somebody wants the file

Opportunistic locks allow you to be notified when somebody else tries to access a file you have open. This is usually done if you want to use a file provided nobody else wants it. For example, you might be a search indexer that wants to extract information from a file, but if somebody opens the file for writing, you don't want them to get ...

The importance of having a review panel of twelve-year-old boys, episode 2

Microsofties love their acronyms, but you have to remember to send every potential name through a review panel of twelve-year-old boys to identify the lurking embarrassments. When it came time in Windows 7 to come up with the names of the various subteams, two of the proposed names were Core OS eXperience and Find and Use eXperience, ...