diff options
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/GTalkExt/src/inbox.cpp | 26 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/libgadu/pthread.c | 1 |
2 files changed, 7 insertions, 20 deletions
diff --git a/protocols/GTalkExt/src/inbox.cpp b/protocols/GTalkExt/src/inbox.cpp index e52939aa10..b1c8531b9d 100644 --- a/protocols/GTalkExt/src/inbox.cpp +++ b/protocols/GTalkExt/src/inbox.cpp @@ -234,8 +234,10 @@ HANDLE FindNetUserHandle(LPCSTR acc) return *pResult;
}
-unsigned __stdcall OpenUrlThread(OPEN_URL_HEADER* data)
+void OpenUrlThread(void *param)
{
+ OPEN_URL_HEADER* data = (OPEN_URL_HEADER*)param;
+
__try {
HANDLE hUser = FindNetUserHandle(data->acc);
if (!hUser || !AuthAndOpen(hUser, data->url, data->mailbox, data->pwd))
@@ -244,7 +246,6 @@ unsigned __stdcall OpenUrlThread(OPEN_URL_HEADER* data) __finally {
free(data);
}
- return 0;
}
void __forceinline DecryptString(LPSTR str, int len)
@@ -315,11 +316,8 @@ BOOL OpenUrlWithAuth(LPCSTR acc, LPCTSTR mailbox, LPCTSTR url) data->acc = acc;
- if (HANDLE h = mir_forkthreadex((pThreadFuncEx)OpenUrlThread, data, NULL)) {
- CloseHandle(h);
- data = NULL;
- }
- else return FALSE;
+ mir_forkthread(OpenUrlThread, data);
+ data = NULL;
}
__finally {
free(data);
@@ -328,7 +326,7 @@ BOOL OpenUrlWithAuth(LPCSTR acc, LPCTSTR mailbox, LPCTSTR url) return TRUE;
}
-unsigned __stdcall ShellExecuteThread(PVOID param)
+static void ShellExecuteThread(PVOID param)
{
__try {
ShellExecute(0, NULL, (LPTSTR)param, NULL, NULL, SW_SHOW);
@@ -336,21 +334,11 @@ unsigned __stdcall ShellExecuteThread(PVOID param) __finally {
free(param);
}
- return 0;
}
void StartShellExecuteThread(LPCTSTR url)
{
- LPTSTR urlCopy = _tcsdup(url);
- __try {
- if (HANDLE h = mir_forkthreadex(ShellExecuteThread, urlCopy, NULL)) {
- CloseHandle(h);
- urlCopy = NULL;
- }
- }
- __finally {
- free(urlCopy);
- }
+ mir_forkthread(ShellExecuteThread, _tcsdup(url));
}
void OpenUrl(LPCSTR acc, LPCTSTR mailbox, LPCTSTR url)
diff --git a/protocols/Gadu-Gadu/src/libgadu/pthread.c b/protocols/Gadu-Gadu/src/libgadu/pthread.c index 9a8988a358..11362add17 100644 --- a/protocols/Gadu-Gadu/src/libgadu/pthread.c +++ b/protocols/Gadu-Gadu/src/libgadu/pthread.c @@ -30,7 +30,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. int pthread_create(pthread_t *tid, const pthread_attr_t *attr, void *(__stdcall * thread_start) (void *), void *param)
{
tid->hThread = (HANDLE)mir_forkthreadex((pThreadFuncEx)*(void**)&thread_start, param, (unsigned *)&tid->dwThreadId);
-
return 0;
}
|