The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Why am I being told about a signed/unsigned comparison, and why only sometimes, and how can I fix it?
Jun 19, 2023
Post comments count 6
Post likes count 1

Why am I being told about a signed/unsigned comparison, and why only sometimes, and how can I fix it?

Raymond Chen
Raymond Chen

How the compiler back-end can influence warnings.

The case of the invalid handle despite being managed by an RAII type, part 2
Jun 16, 2023
Post comments count 0
Post likes count 1

The case of the invalid handle despite being managed by an RAII type, part 2

Raymond Chen
Raymond Chen

Avoiding using an object after is has destructed, and maybe using a less-well-known corner of the C++ language.

The case of the invalid handle despite being managed by an RAII type
Jun 15, 2023
Post comments count 0
Post likes count 1

The case of the invalid handle despite being managed by an RAII type

Raymond Chen
Raymond Chen

The handle remains valid for the object's lifetime, but what is the object's lifetime?

How expensive is it to create a Windows performance counter?
Jun 14, 2023
Post comments count 3
Post likes count 0

How expensive is it to create a Windows performance counter?

Raymond Chen
Raymond Chen

The cost depends on the performance counter.

SIDs are really just another a fancy way of creating unique IDs in a decentralized way
Jun 13, 2023
Post comments count 2
Post likes count 1

SIDs are really just another a fancy way of creating unique IDs in a decentralized way

Raymond Chen
Raymond Chen

Keeping them from colliding with each other.

The move constructor that you have to declare, even though you don’t want anyone to actually call it
Jun 12, 2023
Post comments count 4
Post likes count 1

The move constructor that you have to declare, even though you don’t want anyone to actually call it

Raymond Chen
Raymond Chen

Forcing named return value optimization.

Reordering C++ template type parameters for usability purposes, and type deduction from the future
Jun 9, 2023
Post comments count 4
Post likes count 1

Reordering C++ template type parameters for usability purposes, and type deduction from the future

Raymond Chen
Raymond Chen

You want them to go first, but you also want to deduce them.

How can I register a program to auto-relaunch if it crashes or is terminated?, redux
Jun 8, 2023
Post comments count 8
Post likes count 1

How can I register a program to auto-relaunch if it crashes or is terminated?, redux

Raymond Chen
Raymond Chen

You can get a little bit of the way there.

Pulling sleight of hand tricks in a security vulnerability report, episode 2
Jun 7, 2023
Post comments count 11
Post likes count 0

Pulling sleight of hand tricks in a security vulnerability report, episode 2

Raymond Chen
Raymond Chen

I see what you did there.