The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Why does inadvertently passing a <CODE>std::string</CODE> instead of a <CODE>char const*</CODE> to a variadic function crash on x86-32 but not x86-64?
Jan 10, 2025
1
0

Why does inadvertently passing a std::string instead of a char const* to a variadic function crash on x86-32 but not x86-64?

Raymond Chen
Raymond Chen

Looking at the calling convention and the small string optimization.

Inside STL: Waiting for a <CODE>std::atomic<std::shared_ptr<T>></CODE> to change, part 2
Jan 9, 2025
0
3

Inside STL: Waiting for a std::atomic<std::shared_ptr<T>> to change, part 2

Raymond Chen
Raymond Chen

Digging into the libstdc++ implementation.

Inside STL: Waiting for a <CODE>std::atomic<std::shared_ptr<T>></CODE> to change, part 1
Jan 8, 2025
1
1

Inside STL: Waiting for a std::atomic<std::shared_ptr<T>> to change, part 1

Raymond Chen
Raymond Chen

Waiting on a single pointer, but checking for two.

Emergency power resets on Lenovo, HP, Dell, and Acer laptops
Jan 7, 2025
5
3

Emergency power resets on Lenovo, HP, Dell, and Acer laptops

Raymond Chen
Raymond Chen

Looking for the magic button.

How can I tell whether a change to a control was due to the user or due to my program?
Jan 6, 2025
5
0

How can I tell whether a change to a control was due to the user or due to my program?

Raymond Chen
Raymond Chen

You know when it was done by your program because you did it.

Forcing an <CODE>ERROR_<WBR>KEY_<WBR>DELETED</CODE> error when trying to open <CODE>HKEY_<WBR>CURRENT_<WBR>USER\<WBR>Software</CODE>
Jan 3, 2025
1
1

Forcing an ERROR_KEY_DELETED error when trying to open HKEY_CURRENT_USER\Software

Raymond Chen
Raymond Chen

Just an exercise to show that it can be done, even though it's highly unlikely to occur in practice.

Could I be getting <CODE>ERROR_<WBR>KEY_<WBR>DELETED</CODE> for <CODE>HKEY_<WBR>CURRENT_<WBR>USER\<WBR>Software</CODE> when the user logs off?
Jan 2, 2025
1
0

Could I be getting ERROR_KEY_DELETED for HKEY_CURRENT_USER\Software when the user logs off?

Raymond Chen
Raymond Chen

Probably not, but there are some edge cases.

How is it possible to get <CODE>ERROR_<WBR>KEY_<WBR>DELETED</CODE> when I’m <I>creating</I> a key?
Jan 1, 2025
1
0

How is it possible to get ERROR_KEY_DELETED when I’m creating a key?

Raymond Chen
Raymond Chen

The key that got deleted is not the one you are trying to create.