The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

How did code handle 24-bit-per-pixel formats when using video cards with bank-switched memory?
Apr 20, 2026
Post comments count 0
Post likes count 2

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.

Forgotten message from the past: <CODE>LB_<WBR>INIT­STORAGE</CODE>
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.

What’s up with window message <CODE>0x0091</CODE>? We’re getting it with unexpected parameters
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.

Why is there a long delay between a thread exiting and the <CODE>Wait­For­Single­Object</CODE> returning?
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.

Why was there a red telephone at every receptionist desk?
Apr 14, 2026
Post comments count 2
Post likes count 3

Why was there a red telephone at every receptionist desk?

Raymond Chen

Not a direct line to Bill Gates's office.

Finding a duplicated item in an array of <VAR>N</VAR> integers in the range 1 to <VAR>N</VAR> − 1
Apr 13, 2026
Post comments count 8
Post likes count 1

Finding a duplicated item in an array of N integers in the range 1 to N − 1

Raymond Chen

Taking advantage of special characteristics of the array.

How do you add or remove a handle from an active <CODE>Wait­For­Multiple­Objects</CODE>?, part 2
Apr 10, 2026
Post comments count 3
Post likes count 2

How do you add or remove a handle from an active Wait­For­Multiple­Objects?, part 2

Raymond Chen

Waiting for the waiting thread to acknowledge the change.

How do you add or remove a handle from an active <CODE>Wait­For­Multiple­Objects</CODE>?
Apr 9, 2026
Post comments count 4
Post likes count 2

How do you add or remove a handle from an active Wait­For­Multiple­Objects?

Raymond Chen

You can't, but you can cooperate with the other thread.

How do you add or remove a handle from an active <CODE>Msg­Wait­For­Multiple­Objects</CODE>?
Apr 8, 2026
Post comments count 4
Post likes count 2

How do you add or remove a handle from an active Msg­Wait­For­Multiple­Objects?

Raymond Chen

You can't, but you can arrange for the waiter to do it for you.