The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Mar 24, 2025
Post comments count 11
Post likes count 2

On how different Windows ABIs choose how to pass 32-bit values in 64-bit registers

Raymond Chen

Surveying the options and looking for commonalities.

Mar 21, 2025
Post comments count 11
Post likes count 4

The case of the critical section that let multiple threads enter a block of code

Raymond Chen

It had one job.

Mar 20, 2025
Post comments count 4
Post likes count 1

What could cause a memory corruption bug to disappear in safe mode?

Raymond Chen

A simplified execution environment means fewer things that you can stumble over.

Mar 19, 2025
Post comments count 9
Post likes count 7

You can’t simulate keyboard input with PostMessage, revisited

Raymond Chen

If it didn't go through the input system, it only looks like input as much as the app allows itself to be fooled.

Mar 18, 2025
Post comments count 7
Post likes count 7

Why didn’t Windows 95 setup use a miniature version of Windows 95 as its fallback GUI?

Raymond Chen

Avoiding an interim GUI environment.

Mar 17, 2025
Post comments count 3
Post likes count 3

Dubious security vulnerability: A program does not run correctly if you run it the wrong way

Raymond Chen

So what did you expect?

Mar 14, 2025
Post comments count 0
Post likes count 2

The case of COM failing to pump messages in a single-threaded COM apartment

Raymond Chen

A customer encountered a hang caused by COM not pumping messages while waiting for a cross-thread operation to complete. They were using the class for serializing asynchronous operations on a UI thread they created to handle accessibility callbacks. The hang stack looked like this: We see that we have a UI thread (notice the at the bottom of the stack), yet COM decided to block without pumping messages ( instead of (). Is this a bug in the task sequencer? Let's look at the stack more closely. A message arrived via , and that then queued a task into the task sequencer. The saw that the task sequencer had...

Mar 13, 2025
Post comments count 12
Post likes count 3

Making sure that a DLL loads only from your application directory

Raymond Chen

You can ask for it as an option, but think about what you're actually protecting against.

Mar 12, 2025
Post comments count 2
Post likes count 4

What are the thread safety requirements of HSTRING and BSTR?

Raymond Chen

They do not have thread affinity.