The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Making sure the Microsoft Visual C++ compiler chooses the right source encoding
Dec 31, 2024
Post comments count 4
Post likes count 4

Making sure the Microsoft Visual C++ compiler chooses the right source encoding

Raymond Chen
Raymond Chen

Making sure the file and settings are set correctly.

How various git diff viewers represent file encoding changes in pull requests
Dec 30, 2024
Post comments count 4
Post likes count 3

How various git diff viewers represent file encoding changes in pull requests

Raymond Chen
Raymond Chen

The invisible UTF-8 BOM, and sometimes invisible encoding changes.

In C++, failure to meet the requirements does not always mean that you fail if you don’t meet the requirements
Dec 27, 2024
Post comments count 4
Post likes count 2

In C++, failure to meet the requirements does not always mean that you fail if you don’t meet the requirements

Raymond Chen
Raymond Chen

Combining SFINAE/requires, standard layout, and overload resolution.

Why are Win32 resources strings bundled at all? And why bundles of 16?
Dec 26, 2024
Post comments count 8
Post likes count 3

Why are Win32 resources strings bundled at all? And why bundles of 16?

Raymond Chen
Raymond Chen

Balancing multiple performance factors.

How can I check if two GUIDs are equal when they are provided as strings?
Dec 25, 2024
Post comments count 0
Post likes count 1

How can I check if two GUIDs are equal when they are provided as strings?

Raymond Chen
Raymond Chen

A customer asked if there was a helper function in the system that accepted two strings and reported whether the s they represent are equal. This is a tricky question, because you first have to decide what "represent" means. There are many ways of representing a as a string. It could be just 32 case-insensitive hexadecimal digits. Or maybe there are internal hyphens to separate the groups. And the whole thing might be enclosed in braces or parentheses. External and interior whitespace might be allowed. Trailing garbage might be accepted (and ignored). And then there's the special format {0x00000000,0x0000,0x00...

A design flaw in the Windows 3D Pipes screen saver pointed out by a customer
Dec 24, 2024
Post comments count 0
Post likes count 2

A design flaw in the Windows 3D Pipes screen saver pointed out by a customer

Raymond Chen
Raymond Chen

Time-wasting.

A common proposed solution to certain categories of IFNDR: Getting the linker to verify identical functions
Dec 23, 2024
Post comments count 5
Post likes count 2

A common proposed solution to certain categories of IFNDR: Getting the linker to verify identical functions

Raymond Chen
Raymond Chen

You could do it, but it could cramp your style.

How do I register a file type for a scripting language so that users get a warning when they run an untrusted script?
Dec 20, 2024
Post comments count 0
Post likes count 2

How do I register a file type for a scripting language so that users get a warning when they run an untrusted script?

Raymond Chen
Raymond Chen

Use the FTA_AlwaysUnsafe edit flag.

Inside STL: The atomic shared_ptr
Dec 19, 2024
Post comments count 7
Post likes count 4

Inside STL: The atomic shared_ptr

Raymond Chen
Raymond Chen

There's a lock hiding inside the pointer.