@@ -38,7 +38,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
3838#include <io.h>
3939#include <conio.h>
4040#include <wincrypt.h>
41- #include <shfolder.h>
4241#include <shlobj.h>
4342#include <psapi.h>
4443#include <float.h>
@@ -104,30 +103,14 @@ Sys_DefaultHomePath
104103char * Sys_DefaultHomePath ( void )
105104{
106105 TCHAR szPath [MAX_PATH ];
107- PFNSHGETFOLDERPATHA qSHGetFolderPath ;
108- HMODULE shfolder = LoadLibrary ("shfolder.dll" );
109-
110- if (shfolder == NULL )
111- {
112- Com_Printf ("Unable to load SHFolder.dll\n" );
113- return NULL ;
114- }
115106
116107 if (!* homePath && com_homepath )
117108 {
118- qSHGetFolderPath = (PFNSHGETFOLDERPATHA )GetProcAddress (shfolder , "SHGetFolderPathA" );
119- if (qSHGetFolderPath == NULL )
120- {
121- Com_Printf ("Unable to find SHGetFolderPath in SHFolder.dll\n" );
122- FreeLibrary (shfolder );
123- return NULL ;
124- }
125109
126- if ( !SUCCEEDED ( qSHGetFolderPath ( NULL , CSIDL_APPDATA ,
110+ if ( !SUCCEEDED ( SHGetFolderPathA ( NULL , CSIDL_APPDATA ,
127111 NULL , 0 , szPath ) ) )
128112 {
129113 Com_Printf ("Unable to detect CSIDL_APPDATA\n" );
130- FreeLibrary (shfolder );
131114 return NULL ;
132115 }
133116
@@ -139,7 +122,6 @@ char *Sys_DefaultHomePath( void )
139122 Q_strcat (homePath , sizeof (homePath ), HOMEPATH_NAME_WIN );
140123 }
141124
142- FreeLibrary (shfolder );
143125 return homePath ;
144126}
145127
@@ -240,33 +222,14 @@ char* Sys_MicrosoftStorePath(void)
240222 if (!microsoftStorePath [0 ])
241223 {
242224 TCHAR szPath [MAX_PATH ];
243- PFNSHGETFOLDERPATHA qSHGetFolderPath ;
244- HMODULE shfolder = LoadLibrary ("shfolder.dll" );
245-
246- if (shfolder == NULL )
247- {
248- Com_Printf ("Unable to load SHFolder.dll\n" );
249- return microsoftStorePath ;
250- }
251-
252- qSHGetFolderPath = (PFNSHGETFOLDERPATHA )GetProcAddress (shfolder , "SHGetFolderPathA" );
253- if (qSHGetFolderPath == NULL )
254- {
255- Com_Printf ("Unable to find SHGetFolderPath in SHFolder.dll\n" );
256- FreeLibrary (shfolder );
257- return microsoftStorePath ;
258- }
259225
260- if ( !SUCCEEDED ( qSHGetFolderPath ( NULL , CSIDL_PROGRAM_FILES ,
226+ if ( !SUCCEEDED ( SHGetFolderPathA ( NULL , CSIDL_PROGRAM_FILES ,
261227 NULL , 0 , szPath ) ) )
262228 {
263229 Com_Printf ("Unable to detect CSIDL_PROGRAM_FILES\n" );
264- FreeLibrary (shfolder );
265230 return microsoftStorePath ;
266231 }
267232
268- FreeLibrary (shfolder );
269-
270233 // default: C:\Program Files\ModifiableWindowsApps\Quake 3\EN
271234 Com_sprintf (microsoftStorePath , sizeof (microsoftStorePath ), "%s%cModifiableWindowsApps%c%s%cEN" , szPath , PATH_SEP , PATH_SEP , MSSTORE_PATH , PATH_SEP );
272235 }
0 commit comments