Click to return to the Networking, Protocols     
InternetFindNextFile Func...     InternetInitializeAutoPro...     General Win32 Internet Fu...    
Web Workshop  |  Networking, Protocols & Data Formats

InternetGetLastResponseInfo Function


Retrieves the last Win32® Internet function error description or server response on the thread calling this function.

Syntax

BOOL InternetGetLastResponseInfo(
    OUT LPDWORD lpdwError,
    OUT LPTSTR lpszBuffer,
    IN OUT LPDWORD lpdwBufferLength
);

The actual syntax of this function varies between its ANSI and Unicode implementations. For more information, see Win32 Internet Functions Syntax.

Parameters

lpdwError
Address of an unsigned long integer variable that receives an error message pertaining to the operation that failed.
lpszBuffer
Address of a buffer that receives the error text.
lpdwBufferLength
Address of an unsigned long integer variable that contains the size of the lpszBuffer buffer in TCHAR. When the function returns, this parameter contains the size of the string written to the buffer.

Return Value

Returns TRUE if error text was successfully written to the buffer, or FALSE otherwise. 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.

Remarks

The FTP and Gopher protocols can return additional text information along with most errors. This extended error information can be retrieved by using the InternetGetLastResponseInfo 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 Win32 Internet function is called on this thread. When another function is called, the internal buffer that is storing the last response information is cleared.

Function Information

Windows NT Use version 4.0. Implemented as ANSI and Unicode functions.
Windows Use Windows 95 and later. Implemented as ANSI and Unicode functions.
Header Wininet.h
Import library Wininet.lib
Minimum availability Internet Explorer 3.0 (ANSI only), 5 (ANSI and Unicode)

Windows CE

Windows CE Use version 2.12 and later. Implemented as ANSI and Unicode functions.
Minimum availability Internet Explorer 4.0

See Also

Microsoft Win32 Internet Functions Overview, Common Functions, Microsoft Win32 Internet Functions Reference, General Win32 Internet Functions



Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.