RSS.Social

The Old New Thing

follow: @[email protected]

Posts

A compatibility note on the abuse of Windows window class extra bytes

The evolution of window and class extra bytes in Windows

The case of the DLL that was not present in memory despite not being formally unloaded, part 2

Raymond’s hot take on Hainanese chicken

The case of the DLL that was not present in memory despite not being formally unloaded, part 1

Cancellation of Windows Runtime activities is asynchronous

Microspeak elaborated: Isn’t escrow just a release candidate by another name?

In memory of the man who put red and green squiggles under words

What does it mean when the bottom bit of my HMODULE is set?

Why doesn’t Get­Last­Input­Info() return info for the user I’m impersonating?

Windows stack limit checking retrospective, follow-up

Retrofitting the WM_COPY­DATA message onto Windows 3.1

The time the x86 emulator team found code so bad that they fixed it during emulation

How can I schedule work on a thread pool with low latency?

Understanding the rationale behind a rule when trying to circumvent it

What’s the opposite of Clip­Cursor that lets me exclude the cursor from a region?

The Microsoft Company Party where everybody played name tag swap

Rotation revisited: Shuffling more than three blocks, and other small notes

The back cover of C++: The Programming Language also raises questions not answered by the front cover

Rotation revisited: Avoiding having to calculate the gcd when doing cycle decomposition

Rotation revisited: Cycle decomposition in clang’s libcxx

Rotation revisited: A shocking discovery about gcc’s unidirectional rotation algorithm

Rotation revisited: Another unidirectional algorithm

The placeholder name for the Windows 8 experience was “modern”

Sharing the result of a single Windows Runtime IAsyncOperation among multiple coroutines, part 3

Sharing the result of a single Windows Runtime IAsyncOperation among multiple coroutines, part 2

Sharing the result of a single Windows Runtime IAsyncOperation among multiple coroutines, part 1

If C# and JavaScript lets me await a Windows Runtime asynchronous operation more than once, why not C++/WinRT?

A hypothetical redesign of System.Diagnostics.Process to avoid confusion over properties that are valid only when you are the one who called Start

Why do you say that a COM STA thread must pump messages if I see sample code creating STA threads and not pumping messages?

How do I use Win32 structures from the Windows Runtime?

The classic TreeView control lets me sort by name or by lParam, but why not both?

What is the history of the ERROR_ARENA_TRASHED error code?

Just shows that nobody cares about debugging the parity flag any more

The case of the Create­File­Mapping that always reported ERROR_ALREADY_EXISTS

A constant-space linear-time algorithm for deleting all but the 10 most recent files in a directory

The case of the hang when the user changed keyboard layouts

Why do Windows client editions on 32-bit x86 systems artificially limit RAM to 4 GB?

Additional notes on controlling which handles are inherited by Create­Process

Developing more confidence when tracking renames via Read­Directory­ChangesW

When you upgrade your resource strings to Unicode, don’t forget to specify the L prefix

Why not have changes in API behavior depend on the SDK you link against?

A dispute over the TAB key highlights a mismatch between Microsoft and IBM organizational structures

How do I inform Windows that I’m writing a binary file?

Developing a cross-process reader/writer lock with limited readers, part 4: Abandonment

Developing a cross-process reader/writer lock with limited readers, part 3: Fairness

Developing a cross-process reader/writer lock with limited readers, part 2: Taking turns when being grabby

Developing a cross-process reader/writer lock with limited readers, part 1: A semaphore

Looking at consequences of passing too few register parameters to a C function on various architectures

Defending against exceptions in a scope_exit RAII type

Another crash caused by uninstaller code injection into Explorer

Mapping the page tables into memory via the page tables

Sure, xor’ing a register with itself is the idiom for zeroing it out, but why not sub?

How did code handle 24-bit-per-pixel formats when using video cards with bank-switched memory?

Forgotten message from the past: LB_INIT­STORAGE

What’s up with window message 0x0091? We’re getting it with unexpected parameters

Why is there a long delay between a thread exiting and the Wait­For­Single­Object returning?

Why was there a red telephone at every receptionist desk?

Finding a duplicated item in an array of N integers in the range 1 to N − 1

How do you add or remove a handle from an active Wait­For­Multiple­Objects?, part 2

How do you add or remove a handle from an active Wait­For­Multiple­Objects?

How do you add or remove a handle from an active Msg­Wait­For­Multiple­Objects?

Were there any Windows 3.1 programs that were so incompatible with Windows 95 that there was no point trying to patch them?

Learning to read C++ compiler errors: Illegal use of -> when there is no -> in sight

How can I use Read­Directory­ChangesW to know when someone is copying a file out of the directory?

Why doesn’t the system let you declare your own messages to have the same semantics as WM_COPY­DATA?

The cover of C++: The Programming Language raises questions not answered by the cover

Before you check if an update caused your problem, check that it wasn’t a problem before the update

