❌

Normal view

Received today β€” 16 December 2025

Closures as Win32 window procedures

16 December 2025 at 10:27

Back in 2017 I wrote about a technique for creating closures in C using JIT-compiled wrapper. It’s neat, though rarely necessary in real programs, so I don’t think about it often. I applied it to qsort, which sadly accepts no context pointer. More practical would be working around insufficient custom allocator interfaces, to create allocation functions at run-time bound to a particular allocation region. I’ve learned a lot since I last wrote about this subject, and a recent article had me thinking about it again, and how I could do better than before. In this article I will enhance Win32 window procedure callbacks with a fifth argument, allowing us to more directly pass extra context. I’m using w64devkit on x64, but the everything here should work out-of-the-box with any x64 toolchain that speaks GNU assembly.

↫ Chris Wellons

Sometimes, people get upset when I mention something is out of my wheelhouse, so just for those people, here’s an article well outside of my wheelhouse. I choose honesty over faking confidence.

Received before yesterday

DXGI debugging: Microsoft put me on a list

23 September 2025 at 01:51

Why does Space Station 14 crash with ANGLE on ARM64? 6 hours later…

So. I’ve been continuing work on getting ARM64 builds out for Space Station 14. The thing I was working on yesterday were launcher builds, specifically aΒ singleΒ download that supports both ARM64 and x64. I’d already gotten the game client itself running natively on ARM64, and it worked perfectly fine in my dev environment. I wrote all the new launcher code, am pretty sure I got it right. Zip it up, test it on ARM64, aaand…

The game client crashes on Windows ARM64. Both in my VM and on Julian’s real Snapdragon X laptop.

↫ PJB at A stream of consciousness

Debugging stories can be great fun to read, and this one is a prime example. Trust me, you’ll have no idea what the hell is going on here until you reach the very end, and it’s absolutely wild. Very few people are ever going to run into this exact same set of highly unlikely circumstances, but of course, with a platform as popular as Windows, someone was eventually bound to.

Sidenote: the game in question looks quite interesting.

❌