The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

May 8, 2026
Post comments count 0
Post likes count 0

Developing more confidence when tracking renames via Read­Directory­ChangesW

Raymond Chen

You can track the file ID.

May 7, 2026
Post comments count 1
Post likes count 3

When you upgrade your resource strings to Unicode, don’t forget to specify the L prefix

Raymond Chen

Otherwise, it'll get mapped back down to the 8-bit code page.

May 6, 2026
Post comments count 8
Post likes count 2

Why not have changes in API behavior depend on the SDK you link against?

Raymond Chen

Static libraries don't stand a chance.

May 5, 2026
Post comments count 10
Post likes count 7

A dispute over the TAB key highlights a mismatch between Microsoft and IBM organizational structures

Raymond Chen

I want to speak to your manager.

May 4, 2026
Post comments count 1
Post likes count 3

How do I inform Windows that I’m writing a binary file?

Raymond Chen

You don't. All files are binary at the file system level.

May 1, 2026
Post comments count 1
Post likes count 1

Developing a cross-process reader/writer lock with limited readers, part 4: Abandonment

Raymond Chen

Recovering from death of the owner.

Apr 30, 2026
Post comments count 3
Post likes count 2

Developing a cross-process reader/writer lock with limited readers, part 3: Fairness

Raymond Chen

Let the exclusive acquisition have a fair chance against shared acquisitions.

Apr 29, 2026
Post comments count 1
Post likes count 2

Developing a cross-process reader/writer lock with limited readers, part 2: Taking turns when being grabby

Raymond Chen

Please, not everybody, everything all at once.

Apr 28, 2026
Post comments count 11
Post likes count 2

Developing a cross-process reader/writer lock with limited readers, part 1: A semaphore

Raymond Chen

A pot of tokens.

Apr 27, 2026
Post comments count 9
Post likes count 2

Looking at consequences of passing too few register parameters to a C function on various architectures

Raymond Chen

It's bad news no matter how you slice it, but Itanium makes it even worse.

Apr 24, 2026
Post comments count 3
Post likes count 2

Defending against exceptions in a scope_exit RAII type

Raymond Chen

But maybe it's not worth it.

Apr 23, 2026
Post comments count 12
Post likes count 2

Another crash caused by uninstaller code injection into Explorer

Raymond Chen

Inadvertently destroying a staircase while standing on it.

Apr 22, 2026
Post comments count 2
Post likes count 3

Mapping the page tables into memory via the page tables

Raymond Chen

So-called "fractal page mapping".

Apr 21, 2026
Post comments count 32
Post likes count 3

Sure, xor’ing a register with itself is the idiom for zeroing it out, but why not sub?

Raymond Chen

Somehow xor became the most popular version.

Apr 20, 2026
Post comments count 1
Post likes count 3

How did code handle 24-bit-per-pixel formats when using video cards with bank-switched memory?

Raymond Chen

You still have to use aligned accesses, even though the pixels might not be aligned.

Apr 17, 2026
Post comments count 1
Post likes count 4

Forgotten message from the past: LB_INIT­STORAGE

Raymond Chen

Preallocating memory to avoid quadratic behavior.

Apr 16, 2026
Post comments count 9
Post likes count 2

What’s up with window message 0x0091? We’re getting it with unexpected parameters

Raymond Chen

Trespassing on system messages.

Apr 15, 2026
Post comments count 0
Post likes count 2

Why is there a long delay between a thread exiting and the Wait­For­Single­Object returning?

Raymond Chen

Maybe it didn't really exit.