From 6aeafa47b02b966067d3ff83453c9ae8f9b0fc70 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 11 Mar 2013 15:11:36 +0000 Subject: only a few real mir_forkthreadex survived git-svn-id: http://svn.miranda-ng.org/main/trunk@3977 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/netlib/netlibautoproxy.cpp | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) (limited to 'src/modules/netlib/netlibautoproxy.cpp') diff --git a/src/modules/netlib/netlibautoproxy.cpp b/src/modules/netlib/netlibautoproxy.cpp index 3d46a739f8..204f23ae29 100644 --- a/src/modules/netlib/netlibautoproxy.cpp +++ b/src/modules/netlib/netlibautoproxy.cpp @@ -266,13 +266,12 @@ struct IeProxyParam char *szProxy; }; -static unsigned __stdcall NetlibIeProxyThread(void * arg) +static void NetlibIeProxyThread(void *arg) { IeProxyParam *param = (IeProxyParam*)arg; param->szProxy = NULL; - if ( !bAutoProxyInit) - { + if ( !bAutoProxyInit) { WaitForSingleObject(hIeProxyMutex, INFINITE); NetlibInitAutoProxy(); ReleaseMutex(hIeProxyMutex); @@ -280,14 +279,12 @@ static unsigned __stdcall NetlibIeProxyThread(void * arg) BOOL res; char *loc = strstr(szAutoUrlStr, "file://"); - if (loc || strstr(szAutoUrlStr, "://") == NULL) - { + if (loc || strstr(szAutoUrlStr, "://") == NULL) { NetlibLogf(NULL, "Autoproxy Init file: %s", loc); loc = loc ? loc + 7 : szAutoUrlStr; res = pInternetInitializeAutoProxyDll(0, loc, NULL, NULL /*&HelperFunctions*/, NULL); } - else - { + else { NetlibLogf(NULL, "Autoproxy Init %d", abuf.dwScriptBufferSize); if (abuf.dwScriptBufferSize) res = pInternetInitializeAutoProxyDll(0, NULL, NULL, NULL /*&HelperFunctions*/, &abuf); @@ -295,8 +292,7 @@ static unsigned __stdcall NetlibIeProxyThread(void * arg) res = false; } - if (res) - { + if (res) { char proxyBuffer[1024]; char *proxy = proxyBuffer; DWORD dwProxyLen = sizeof(proxyBuffer); @@ -308,10 +304,7 @@ static unsigned __stdcall NetlibIeProxyThread(void * arg) NetlibLogf(NULL, "Autoproxy got response %s, Param: %s %s", param->szProxy, param->szUrl, param->szHost); pInternetDeInitializeAutoProxyDll(NULL, 0); } - else - NetlibLogf(NULL, "Autoproxy init failed"); - - return 0; + else NetlibLogf(NULL, "Autoproxy init failed"); } char* NetlibGetIeProxy(char *szUrl) @@ -352,13 +345,10 @@ char* NetlibGetIeProxy(char *szUrl) return res; } - if (szAutoUrlStr[0]) - { - unsigned dwThreadId; + if (szAutoUrlStr[0]) { IeProxyParam param = { szUrl, szHost, NULL }; - HANDLE hThread = (HANDLE)mir_forkthreadex(NetlibIeProxyThread, ¶m, &dwThreadId); + HANDLE hThread = mir_forkthread(NetlibIeProxyThread, ¶m); WaitForSingleObject(hThread, INFINITE); - CloseHandle(hThread); res = param.szProxy; } return res; -- cgit v1.2.3