The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

What makes <CODE>cheap_<WBR>steady_<WBR>clock</CODE> faster than <CODE>std::<WBR>chrono::<WBR>high_<WBR>resolution_<WBR>clock</CODE>?
Oct 22, 2025
Post comments count 2
Post likes count 1

What makes cheap_steady_clock faster than std::chrono::high_resolution_clock?

Raymond Chen
Raymond Chen

It's quite a bit faster, though maybe you don't care.

Microspeak: The hockey stick on wheels
Oct 21, 2025
Post comments count 1
Post likes count 2

Microspeak: The hockey stick on wheels

Raymond Chen
Raymond Chen

You're always a year away.

What about the icons in pifmgr.dll?
Oct 20, 2025
Post comments count 12
Post likes count 4

What about the icons in pifmgr.dll?

Raymond Chen
Raymond Chen

Just for fun.

Using RAII to remedy a defect where not all code paths performed required exit actions, follow-up
Oct 17, 2025
Post comments count 0
Post likes count 2

Using RAII to remedy a defect where not all code paths performed required exit actions, follow-up

Raymond Chen
Raymond Chen

If the callback requires copyability.

Using RAII to remedy a defect where not all code paths performed required exit actions
Oct 16, 2025
Post comments count 9
Post likes count 4

Using RAII to remedy a defect where not all code paths performed required exit actions

Raymond Chen
Raymond Chen

Passing the obligation onward.

Why can you increment a reference count with relaxed semantics, but you have to decrement with release semantics?
Oct 15, 2025
Post comments count 9
Post likes count 4

Why can you increment a reference count with relaxed semantics, but you have to decrement with release semantics?

Raymond Chen
Raymond Chen

It's more important to clean up when you leave.

I remember taking a screen shot of a video, and when I opened it in Paint, the video was playing in it! What witchcraft is this?
Oct 14, 2025
Post comments count 12
Post likes count 6

I remember taking a screen shot of a video, and when I opened it in Paint, the video was playing in it! What witchcraft is this?

Raymond Chen
Raymond Chen

You copied the green screen.

API design principle: Don’t tempt people to divide by zero
Oct 13, 2025
Post comments count 4
Post likes count 3

API design principle: Don’t tempt people to divide by zero

Raymond Chen
Raymond Chen

Remove it from the equation.

The self-assignment principle for Windows Runtime properties: Don’t change behavior based on whether a property has been written to
Oct 10, 2025
Post comments count 5
Post likes count 2

The self-assignment principle for Windows Runtime properties: Don’t change behavior based on whether a property has been written to

Raymond Chen
Raymond Chen

The fact that a property has been set does not by itself trigger functionality.