The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

How to support a COM interface conditionally in C++/WinRT
Oct 26, 2023
Post comments count 0
Post likes count 2

How to support a COM interface conditionally in C++/WinRT

Raymond Chen
Raymond Chen

Prevent winrt::implements from responding to it or reporting it.

The format of icon resources, revisited
Oct 25, 2023
Post comments count 5
Post likes count 5

The format of icon resources, revisited

Raymond Chen
Raymond Chen

Filling in some gaps.

Why is there a hash of a weak password in the Windows cryptographic libraries?
Oct 24, 2023
Post comments count 2
Post likes count 3

Why is there a hash of a weak password in the Windows cryptographic libraries?

Raymond Chen
Raymond Chen

They're part of an internal self-test.

How do I add a non-copyable, non-movable object to a <CODE>std::map</CODE> or <CODE>std::unordered_map</CODE>?
Oct 23, 2023
Post comments count 2
Post likes count 3

How do I add a non-copyable, non-movable object to a std::map or std::unordered_map?

Raymond Chen
Raymond Chen

Fancy emplacement.

On the failed unrealized promise of <CODE>Reg­Override­Predef­Key</CODE>
Oct 20, 2023
Post comments count 0
Post likes count 0

On the failed unrealized promise of Reg­Override­Predef­Key

Raymond Chen
Raymond Chen

An early attempt to sandbox the registry for a process.

What’s the difference between setting a page’s protection to <CODE>PAGE_NOACCESS</CODE> and freeing it?
Oct 19, 2023
Post comments count 3
Post likes count 1

What’s the difference between setting a page’s protection to PAGE_NOACCESS and freeing it?

Raymond Chen
Raymond Chen

Nobody can access it, but it's still there.

How can I check if I’m on a DispatcherQueue’s thread if I can’t call HasThreadAccess?
Oct 18, 2023
Post comments count 3
Post likes count 2

How can I check if I’m on a DispatcherQueue’s thread if I can’t call HasThreadAccess?

Raymond Chen
Raymond Chen

Looking at the tools you have available.

Microspeak: The As-Appropriate (AA) interviewer
Oct 17, 2023
Post comments count 5
Post likes count 1

Microspeak: The As-Appropriate (AA) interviewer

Raymond Chen
Raymond Chen

So, how are things going so far?

API design principle: Reading a property or adding an event handler should not alter observable behavior
Oct 16, 2023
Post comments count 9
Post likes count 2

API design principle: Reading a property or adding an event handler should not alter observable behavior

Raymond Chen
Raymond Chen

Don't punish people for looking.