get SHGetKnownFolderPath the right way
authorRudolf Polzer <divverent@alientrap.org>
Tue, 3 May 2011 06:09:22 +0000 (08:09 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Tue, 3 May 2011 06:09:22 +0000 (08:09 +0200)
radiant/mainframe.cpp

index bddb333..d168c77 100644 (file)
@@ -216,11 +216,11 @@ void HomePaths_Realise()
       wchar_t *mydocsdirw;
       HMODULE shfolder = LoadLibrary("shfolder.dll");
       if(shfolder)
-        qSHGetKnownFolderPath = GetProcAddress("SHGetFolderPathA");
+        qSHGetKnownFolderPath = GetProcAddress("SHGetKnownFolderPath");
       else
         qSHGetKnownFolderPath = NULL;
       CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
-      if(qSHGetKnownFolderPath && qSHGetKnownFolderPath(qFOLDERID_SavedGames, qKF_FLAG_CREATE | qKF_FLAG_NO_ALIAS, NULL, &mydocsdirw) == S_OK)
+      if(qSHGetKnownFolderPath && qSHGetKnownFolderPath(&qFOLDERID_SavedGames, qKF_FLAG_CREATE | qKF_FLAG_NO_ALIAS, NULL, &mydocsdirw) == S_OK)
       {
         memset(mydocsdir, 0, sizeof(mydocsdir));
         wctombs(mydocsdir, mydocsdirw, sizeof(mydocsdir)-1);