Use SHGetKnownFolderPath instead of SHGetFolderPathA - #743
Conversation
SHGetFolderPathA doesn't need to be called via LoadLibrary/GetProcAddress. We can add either I only included shfolder.h in my original PR to avoid having to copy-paste or declare an custom function pointer type for SHGetFolderPathA. I should have paid more attention to the fact my MSVC installation didn't have that header, but I was only focusing on fixing the build error in GCC and trying to change as few lines of code as possible. |
|
Well yes I'm conflating things a bit here. If I could be bothered I'd look it up, but my recollection is the dynamic loading was do to with supporting older OSes. Nevertheless it's an API that's been deprecated for a long time and it makes very little sense to keep using it. |
|
Personally, I would like to see XP continue to work. SDL3 dynamically loads SHGetKnownFolderPath but otherwise falls back to SHGetFolderPathW. Perhaps ioquake3 could do similar? |
|
Replaced by #744 |
As title.
ShGetFolderPathAis an ancient API that we are using to retrieve "special" folder locations on Windows, which is old and crusty and we should stop using it. Here I replace it withSHGetKnownFolderPath.Pros:
Cons: