https://bugs.winehq.org/show_bug.cgi?id=45359
--- Comment #3 from jaapbuurman@gmail.com --- Some additional information: I sent the error from the Wine logs back to Kingdom Come's developers and asked if that rang any bell. And this is the response that I received:
it does a ring a bell, flag 0x0000a000 is combination of KF_FLAG_CREATE|KF_FLAG_DONT_UNEXPAND
SHGetKnownFolderPath(FOLDERID_SavedGames, KF_FLAG_CREATE|KF_FLAG_DONT_UNEXPAND, NULL, &wMyDocumentsPath); // Make sure that the folder already exists or create it and apply security specified in folder definition // If folder can not be created then function will return failure and no folder path (IDList) will be returned // If folder is located on the network the function may take long time to execute KF_FLAG_CREATE = 0x00008000, // Set folder path as is and do not try to substitute parts of the path with environments variables. // If flag is not specified then Known Folder will try to replace parts of the path with some // known environment variables (%USERPROFILE%, %APPDATA% etc.) KF_FLAG_DONT_UNEXPAND = 0x00002000,
So perhaps the vanilla SHGetKnownFolderPath does work properly, but not with the flags they are using? And hence the failure the grab the correct "Saved Games" folder's path?