Page MenuHome

Fix T85689: Replace SHGetFileInfoW for Drive Name
ClosedPublic

Authored by Harley Acheson (harley) on Mar 11 2022, 2:38 AM.

Details

Summary

Win32: Replace SHGetFileInfoW as means to get friendly display names
for volumes because it causes long pauses for disconnected remote
drives.


We currently use SHGetFileInfoW on the Win32 platform to get friendly display names for volumes. Unfortunately this function can result in long pauses for slow or unresponsive network mounts.

This behavior reported in T85689 was for disconnected network share (server turned off) and was confirmed by @Ray Molenkamp (LazyDodo), and then he wrote this solution inspired by identical problem and similar solution by glib as a response to https://gitlab.gnome.org/GNOME/glib/-/issues/2096

Diff Detail

Repository
rB Blender

Event Timeline

Harley Acheson (harley) requested review of this revision.Mar 11 2022, 2:38 AM
Harley Acheson (harley) created this revision.

it's not pretty, but unless we move this file to C++ I don't see a nicer way, COM and C will never be good looking friends.

I'd like to point out that the behavior of SHGetFileInfoW was expected behavior, not a bug, the msdn docs warns You should call this function from a background thread. Failure to do so could cause the UI to stop responding.

This revision is now accepted and ready to land.Mar 11 2022, 3:15 AM