Pen with Surface Pro 7/7+ – black screen/DWM.exe crash? A workaround and info on the HEAT framework for pen/touch…
When using the pen with your Surface Pro 7 or Pro 7+, does your system momentarily black-screen or seem to crash for a split second? Read on for a deeper dive into a workaround I shared on reddit a couple weeks ago.
Workaround
First, ensure you have the latest firmware and update the Intel GPU drivers. Thus may fix it right away. If not, read on.
One known root cause for frequent glitches, momentary pauses, or black screens when using the pen is dwm.exe crashing. This symptom appears to be caused by a stack overflow (0xc0000409) in Microsoft’s internal “HEAT” Framework implemented in heatcore.dll. This API integrates with the n-trig digitizer HID driver and appears to compute pen position and tilt angle among other things. To disable this API, open regedit to the following key and look for device entries. To eliminate the crashing symptoms you can just change the name of the device.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Heat\Devices
Although I wouldn’t recommend it, another approach is to rename the heatcore.dll file as follows:
Boot into safe mode
As administrator, take ownership of %windir%\system32\heatcore.dll
Rename heatcore.dll to heatcore.dll.bak
Reboot
Note: on some systems all pen functions will be disabled.
Either approach will disable several pen functions such as tilt detection, palm detection, and right vs left-handedness detection. Per the official Microsoft support threads below, many customers have been waiting for an official fix from Microsoft since September 2020. Hopefully the real fix won’t take too much longer…
Related Microsoft support threads
https://answers.microsoft.com/en-us/surface/forum/all/surface-pro-7-crashes-since-windows-update-2004/e8c9102c-0c3b-4ade-8807-cacae42d8c60 (multiple issues here – a different issue can be resolved by installing a different Intel GPU driver)
More info on the HEAT Framework
The HEAT framework exists in no Microsoft documentation. So being curious, I delved into the heatcore.dll with dumpbin. Some interesting functions are listed below. Curiously, one of the functions refers to “twist”. Perhaps an upcoming Microsoft pen will have twist recognition like the concept presented in the patent from the Perceptive Pixel/Microsoft Portland folks. Twist would be a great feature for added expression in calligraphy and also opens up some interesting UI scenarios.
HeatDevice::QueryInterface
HeatGripDetector::QueryInterface
HeatProcessorCapabilities::QueryInterface
Interesting capability related strings:
“Invert, Eraser, Barrel, Pressure, Twist, Tilt, and PenId are not supported for Touch.”
“If ZHeight is supported, InRange must be supported as well.
“InRange is required for Pen.”
“Geometry is not supported for Pen.”
HeatDeviceProperties::GetSensorToHimetricTransform
HeatFrameBuffer::ExpandBuffer
HeatFrame::GetDecodedHeatmapData
HeatHidInjectionProvider::QueryInterface
HingeAngleContextProvider::SetAngleSensitivity

.png)




Comments