The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Jan 17, 2019
Post comments count 0
Post likes count 1

How do I get the effect of C#’s async void in a C++ coroutine? Part 2: Keeping track of the lifetimes

Raymond Chen

There are two types of lambdas you have to write, so why not write two lambdas?

Jan 16, 2019
Post comments count 0
Post likes count 3

How do I get the effect of C#’s async void in a C++ coroutine? Part 1: Why does the obvious solution crash?

Raymond Chen

Wrap it up, but watch out how you do it.

Jan 15, 2019
Post comments count 0
Post likes count 1

Don’t pass lambdas (or other multi-line entities) as parameters to macros

Raymond Chen

It makes debugging much more difficult.

Jan 14, 2019
Post comments count 0
Post likes count 1

Why would the incremental linker insert padding between section fragments?

Raymond Chen

So it can be incremental more easily.

Jan 11, 2019
Post comments count 0
Post likes count 3

Why do we even need to define a red zone? Can’t I just use my stack for anything?

Raymond Chen

I mean, it's my stack, isn't it?

Jan 10, 2019
Post comments count 0
Post likes count 1

Why am I getting mojibake when I try to create a window?

Raymond Chen

Look for the character set mismatch.

Jan 9, 2019
Post comments count 0
Post likes count 1

It rather involved being on the other side of this airtight hatchway: Messing with somebody’s registry

Raymond Chen

Getting to the other side is left as an exercise.

Jan 8, 2019
Post comments count 0
Post likes count 3

STATUS_STACK_BUFFER_OVERRUN doesn’t mean that there was a stack buffer overrun

Raymond Chen

It used to mean that, but now it can mean other things, too.

Jan 7, 2019
Post comments count 0
Post likes count 1

The GetRegionData function fails if the buffer is allocated on the stack. Is it allergic to stack memory or something?

Raymond Chen

One of the lesser-known ground rules.