diff options
author | George Hazan <george.hazan@gmail.com> | 2013-03-11 15:11:36 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-03-11 15:11:36 +0000 |
commit | 6aeafa47b02b966067d3ff83453c9ae8f9b0fc70 (patch) | |
tree | 30a31a165c2712d6af297cf4819fc5787f5344d7 /protocols/GTalkExt | |
parent | 1ba746b6a4c979841a3b3452347da0aa78964f95 (diff) |
only a few real mir_forkthreadex survived
git-svn-id: http://svn.miranda-ng.org/main/trunk@3977 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/GTalkExt')
-rw-r--r-- | protocols/GTalkExt/src/inbox.cpp | 26 |
1 files changed, 7 insertions, 19 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)
|