pidgin: 5125b363: Make wpurple_find_and_loadproc() work fo...

datallah at pidgin.im datallah at pidgin.im
Mon Aug 30 22:01:36 EDT 2010


----------------------------------------------------------------------
Revision: 5125b363023fd23274b20c695fa3ff7e7bcb89c3
Parent:   9e0f63674812152b43f5c8fbbad6fa41a9f07886
Author:   datallah at pidgin.im
Date:     08/30/10 20:51:41
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/5125b363023fd23274b20c695fa3ff7e7bcb89c3

Changelog: 

Make wpurple_find_and_loadproc() work for non-ASCII full paths

Changes against parent 9e0f63674812152b43f5c8fbbad6fa41a9f07886

  patched  libpurple/win32/win32dep.c

-------------- next part --------------
============================================================
--- libpurple/win32/win32dep.c	4c16fd2d2ceb19e28641be8c0b61ffdd67d99506
+++ libpurple/win32/win32dep.c	4d5908badd47a0865a09e587eda38e36f6ece15c
@@ -77,16 +77,22 @@ FARPROC wpurple_find_and_loadproc(const 
 	BOOL did_load = FALSE;
 	FARPROC proc = 0;
 
-	if(!(hmod = GetModuleHandle(dllname))) {
+	wchar_t *wc_dllname = g_utf8_to_utf16(dllname, -1, NULL, NULL, NULL);
+
+	if(!(hmod = GetModuleHandleW(wc_dllname))) {
 		purple_debug_warning("wpurple", "%s not already loaded; loading it...\n", dllname);
-		if(!(hmod = LoadLibrary(dllname))) {
+		if(!(hmod = LoadLibraryW(wc_dllname))) {
 			purple_debug_error("wpurple", "Could not load: %s\n", dllname);
+			g_free(wc_dllname);
 			return NULL;
 		}
 		else
 			did_load = TRUE;
 	}
 
+	g_free(wc_dllname);
+	wc_dllname = NULL;
+
 	if((proc = GetProcAddress(hmod, procedure))) {
 		purple_debug_info("wpurple", "This version of %s contains %s\n",
 			dllname, procedure);


More information about the Commits mailing list