The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

How does the linker decide whether to call <CODE>WinMain</CODE> or <CODE>wWinMain</CODE>?
Oct 4, 2024
Post comments count 0
Post likes count 2

How does the linker decide whether to call WinMain or wWinMain?

Raymond Chen
Raymond Chen

If you don't tell it, it will try to figure it out.

How can I detect whether the user is running as an elevated administrator (as opposed to a natural administrator)?
Oct 3, 2024
Post comments count 8
Post likes count 5

How can I detect whether the user is running as an elevated administrator (as opposed to a natural administrator)?

Raymond Chen
Raymond Chen

You can ask for the elevation type.

A function for creating an absolute security descriptor from a self-relative one
Oct 2, 2024
Post comments count 0
Post likes count 2

A function for creating an absolute security descriptor from a self-relative one

Raymond Chen
Raymond Chen

Just wrap it up.

Misunderstanding the “Prevent access to registry editing tools” policy
Oct 1, 2024
Post comments count 5
Post likes count 4

Misunderstanding the “Prevent access to registry editing tools” policy

Raymond Chen
Raymond Chen

It prevents access to the tools, but not to the registry itself.

Pulling a single item from a C++ parameter pack by its index, remarks
Sep 30, 2024
Post comments count 3
Post likes count 0

Pulling a single item from a C++ parameter pack by its index, remarks

Raymond Chen
Raymond Chen

Why such a complicated way to pull the type from the pack?

The case of the crash when destructing a <CODE>std::map</CODE>
Sep 27, 2024
Post comments count 3
Post likes count 5

The case of the crash when destructing a std::map

Raymond Chen
Raymond Chen

Who is corrupting the map?

If you’re going to specify the <CODE>LVS_SORTASCENDING</CODE> or <CODE>LVS_SORTDESCENDING</CODE> style, you had better be telling the truth
Sep 26, 2024
Post comments count 3
Post likes count 2

If you’re going to specify the LVS_SORTASCENDING or LVS_SORTDESCENDING style, you had better be telling the truth

Raymond Chen
Raymond Chen

Because the listview control uses it to optimize searching.

Another example of the Windows Runtime interop pattern: Using the UserConsentVerifier from a Win32 program
Sep 25, 2024
Post comments count 1
Post likes count 2

Another example of the Windows Runtime interop pattern: Using the UserConsentVerifier from a Win32 program

Raymond Chen
Raymond Chen

Following the standard pattern.

The UserConsentVerifier confirms that the user is there, but it doesn’t protect any data
Sep 24, 2024
Post comments count 3
Post likes count 1

The UserConsentVerifier confirms that the user is there, but it doesn’t protect any data

Raymond Chen
Raymond Chen

Is that really you?