| 1340 | *****************************************************/ |
| 1341 | extern "C" |
| 1342 | void __declspec(dllexport) __cdecl get(HWND hwndParent, |
| 1343 | int string_size, |
| 1344 | TCHAR *variables, |
| 1345 | stack_t **stacktop, |
| 1346 | extra_parameters *extra |
| 1347 | ) |
| 1348 | { |
| 1349 | HANDLE hThread; |
| 1350 | DWORD dwThreadId; |
| 1351 | MSG msg; |
| 1352 | TCHAR szUsername[64]=TEXT(""), // proxy params |
| 1353 | szPassword[64]=TEXT(""); |
| 1354 | |
| 1355 | |
| 1356 | EXDLL_INIT(); |
| 1357 | |
| 1358 | // for repeating /nounload plug-un calls - global vars clean up |
| 1359 | silent = popup = resume = nocancel = noproxy = nocookies = false; |
| 1360 | g_ignorecertissues = false; |
| 1361 | myFtpCommand = NULL; |
| 1362 | openType = INTERNET_OPEN_TYPE_PRECONFIG; |
| 1363 | status = ST_CONNECTING; |
| 1364 | *szCaption = *szCancel = *szUserAgent = *szBasic = *szAuth = 0; |
| 1365 | |
| 1366 | url = (TCHAR*)LocalAlloc(LPTR, string_size * sizeof(TCHAR)); |
| 1367 | if(szPost) |
| 1368 | { |
| 1369 | popstring(url); |
| 1370 | #ifdef UNICODE |
| 1371 | WideCharToMultiByte(CP_ACP, 0, url, -1, szPost, string_size, NULL, NULL); |
| 1372 | #else |
| 1373 | lstrcpy(szPost, url); |
| 1374 | #endif |
| 1375 | fSize = (DWORD)lstrlenA(szPost); |
| 1376 | } |
| 1377 | // global silent option |
| 1378 | if(extra->exec_flags->silent != 0) |
| 1379 | silent = true; |
| 1380 | // we must take this from stack, or push url back |
| 1381 | while(!popstring(url) && *url == TEXT('/')) |
| 1382 | { |
| 1383 | if(lstrcmpi(url, TEXT("/silent")) == 0) |
| 1384 | silent = true; |
| 1385 | else if(lstrcmpi(url, TEXT("/weaksecurity")) == 0) |
| 1386 | g_ignorecertissues = true; |
| 1387 | else if(lstrcmpi(url, TEXT("/caption")) == 0) |
| 1388 | popstring(szCaption); |
| 1389 | else if(lstrcmpi(url, TEXT("/username")) == 0) |
| 1390 | popstring(szUsername); |
| 1391 | else if(lstrcmpi(url, TEXT("/password")) == 0) |
| 1392 | popstring(szPassword); |
| 1393 | else if(lstrcmpi(url, TEXT("/nocancel")) == 0) |
| 1394 | nocancel = true; |
| 1395 | else if(lstrcmpi(url, TEXT("/nocookies")) == 0) |
| 1396 | nocookies = true; |
| 1397 | else if(lstrcmpi(url, TEXT("/noproxy")) == 0) |
| 1398 | openType = INTERNET_OPEN_TYPE_DIRECT; |
| 1399 | else if(lstrcmpi(url, TEXT("/popup")) == 0) |
no test coverage detected