| 41197:1fbba07f21cf | 41198:b5b1bffc48fb |
|---|---|
| 19 * | 19 * |
| 20 */ | 20 */ |
| 21 #include <io.h> | 21 #include <io.h> |
| 22 #include <stdlib.h> | 22 #include <stdlib.h> |
| 23 #include <stdio.h> | 23 #include <stdio.h> |
| 24 | |
| 25 /* winsock2.h needs to be include before windows.h or else it throws a warning | |
| 26 * saying it needs to be included first. We don't use it directly but it's | |
| 27 * included indirectly. | |
| 28 */ | |
| 29 #include <winsock2.h> | |
| 24 #include <windows.h> | 30 #include <windows.h> |
| 25 #include <winuser.h> | 31 #include <winuser.h> |
| 26 #include <shellapi.h> | 32 #include <shellapi.h> |
| 27 | 33 |
| 28 #include <glib.h> | 34 #include <glib.h> |
| 31 #include <gdk/gdkwin32.h> | 37 #include <gdk/gdkwin32.h> |
| 32 | 38 |
| 33 #include <purple.h> | 39 #include <purple.h> |
| 34 | 40 |
| 35 #include "resource.h" | 41 #include "resource.h" |
| 36 #include "untar.h" | |
| 37 | 42 |
| 38 #include "gtkwin32dep.h" | 43 #include "gtkwin32dep.h" |
| 39 #include "gtkblist.h" | 44 #include "gtkblist.h" |
| 40 #include "gtkconv.h" | 45 #include "gtkconv.h" |
| 41 #include "gtkconn.h" | 46 #include "gtkconn.h" |
| 44 * GLOBALS | 49 * GLOBALS |
| 45 */ | 50 */ |
| 46 HINSTANCE exe_hInstance = 0; | 51 HINSTANCE exe_hInstance = 0; |
| 47 HINSTANCE dll_hInstance = 0; | 52 HINSTANCE dll_hInstance = 0; |
| 48 HWND messagewin_hwnd; | 53 HWND messagewin_hwnd; |
| 49 static int gtkwin32_handle; | |
| 50 | 54 |
| 51 static gboolean pwm_handles_connections = TRUE; | 55 static gboolean pwm_handles_connections = TRUE; |
| 52 | 56 |
| 53 | 57 |
| 54 /* | 58 /* |
| 124 g_clear_error(&error); | 128 g_clear_error(&error); |
| 125 return 0; | 129 return 0; |
| 126 } | 130 } |
| 127 | 131 |
| 128 return 1; | 132 return 1; |
| 129 } | |
| 130 | |
| 131 int winpidgin_gz_untar(const char* filename, const char* destdir) { | |
| 132 char tmpfile[_MAX_PATH]; | |
| 133 char template[]="wpidginXXXXXX"; | |
| 134 | |
| 135 sprintf(tmpfile, "%s%s%s", g_get_tmp_dir(), G_DIR_SEPARATOR_S, _mktemp(template)); | |
| 136 if(winpidgin_gz_decompress(filename, tmpfile)) { | |
| 137 int ret; | |
| 138 if(untar(tmpfile, destdir, UNTAR_FORCE | UNTAR_QUIET)) | |
| 139 ret = 1; | |
| 140 else { | |
| 141 purple_debug_error("winpidgin_gz_untar", "Failure untarring %s\n", tmpfile); | |
| 142 ret = 0; | |
| 143 } | |
| 144 g_unlink(tmpfile); | |
| 145 return ret; | |
| 146 } | |
| 147 else { | |
| 148 purple_debug_error("winpidgin_gz_untar", "Failed to gz decompress %s\n", filename); | |
| 149 return 0; | |
| 150 } | |
| 151 } | 133 } |
| 152 | 134 |
| 153 void winpidgin_shell_execute(const char *target, const char *verb, const char *clazz) { | 135 void winpidgin_shell_execute(const char *target, const char *verb, const char *clazz) { |
| 154 | 136 |
| 155 SHELLEXECUTEINFOW wsinfo; | 137 SHELLEXECUTEINFOW wsinfo; |