The Old New Thing
Practical development throughout the evolution of Windows.
Latest posts
News flash: Companies change their product to appeal to their customers
There was some apparent uproar because there was an industry which "changed the flavoring of their product depending on which market segment they were trying to appeal to." Well duh, don't all industries do this? The reason why this even remotely qualified as news didn't appear until the last five words of the article!
The window manager needs a message pump in order to call you back unexpectedly
There are a bunch of different ways of asking the window manager to call you when something interesting happens. Some of them are are in response to things that you explicitly asked for right now. The enumeration functions are classic examples of this. If you call and pass a callback function, then that callback is called directly from the enumerator. On the other hand, there is a much larger class of things that are in response either to things that happen on another thread, or in response to things that happen on your thread, but not as a direct result of an immediate request. For example, if you use the fun...
If you're waiting for I/O to complete, it helps if you actually have an I/O to begin with
We saw earlier the importance of waiting for I/O to complete before freeing the data structures associated with that I/O. On the other hand, before you start waiting, you have to make sure that you have something to wait for. A customer reported a hang in waiting for an I/O to cancel, and the I/O team was brought in to investigate. They looked at the I/O stack and found that the I/O the customer was waiting for was no longer active. The I/O people considered a few possibilities. These possibilities are in increasing order of likelihood (and, perhaps not coincidentally, decreasing order of relevance to th...
Charlie Sheen v Muammar Gaddafi: Whose line is it anyway?
I got seven out of ten right.
Although the x64 calling convention reserves spill space for parameters, you don't have to use them as such
Although the x64 calling convention reserves space on the stack as spill locations for the first four parameters (passed in registers), there is no requirement that the spill locations actually be used for spilling. They're just 32 bytes of memory available for scratch use by the function being called. We have a test program that works okay when optimizations are disabled, but when compiled with full optimizations, everything appears to be wrong right off the bat. It doesn't get the correct values for and : With optimizations disabled, the code is generated correctly: But when we compile with optimiza...
No, not that M, the other M, the one called Max
Code names are rampant at Microsoft. One of the purposes of a code name is to impress upon the people who work with the project that the name is only temporary, and that the final name will come from the marketing folks (who sometimes pull through with a catchy name like Zune, and who sometimes drop the ball with a dud like Bob and who sometimes cough up monstrosities like Microsoft WinFX Software Development Kit for Microsoft® Pre-Release Windows Operating System Code-Named "Longhorn", Beta 1 Web Setup). What I find amusing are the project which change their code names. I mean, the code name is already a p...
On the linguistic productivity of the word spam
The word spam has spawned off its own corner of the English language. I'm impressed by how productive the root word spam has become. Gratuitous cross-promotion: My colleague Terry Zink occasionally writes about spam on his Cyber Security Blog.
If you want to use GUIDs to identify your files, then nobody's stopping you
Igor Levicki proposes solving the problem of file extensions by using a GUID instead of a file name to identify a file. You can do this already. Every file on an NTFS volume has an object identifier which is formally 16-byte buffer, but let's just call it a GUID. By default a file doesn't have an object identifier, but you can ask for one to be created with , which will retrieve the existing object identifier associated with a file, or create one if there isn't one already. If you are a control freak, you can use to specify the GUID you want to use as the object identifier. (The call fails if the file alread...
DRUNK HULK's insightful commentary in all-caps (and faux-rudimentary English)
DRUNK HULK. Just read it.