The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Nice job, you got an A minus from Bill
Feb 24, 2015
Post comments count 0
Post likes count 0

Nice job, you got an A minus from Bill

Raymond Chen
Raymond Chen

That's as high as it goes.

Further adventures in trying to guess what encoding a file is in
Feb 23, 2015
Post comments count 0
Post likes count 0

Further adventures in trying to guess what encoding a file is in

Raymond Chen
Raymond Chen

Today's candidate: IMultiLanguage2::DetectCodepageInIStream

Non-capturing C++ lambdas can be converted to a pointer to function, but what about the calling convention?
Feb 20, 2015
Post comments count 0
Post likes count 0

Non-capturing C++ lambdas can be converted to a pointer to function, but what about the calling convention?

Raymond Chen
Raymond Chen

Nothing to see, so nothing to pass.

What's the point of using a custom timer queue if there is a default one already?
Feb 19, 2015
Post comments count 0
Post likes count 0

What's the point of using a custom timer queue if there is a default one already?

Raymond Chen
Raymond Chen

A customer observed that when you create a timer via , you have the option of passing either to get the default timer queue or a handle to a custom timer queue created by the function. Why would you want to create a custom timer queue? If you create a custom timer queue, then you know that all the timers in the queue are yours. For example, there might be another component in the process that creates a lot of timers in the default timer queue. If you had put your timers in the default timer queue, then your timers will risk starvation. It's the same sort of logic that might lead you to create a custom heap in...

When asking about the capacity of a program, you also need to consider what happens when you decide to stop using the program
Feb 18, 2015
Post comments count 0
Post likes count 0

When asking about the capacity of a program, you also need to consider what happens when you decide to stop using the program

Raymond Chen
Raymond Chen

It'll fit as long as you need it.

Microspeak: Light up
Feb 17, 2015
Post comments count 0
Post likes count 0

Microspeak: Light up

Raymond Chen
Raymond Chen

Enabling functionality when available.

The 2015/2016 Seattle Symphony subscription season at a glance
Feb 16, 2015
Post comments count 0
Post likes count 0

The 2015/2016 Seattle Symphony subscription season at a glance

Raymond Chen
Raymond Chen

The pocket reference guide for 2015/2016.

Reading the word under the cursor via UI Automation
Feb 16, 2015
Post comments count 0
Post likes count 1

Reading the word under the cursor via UI Automation

Raymond Chen
Raymond Chen

Grab and go.

What is this inconsistent heap state that MSDN warns me about during DLL_PROCESS_DETACH?
Feb 13, 2015
Post comments count 0
Post likes count 0

What is this inconsistent heap state that MSDN warns me about during DLL_PROCESS_DETACH?

Raymond Chen
Raymond Chen

Following through on consequences of TerminateThread.