A question about the maximimum number of values in a registry key raises questions about the question

What if a dialog wants to intercept its own message loop?

Why doesn’t WM_ENTER­IDLE work if the dialog box is a Message­Box?

How can I change a dialog box’s message loop to do a Msg­Wait­For­Multiple­Objects instead of Get­Message?

Windows 95 defenses against installers that overwrite a file with an older version

How can I make sure the anti-malware software doesn’t terminate my custom service?

Windows stack limit checking retrospective: arm64, also known as AArch64

Windows stack limit checking retrospective: amd64, also known as x86-64

Windows stack limit checking retrospective: Alpha AXP

Windows stack limit checking retrospective: x86-32 also known as i386, second try

Windows stack limit checking retrospective: PowerPC

Windows stack limit checking retrospective: MIPS

Windows stack limit checking retrospective: x86-32, also known as i386

How do compilers ensure that large stack allocations do not skip over the guard page?

A snappy answer when asked about dressing casually at IBM

The fine print giveth and the bold print taketh away: The countdown timer

Learning to read C++ compiler errors: Ambiguous overloaded operator

When Read­Directory­ChangesW reports that a deletion occurred, how can I learn more about the deleted thing?

The mystery of the posted message that was dispatched before reaching the main message loop

Aha, I found a counterexample to the documentation that says that Query­Performance­Counter never fails

Just for fun: A survey of write protect notches on floppy disks and other media

What sort of horrible things happen if my dialog has a non-button with the control ID of IDCANCEL?

Intercepting messages inside Is­Dialog­Message, fine-tuning the message filter

Intercepting messages inside Is­Dialog­Message, installing the message filter

Intercepting messages before Is­Dialog­Message can process them

Customizing the ways the dialog manager dismisses itself: Isolating the Close pathway

Customizing the ways the dialog manager dismisses itself: Detecting the ESC key, second (failed) attempt

The 2026/2027 Seattle Symphony subscription season at a glance

Customizing the ways the dialog manager dismisses itself: Detecting the ESC key, first (failed) attempt

Exploring the signals the dialog manager uses for dismissing a dialog

Could Write­Process­Memory be made faster by avoiding the intermediate buffer?

Microspeak: Escrow

It rather involved being on the other side of the airtight hatchway: Tricking(?) a program into reading files

How can I distinguish between the numeric keypad 0 and the top-row 0 in the WM_CHAR message?

How can I distinguish between the numeric keypad 0 and the top-row 0 in the WM_KEY­DOWN message?

How do I suppress the hover effects when I put a Win32 common controls ListView in single-click mode?

How did Windows 95 get permission to put the Weezer video Buddy Holly on the CD?

What should I do if a wait call reports WAIT_ABANDONED?

How can I prevent the user from changing the widths of ListView columns in version 5 of the common controls?, part 2

How can I prevent the user from changing the widths of ListView columns in version 5 of the common controls?

Super Bowl LX creates an opportunity for symphonic friendly wagering

How can I prevent the user from changing the widths of ListView columns?

Some small stories about the giant satellite dish antenna that was behind Microsoft Building 11

Studying compiler error messages closely: Input file paths

Why not store the SAFEARRAY reference count as a hidden allocation next to the SAFEARRAY?

How can I retain access to the data in a SAFEARRAY after my method returns?

Why did I lose the data even though I called Safe­Array­Add­Ref?

A digression on the design and implementation of Safe­Array­Add­Ref and extending APIs in general

What’s the difference between Safe­Array­Access­Data and Safe­Array­Add­Ref?

C++ has scope_exit for running code at scope exit. C# says “We have scope_exit at home.”

A simple helper function for attaching a progress handler to a Windows Runtime IAsync­Action­With­Progress or IAsync­Operation­With­Progress

On the proper usage of a custom Win32 dialog class

Microspeak: On fire, putting out fires

What was the secret sauce that allows for a faster restart of Windows 95 if you hold the shift key?

How can I get the tab index number from a dialog box control?

When programs assume that the system will never change, episode 4: Stealing strings

Clipping the focus item when looking for its on-screen location, part 3

Clipping the focus item when looking for its on-screen location, part 2

Clipping the focus item when looking for its on-screen location

Using Active Accessibility to find out where the focus item is

Using Active Accessibility to find out where the Windows caret is

How can I find out where the Windows caret is?

Swapping two blocks of memory that reside inside a larger block, in constant memory, refinement

How can you swap two non-adjacent blocks of memory using only forward iterators?

How can you swap two adjacent blocks of memory using only forward iterators?

Swapping two blocks of memory that reside inside a larger block, in constant memory

2025 year-end link clearance

Understanding and mitigating a stack overflow in our task sequencer

Additional notes on color-keyed overlays as a way of doing smooth video rendering

The Gävle Goat (Gävleboken) succumbs in 2025 to a new menace

