Windows Mobile 6.5
A version of this page is also available for

This function retrieves the last WinInet function error description or server response on the thread calling this function.

BOOL WINAPI InternetGetLastResponseInfo( 
  LPDWORD lpdwError, 
  LPTSTR lpszBuffer, 
  LPDWORD lpdwBufferLength


[out] Long pointer to a variable that receives an error message pertaining to the operation that failed.


[out] Long pointer to a buffer that receives the null-terminated string that contains the error text.


[in, out] Long pointer to the size of the lpszBuffer buffer. When the function returns, this parameter contains the size of the string written to the buffer.

TRUE indicates that the error text was successfully written to the buffer. FALSE indicates failure. To get extended error information, call GetLastError. If the buffer is too small to hold all the error text, GetLastError returns ERROR_INSUFFICIENT_BUFFER, and the lpdwBufferLength parameter contains the minimum buffer size required to return all the error text.

The FTP protocol can return additional text information along with most errors. This extended error information can be retrieved by using this function whenever GetLastError returns ERROR_INTERNET_EXTENDED_ERROR (occurring after an unsuccessful function call).

The buffer pointed to by lpszBuffer must be large enough to hold both the error string and a zero terminator at the end of the string. However, note that the value returned in lpdwBufferLength does not include the terminating zero.

InternetGetLastResponseInfo can be called multiple times until another WinInet function is called on this thread. When another function is called, the internal buffer that is storing the last response information is cleared.

Windows Embedded CEWindows CE 2.0 and later
Windows MobileWindows Mobile Version 5.0 and later