Fixing Returnal hanging at a black screen

I’ve been enjoying Returnal recently, but I’ve had a ton of technical issues with it. Half the time when starting the game, or performing certain actions, it would just hang at a black screen. Sometimes, the game would be still running and updating the system resource monitoring, but be completely unresponsive.

Turns out if you’re running Windows 10 LTSC, you lack the VP9 codec, which the cutscenes are in. The black screen is because it can’t play the cutscene properly. (Any bits about DX11/DX12 seem to be red herrings.) The VP9 codec is on the Windows Store, but since you don’t have that in LTSC, you can install it via other means. For example, this dump in the Internet Archive contains the codecs you’re looking for; install them, and after a reboot, things should work again.

Installing Photoshop CS2 on Windows 11

I was trying to install Photoshop CS2 on an ARM Windows 11 VM (this may affect x86 Windows 11 too), but was blocked by an error that went something like “Error 1926: Could not set file security for file C:\Windows\, Error 0”.

This is because the Windows installation directory has immutable permissions on Windows 11, but the Photoshop installer tried to reset file permissions on it anyways. (It’s quite possible other software might also be suffering from this too.) To fix it, we need to modify the MSI.

Continue reading

Baby’s First iSCSI with ZFS Setup

I recently got interested in trying out iSCSI, since I had spare capacity on my server. For those unaware, iSCSI can expose block devices over a network. Instead of a file system, it exposes a (virtual) disk, and lets the system connecting to it manage high-level details, including its own file system. This has very different trade-offs from file sharing like SMB/NFS; sharing the disk isn’t really possible, but you avoid a lot of the performance impact from (often different) file system semantics.

This makes it possible to do things you might otherwise not recommended with file sharing, like hosting a Steam library on it. Especially so if you have the iSCSI setup on its own network. Remember, most file systems assume a mostly direct connection to disk. Running this over a shared Ethernet connection, let alone WiFi might not be the best idea.

Also note that I’m not describing a secure setup here. This is very much “baby’s first”, and should only be done on a secure network, or as an experiment. Securing it will involve properly configuring things like portal groups, and isn’t covered in this article. I might cover it in a later article.

This also synthesizes a lot of information I found online; in particular, this basically digests some information in the FreeBSD handbook about the iSCSI target subsystem and ZFS volumes, plus Red Hat and Oracle documentation on iscsiadm.

Continue reading

Win32 is the stable Linux userland ABI (and the consequences)

This post was inspired by some controversy with Valve and their support for Linux, but the bulk of it comes from long-term observation. One of the biggest impacts with the viability of Linux on the desktop was Valve’s Proton, a Wine fork integrated in Steam allowing almost any Windows game to work out of the box. To Linux users, life was good. However, with the recent announcement of the Steam Deck, a handheld device powered by Linux, Valve’s marketing towards developers explicitly mention no porting required. Valve’s been aggressive with this message enough that they’ve allegedly told developers simply not to bother with Linux ports anymore; enough that it makes commercial porters like Ethan Lee concerned.

However, I suspect this is the long-term result of other factors, and games are only one aspect of it. After all, we all know the Year of the Linux Desktop is around the corner, along with nice applications. Linux won’t rule the world just from games, even if some people really want it to be true. How did it come to this, and why?

Continue reading

Quick and dirty subclassing in Win32

Context: So I wanted to implement drag and drop with files the quick and dirty way; specifically, WM_DROPFILES. (You can also do this with COM, but it’s a bit more involved, especially from raw C. I haven’t written about drag and drop yet, so the comparison is covered elsewhere for now.) My use case is simple, so I didn’t need the benefits or complexity of COM drag and drop. Turns out it’s just marking it as having the extended style in the resource editor or calling DragAcceptFiles, or so I thought. While I could get my dialog to accept the files, I couldn’t get the list view to do so. It turns out that the list view doesn’t handle these messages, nor does it send a notification back to the parent.

One strategy to deal with this is subclassing, although we aren’t going through the formal channels to do. That’s trickier, because it involves using things like CreateWindowEx, and might be a pain with dialog resources that already have a list view. Instead, we’ll actually replace the window procedure out from under the already materialized dialog control – basically monkey patching. In fact, Microsoft’s own documentation mentions this (and a better way with caveats). However, it doesn’t provide a concrete example. This article will quickly show you how, and provides an interesting, if brief example of Windows API principles.

Continue reading

Notes on the system image list

If you need the icons for files in a Windows program, the easiest way to do so is with the system image list. This is an image list (a resource containing icons, mapped by index) that caches those system icons. The advantage of being an image list is you can easily associate it with a control (like a ListView) and pick out the images by their index, or draw out of it.

Continue reading

UTF-8 conversion issues on legacy Windows

Short post: On Windows, UTF-16 was the dominant locale, and UTF-8 was something only to convert to and from. (Microsoft jumped the gun before Unicode expanded the address space.) While it got better (Windows 10 can use UTF-8 as an MBCS locale with ANSI APIs), it was historically a lot worse.

For converting, you’d use the MultiByteToWideChar and its opposite WideCharToMultiByte. On legacy Windows, they have slightly confusing semantics. Specifically, with flags. While Vista on introduced many flags that can be used with the UTF-8 codepage (to deal with the quirks of conversion, like invalid characters), previously only MB_ERR_INVALID_CHARS was allowed, and only if you were running XP or 2000 SP4. Before that, you can’t have any flags if you’re converting to or from UTF-16 and UTF-8. It’s unfortunately a little dangerous, but that’s the rub.

Couldn’t create window class error with a simple dialog-based Win32 application

I had a simple Win32 application fail to create its window (in my case, a dialog box, using either CreateDialog or DialogBox). I got back the error 0x583; unable to create window class. If I forced the window style on my dialog to create regardless of errors, my dialog was empty.

It turns out I was using themed controls in my manifest, but I didn’t call InitCommonControls. After that, my application worked.

ARM64 programs built with Visual Studio crash with 0xC000007B

It’s because Visual Studio seems to copy an x86 version of the VC++ runtime into system32 on ARM64 systems. That’ll make it crash with a bad image format error. If you copy the ARM64 version of vcruntime140.dll (for me, found in C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.28.29325\arm64\Microsoft.VC142.CRT) into the build directory, binaries will work.