The Old New Thing
Practical development throughout the evolution of Windows.
Latest posts
Developing more confidence when tracking renames via ReadDirectoryChangesW
You can track the file ID.
When you upgrade your resource strings to Unicode, don’t forget to specify the L prefix
Otherwise, it'll get mapped back down to the 8-bit code page.
Why not have changes in API behavior depend on the SDK you link against?
Static libraries don't stand a chance.
A dispute over the TAB key highlights a mismatch between Microsoft and IBM organizational structures
I want to speak to your manager.
How do I inform Windows that I’m writing a binary file?
You don't. All files are binary at the file system level.
Developing a cross-process reader/writer lock with limited readers, part 4: Abandonment
Recovering from death of the owner.
Developing a cross-process reader/writer lock with limited readers, part 3: Fairness
Let the exclusive acquisition have a fair chance against shared acquisitions.
Developing a cross-process reader/writer lock with limited readers, part 2: Taking turns when being grabby
Please, not everybody, everything all at once.
Developing a cross-process reader/writer lock with limited readers, part 1: A semaphore
A pot of tokens.
Looking at consequences of passing too few register parameters to a C function on various architectures
It's bad news no matter how you slice it, but Itanium makes it even worse.
Defending against exceptions in a scope_exit RAII type
But maybe it's not worth it.
Another crash caused by uninstaller code injection into Explorer
Inadvertently destroying a staircase while standing on it.
Mapping the page tables into memory via the page tables
So-called "fractal page mapping".
Sure, xor’ing a register with itself is the idiom for zeroing it out, but why not sub?
Somehow xor became the most popular version.
How did code handle 24-bit-per-pixel formats when using video cards with bank-switched memory?
You still have to use aligned accesses, even though the pixels might not be aligned.
Forgotten message from the past: LB_INITSTORAGE
Preallocating memory to avoid quadratic behavior.
What’s up with window message 0x0091? We’re getting it with unexpected parameters
Trespassing on system messages.
Why is there a long delay between a thread exiting and the WaitForSingleObject returning?
Maybe it didn't really exit.