Newsgroups : Microsoft : microsoft.public.inetsdk.programming.wininet : 2004 Nov : InternetReadFile aborts sporadically with error 183

www.cryer.info
Managed Newsgroup Archive

InternetReadFile aborts sporadically with error 183

Subject:InternetReadFile aborts sporadically with error 183
Posted by:"Enno Kolb" (enno_dot_ko..@siemens.com)
Date:Fri, 12 Nov 2004 15:19:01

Hello,

i'm downloading a XML-file with InternetReadFile (see code snippet below).
With files bigger than arround 20kb InternetReadFile fails sporadically
after it downloaded a few kilobytes of the file successfully. GetLastError
returns 183 (ERROR_ALREADY_EXISTS). My system is running Windows 2000 SP4
with IE 6.0SP1.
What does this error code mean in this context?

Thanks,
Enno

Code spnippet:

#define MAX_STREAMBUFFERSIZE 2048
long  FileSize = 0;
CString XMLResponseBuffer;
BYTE StreamBuffer[MAX_STREAMBUFFERSIZE];
ULONG cbToRead  = MAX_STREAMBUFFERSIZE;
ULONG cbRead = 0;
do
{
    //Datenstrom auslesen
    if(InternetReadFile(hRequest, StreamBuffer, cbToRead-1, &cbRead)==FALSE)
    {
        m_XMLOnlineProtocol->WriteLine("InternetReadFile error : %d",
GetLastError());
        m_ErrorFlag = true;
        goto READXMLCONTENT_END;
    }
    StreamBuffer[cbRead] = 0x00;
    //Gesamtfilegrösse ermitteln
    FileSize += cbRead;
    //Buffer in die Datei schreiben
    XMLResponseBuffer += StreamBuffer;

} while(cbRead > 0);

Replies:

www.cryer.info
Managed Newsgroup Archive