The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

If a parameter isn’t used, what should I pass?
Feb 29, 2024
Post comments count 7
Post likes count 4

If a parameter isn’t used, what should I pass?

Raymond Chen
Raymond Chen

It doesn't matter what you pass, but if you have to ask, then just pass zero.

On the whole idea of giving away a reference to yourself at destruction
Feb 28, 2024
Post comments count 16
Post likes count 1

On the whole idea of giving away a reference to yourself at destruction

Raymond Chen
Raymond Chen

Hey, at least it's possible.

Mitigating attacks based on knowing the length of a Windows Hello PIN
Feb 27, 2024
Post comments count 15
Post likes count 1

Mitigating attacks based on knowing the length of a Windows Hello PIN

Raymond Chen
Raymond Chen

Balancing convenience against security, and how you can tune the knobs toward more security.

A C# LINQ one-liner to check if exactly one of a set of conditions is met
Feb 26, 2024
Post comments count 21
Post likes count 1

A C# LINQ one-liner to check if exactly one of a set of conditions is met

Raymond Chen
Raymond Chen

Maybe not the most efficient, but it's easy to write.

Gotcha: Be careful how you shut down your dispatcher queues
Feb 23, 2024
Post comments count 4
Post likes count 3

Gotcha: Be careful how you shut down your dispatcher queues

Raymond Chen
Raymond Chen

The dispatcher queue thread isn't useful after it has shut down, so don't try anything.

Gotcha: Don’t forget to shut down your dispatcher queues
Feb 22, 2024
Post comments count 1
Post likes count 0

Gotcha: Don’t forget to shut down your dispatcher queues

Raymond Chen
Raymond Chen

Keep that dispatcher queue controller around, or you'll never be able to clean up.

Once your object reaches <CODE>final_release</CODE>, you are committed to destructing it (eventually)
Feb 21, 2024
Post comments count 1
Post likes count 0

Once your object reaches final_release, you are committed to destructing it (eventually)

Raymond Chen
Raymond Chen

Don't try to resurrect it.

Microspeak: Closing out, duping out
Feb 20, 2024
Post comments count 3
Post likes count 0

Microspeak: Closing out, duping out

Raymond Chen
Raymond Chen

Making work items no longer appear on a query.

Why can’t I trigger a manual blue screen crash by injecting the magic key sequence?
Feb 19, 2024
Post comments count 9
Post likes count 4

Why can’t I trigger a manual blue screen crash by injecting the magic key sequence?

Raymond Chen
Raymond Chen

It has to come from the physical keyboard, because that's the code that detects the magic key sequence.