Mercurial > pidgin
diff libpurple/win32/win32dep.c @ 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 | 224f9674a57e |
children | 10ea601e6502 |
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;