done
Ich habe eine alternative gefunden, nun "hängt" aber HttpSendRequest...Quote:
HINTERNET hINet = InternetOpen("test", LOCAL_INTERNET_ACCESS , NULL, NULL, 0 );
hConnect = InternetConnect(hINet, "server",
INTERNET_DEFAULT_HTTP_PORT, NULL, NULL, INTERNET_SERVICE_HTTP,
NULL, NULL);
HINTERNET hRequest = HttpOpenRequest(hConnect, NULL, "/file.txt", NULL, NULL,
NULL, NULL, NULL);
HttpSendRequest( hRequest,0,0,0,0);
int GetURLPage(char *link, char *buffer, int maxsize)
{
HINTERNET hSession;
HINTERNET hURL;
DWORD dwBYTEsRead;
int ok;
ok = 0;
buffer[0] = 0;
hSession = InternetOpen("Microsoft Internet Explorer", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
if (hSession)
{
hURL = InternetOpenUrlA(hSession, link, NULL, 0, 0, 0);
if (hURL)
{
InternetReadFile(hURL, (LPSTR)buffer, (DWORD)maxsize, &dwBYTEsRead);
InternetCloseHandle(hURL);
buffer[dwBYTEsRead] = 0;
ok = (int)dwBYTEsRead;
}
InternetCloseHandle(hSession);
}
return ok;
}
Rufst du die Funktionen in der DllMain auf?Quote:
Mhh in einer Exe datei gehen all diese Funktionen ohne probleme.
Bei einer Dll-Injection leider nicht.
Quote:
Like all other aspects of the WinINet API, this function cannot be safely called from within DllMain or the constructors and destructors of global objects.