[PR #10582] [MERGED] Delay load call SetThreadDescription to restore WPF renderer on Win7 #28115

Open
opened 2026-01-31 09:26:27 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/10582
Author: @miniksa
Created: 7/8/2021
Status: Merged
Merged: 7/8/2021
Merged by: @undefined

Base: mainHead: dev/miniksa/fix_dx_win7


📝 Commits (1)

  • 4203852 delay call SetThreadDescription to restore WPF renderer on Win7

📊 Changes

1 file changed (+8 additions, -1 deletions)

View changed files

📝 src/renderer/base/thread.cpp (+8 -1)

📄 Description

Delay load call SetThreadDescription to restore WPF renderer on Win7

PR Checklist

  • Closes something @DHowett asked me to do.
  • I work here
  • I F5'd it on a version with this function and it still works

Detailed Description of the Pull Request / Additional comments

I keep forgetting that anything in the WPF control needs to keep working on Win7. Or more specifically... I remember this fact for the DX renderer, but not for the render thread base. Oops. Turns out this particular convenience method to set thread descriptions for visibility inside the debugger (to make my life easier) only works down to 1607 (see https://docs.microsoft.com/windows/win32/api/processthreadsapi/nf-processthreadsapi-setthreaddescription). Since it's just a debugging convenience... skipping it entirely when the procedure is not found should be fine. Also I don't try to load kernel32.dll and just get the handle of the existing module (which per the remarks at https://docs.microsoft.com/windows/win32/api/libloaderapi/nf-libloaderapi-getmodulehandlew will not increment the module reference count) because kernel32.dll pretty much has to be there or we're already in hot water.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/10582 **Author:** [@miniksa](https://github.com/miniksa) **Created:** 7/8/2021 **Status:** ✅ Merged **Merged:** 7/8/2021 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/miniksa/fix_dx_win7` --- ### 📝 Commits (1) - [`4203852`](https://github.com/microsoft/terminal/commit/42038529ab3bcf8bba861745450856902a9df840) delay call SetThreadDescription to restore WPF renderer on Win7 ### 📊 Changes **1 file changed** (+8 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/renderer/base/thread.cpp` (+8 -1) </details> ### 📄 Description Delay load call SetThreadDescription to restore WPF renderer on Win7 ## PR Checklist * [x] Closes something @DHowett asked me to do. * [x] I work here * [x] I F5'd it on a version with this function and it still works ## Detailed Description of the Pull Request / Additional comments I keep forgetting that anything in the WPF control needs to keep working on Win7. Or more specifically... I remember this fact for the DX renderer, but not for the render thread base. Oops. Turns out this particular convenience method to set thread descriptions for visibility inside the debugger (to make my life easier) only works down to 1607 (see https://docs.microsoft.com/windows/win32/api/processthreadsapi/nf-processthreadsapi-setthreaddescription). Since it's just a debugging convenience... skipping it entirely when the procedure is not found should be fine. Also I don't try to load `kernel32.dll` and just get the handle of the existing module (which per the remarks at https://docs.microsoft.com/windows/win32/api/libloaderapi/nf-libloaderapi-getmodulehandlew will not increment the module reference count) because `kernel32.dll` pretty much has to be there or we're already in hot water. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:26:27 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#28115