How can I detect that the system is running low on memory? Or that my job is running low on memory?

Why are we worried about memory access semantics? Full barriers should be enough for anybody

Reading the fine print, episode 4: Holiday promotions

Why is the last letter of my string not making it to the clipboard?

Why does my Ctrl+M accelerator key activate when I press the Enter key?

When irate product support customers demand to speak to Bill Gates

All the other cool languages have try…finally. C++ says “We have try…finally at home.”

A shortcut gives me a weird path for a program shortcut that doesn’t point to the executable, so what is it?

Concluding thoughts on our deep dive into Windows clipboard text conversion

Deducing the consequences of Windows clipboard text formats on UTF-8

Why is the Windows clipboard taking the scenic route when converting from CF_TEXT to CF_OEM­TEXT?

Misunderstanding what the Cricket Celebration Bowl is

The Windows clipboard automatic text conversion algorithm is path-dependent

Resolving an ambiguity in the Windows clipboard automated text conversion table

Studying the various locale mismatch scenarios in Windows clipboard text format synthesis

How does Windows synthesize the CF_LOCALE clipboard format?

How does Windows synthesize CF_UNICODE­TEXT from CF_TEXT and vice versa?

How does Windows synthesize CF_OEM­TEXT from CF_TEXT and vice versa?

How can my process read its own standard output?

How can I read the standard output of an already-running process?

How do I check whether the user has permission to create files in a directory?

Microspeak: Big rocks

How do I get my edit control text to be autoselected when I choose it to be the default focus in my dialog?

How can I have a Win32 drop-down combo box with a read-only edit control?

Message-only windows are for messaging, not as a convenient victim for hosting UI

At what point in the Windows development cycle is it too late to change the text of a translatable string?

The apocryphal origins of the Hot Dog Stand color scheme

Why does XAML break down when I have an element that is half a billion pixels tall?

Maybe somebody can explain to me how weak references solve the ODR problem

In the commit-on-demand pattern, what happens if an access violation straddles multiple pages?

Is Write­Process­Memory faster than shared memory for transferring data between two processes?

Microspeak: Little-r

How can I detect that Windows is running in S-Mode, redux

I can use WM_COPYDATA to send a block of data to another window, but how does it send data back?

Could we use CTAD to simplify the use of WRL’s Callback function?

Non-recursively deleting a binary tree in constant space: Rotating the tree

Behind the scenes on how Windows 95 application compatibility patched broken programs

How did Windows 3.1 distinguish two different programs that happened to share the same executable name?

Non-recursively deleting a binary tree in constant space: Restructuring the tree

Non-recursively deleting a binary tree in constant space: Synthesizing the parent pointer

Non-recursively deleting a binary tree in constant space: Traversal with parent pointers

The Microsoft SoftCard for the Apple II: Getting two processors to share the same memory

Why does SHFormat­Date­Time take an unaligned FILETIME?

Microspeak: turn into a pumpkin

Trying to build a XAML tree in code throws a “No installed components were detected” exception

What to do when you have a crash in the runtime control flow guard check

How did the Windows 95 user interface code get brought to the Windows NT code base?

Dubious security vulnerability: Denial of service by loading a very large file

The early history of the Windows Runtime PropertyValue and why there is a PropertyType.Inspectable that is never used

Windows Runtime design principle: Properties can be set in any order

What makes cheap_steady_clock faster than std::chrono::high_resolution_clock?

Microspeak: The hockey stick on wheels

What about the icons in pifmgr.dll?

Using RAII to remedy a defect where not all code paths performed required exit actions, follow-up

Using RAII to remedy a defect where not all code paths performed required exit actions

Why can you increment a reference count with relaxed semantics, but you have to decrement with release semantics?

I remember taking a screen shot of a video, and when I opened it in Paint, the video was playing in it! What witchcraft is this?

API design principle: Don’t tempt people to divide by zero

The self-assignment principle for Windows Runtime properties: Don’t change behavior based on whether a property has been written to

The self-assignment principle for Windows Runtime properties applies to default values

Windows Runtime API design principles around read-write properties: Idempotence and self-assignment

Remembering the end of support for VRML in Internet Explorer

Code comments should apply to the state of the system at the point the comment “executes”

Can we get weak functions for static linking? The Visual C++ compiler says “We have weak functions at home”

The problem with inferring from a function call operator is that there may be more than one

How do I convert a FILETIME to a C++ clock like std::system_clock or winrt::clock?

Microspeak: Convicted

How can I enumerate the overflow icons in the Notification Area without showing them?

Why didn’t Windows 95 setup install a miniature Windows 95 so that it could be written as a 32-bit program?

Samples note: Use comments to describe what code does, not what you wish the code would do

Why is Windows still tinkering with critical sections?

Another lesson learned from the Windows 98 on-stage USB blue screen

Why was Windows 3.0’s WinHelp called an online help system when it ran offline?