Discussion:
HttpSendRequest Error 12057 on Win2k3 Standard Edition SP1
(too old to reply)
h***@gmail.com
2006-01-13 05:23:18 UTC
Permalink
I've tried the same program on many other machine. It works great. But
it returned 12057 on Win2k3 Standard Edition SP1.

Is there a bug on Win2k3 Standard Edition SP1 or probably my program
problem?

NOTE: the machine can visit my requested website without a problem. I'm
using HTTPS.
Hans Wong
2006-01-13 07:06:18 UTC
Permalink
const BYTE login[] =
{0x??,0x??,0x??,0x??,0x??,0x??,0x??,0x??,0x??,0x??,0x00};
const BYTE pwd[] = {0x??,0x??,0x??,0x??,0x??,0x??,0x??,0x??,0x00};
const TCHAR * accept[] = { _T("*/*"), NULL };

if (servername == NULL || objname==NULL)
{
LastError = -1;
//Output error
return NULL;
}

hIO = InternetOpen(AgentName, LOCAL_INTERNET_ACCESS, NULL, 0, 0);

hCO = InternetConnect(hIO, servername, INTERNET_DEFAULT_HTTPS_PORT,
TEXT((const char*)login), TEXT((const char*)pwd),
INTERNET_SERVICE_HTTP, 0, 1);

if ( !hCO ) {
LastError = GetLastError();
InternetCloseHandle(hIO);
//Output error
return NULL;
}

// Get data
hData = HttpOpenRequest(hCO, TEXT("GET"), objname, HTTP_VERSION,
TEXT(""), accept,
INTERNET_FLAG_SECURE|INTERNET_FLAG_NO_CACHE_WRITE, 1);

if ( !hData ) {
LastError = GetLastError();
InternetCloseHandle(hCO);
InternetCloseHandle(hIO);
//Output error
return NULL;
}

if(!HttpSendRequest( hData, NULL, 0, NULL, 0))
{
LastError = GetLastError();
InternetCloseHandle(hData);
InternetCloseHandle(hCO);
InternetCloseHandle(hIO);
// Output Error
return NULL;
}
Scherbina Vladimir
2006-01-13 13:52:08 UTC
Permalink
This problem has been asked recently on
http://www.archivum.info/microsoft.public.inetsdk.programming.wininet/2005-07/msg00096.html.
Without answers.

--
Vladimir
Post by Hans Wong
const BYTE login[] =
{0x??,0x??,0x??,0x??,0x??,0x??,0x??,0x??,0x??,0x??,0x00};
const BYTE pwd[] = {0x??,0x??,0x??,0x??,0x??,0x??,0x??,0x??,0x00};
const TCHAR * accept[] = { _T("*/*"), NULL };
if (servername == NULL || objname==NULL)
{
LastError = -1;
//Output error
return NULL;
}
hIO = InternetOpen(AgentName, LOCAL_INTERNET_ACCESS, NULL, 0, 0);
hCO = InternetConnect(hIO, servername, INTERNET_DEFAULT_HTTPS_PORT,
TEXT((const char*)login), TEXT((const char*)pwd),
INTERNET_SERVICE_HTTP, 0, 1);
if ( !hCO ) {
LastError = GetLastError();
InternetCloseHandle(hIO);
//Output error
return NULL;
}
// Get data
hData = HttpOpenRequest(hCO, TEXT("GET"), objname, HTTP_VERSION,
TEXT(""), accept,
INTERNET_FLAG_SECURE|INTERNET_FLAG_NO_CACHE_WRITE, 1);
if ( !hData ) {
LastError = GetLastError();
InternetCloseHandle(hCO);
InternetCloseHandle(hIO);
//Output error
return NULL;
}
if(!HttpSendRequest( hData, NULL, 0, NULL, 0))
{
LastError = GetLastError();
InternetCloseHandle(hData);
InternetCloseHandle(hCO);
InternetCloseHandle(hIO);
// Output Error
return NULL;
}
Hans Wong
2006-01-16 02:51:09 UTC
Permalink
Btw, anyone tried R2?

Can R2 fix this error?

Loading...