changeset 29224:3be6a18e0bcb

No need to access SHGetFolderPath() indirectly any more with required versions of Windows.
author Daniel Atallah <daniel.atallah@gmail.com>
date Sat, 31 Oct 2009 20:03:26 +0000
parents 8d10605105f2
children 3f33a8fbf871
files libpurple/win32/win32dep.c pidgin/win32/nsis/pidgin-installer.nsi
diffstat 2 files changed, 4 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/win32/win32dep.c	Sat Oct 31 19:42:18 2009 +0000
+++ b/libpurple/win32/win32dep.c	Sat Oct 31 20:03:26 2009 +0000
@@ -30,14 +30,6 @@
 #include "notify.h"
 
 /*
- *  DEFINES & MACROS
- */
-
-/* For shfolder.dll */
-typedef HRESULT (CALLBACK* LPFNSHGETFOLDERPATHA)(HWND, int, HANDLE, DWORD, LPSTR);
-typedef HRESULT (CALLBACK* LPFNSHGETFOLDERPATHW)(HWND, int, HANDLE, DWORD, LPWSTR);
-
-/*
  * LOCALS
  */
 static char *app_data_dir = NULL, *install_dir = NULL,
@@ -115,21 +107,12 @@
 
 /* Get paths to special Windows folders. */
 gchar *wpurple_get_special_folder(int folder_type) {
-	static LPFNSHGETFOLDERPATHW MySHGetFolderPathW = NULL;
 	gchar *retval = NULL;
-
-	if (!MySHGetFolderPathW) {
-		MySHGetFolderPathW = (LPFNSHGETFOLDERPATHW)
-			wpurple_find_and_loadproc("shfolder.dll", "SHGetFolderPathW");
-	}
+	wchar_t utf_16_dir[MAX_PATH + 1];
 
-	if (MySHGetFolderPathW) {
-		wchar_t utf_16_dir[MAX_PATH + 1];
-
-		if (SUCCEEDED(MySHGetFolderPathW(NULL, folder_type, NULL,
-						SHGFP_TYPE_CURRENT, utf_16_dir))) {
-			retval = g_utf16_to_utf8(utf_16_dir, -1, NULL, NULL, NULL);
-		}
+	if (SUCCEEDED(SHGetFolderPathW(NULL, folder_type, NULL,
+					SHGFP_TYPE_CURRENT, utf_16_dir))) {
+		retval = g_utf16_to_utf8(utf_16_dir, -1, NULL, NULL, NULL);
 	}
 
 	return retval;
--- a/pidgin/win32/nsis/pidgin-installer.nsi	Sat Oct 31 19:42:18 2009 +0000
+++ b/pidgin/win32/nsis/pidgin-installer.nsi	Sat Oct 31 20:03:26 2009 +0000
@@ -480,14 +480,6 @@
     File "${PIDGIN_INSTALLER_DEPS}\exchndl.dll"
     !endif
 
-    ; Install shfolder.dll if need be..
-    SearchPath $R4 "shfolder.dll"
-    StrCmp $R4 "" 0 got_shfolder
-      SetOutPath "$SYSDIR"
-      File "${PIDGIN_INSTALLER_DEPS}\shfolder.dll"
-      SetOutPath "$INSTDIR"
-    got_shfolder:
-
     ; Check if Perl is installed, if so add it to the AppPaths
     ReadRegStr $R2 HKLM ${PERL_REG_KEY} ""
     StrCmp $R2 "" 0 perl_exists