The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Smoothing over the differences (and defects) in the various implementations of <CODE>IMemory­Buffer</CODE>
Jan 30, 2024
Post comments count 1
Post likes count 0

Smoothing over the differences (and defects) in the various implementations of IMemory­Buffer

Raymond Chen
Raymond Chen

Stick to the part that nobody messes up.

A comparison of various implementations of the Windows Runtime <CODE>IMemory­Buffer</CODE>
Jan 29, 2024
Post comments count 0
Post likes count 1

A comparison of various implementations of the Windows Runtime IMemory­Buffer

Raymond Chen
Raymond Chen

Every unhappy class is unhappy in its own way.

How can I expose a pre-existing block of memory as a Windows Runtime object without copying the data?
Jan 26, 2024
Post comments count 0
Post likes count 1

How can I expose a pre-existing block of memory as a Windows Runtime object without copying the data?

Raymond Chen
Raymond Chen

Assembling all the pieces.

How can I give away a COM reference just before my object destructs?
Jan 25, 2024
Post comments count 8
Post likes count 0

How can I give away a COM reference just before my object destructs?

Raymond Chen
Raymond Chen

You have to do it before committing to destruction.

The dangerous implementations of the <CODE>IMemory­Buffer­Reference.Closed</CODE> event
Jan 24, 2024
Post comments count 2
Post likes count 1

The dangerous implementations of the IMemory­Buffer­Reference.Closed event

Raymond Chen
Raymond Chen

Mistakenly handing out COM references that don't work.

The useless <CODE>IMemory­Buffer­Reference.Closed</CODE> event
Jan 23, 2024
Post comments count 1
Post likes count 1

The useless IMemory­Buffer­Reference.Closed event

Raymond Chen
Raymond Chen

It tells you that you have already lost.

Accessing a block of memory represented by a Windows Runtime IMemoryBuffer
Jan 22, 2024
Post comments count 0
Post likes count 2

Accessing a block of memory represented by a Windows Runtime IMemoryBuffer

Raymond Chen
Raymond Chen

Through the currency known as an IMemoryBufferReference.

The case of the fail-fast trying to log a caught exception
Jan 19, 2024
Post comments count 2
Post likes count 0

The case of the fail-fast trying to log a caught exception

Raymond Chen
Raymond Chen

What is being thrown and why can't we log it?

Implementing two-phase initialization with ATL
Jan 18, 2024
Post comments count 0
Post likes count 1

Implementing two-phase initialization with ATL

Raymond Chen
Raymond Chen

ATL looks like it supports two-phase initialization, but it doesn't.