Click to return to the Networking, Protocols     
InternetOpen Function     InternetQueryOption Funct...     General Win32 Internet Fu...    
Web Workshop  |  Networking, Protocols & Data Formats

InternetQueryDataAvailable Function


Queries the server to determine the amount of data available.

Syntax

BOOL InternetQueryDataAvailable( 
    IN HINTERNET hFile,
    OUT LPDWORD lpdwNumberOfBytesAvailable,
    IN DWORD dwFlags,
    IN DWORD dwContext
);

Parameters

hFile
Valid HINTERNET handle, as returned by InternetOpenUrl, FtpOpenFile, GopherOpenFile, or HttpOpenRequest.
lpdwNumberOfBytesAvailable
Optional. Address of an unsigned long integer variable that receives the number of available bytes.
dwFlags
Reserved. Must be set to zero.
dwContext
Reserved. Must be set to zero.

Return Value

Returns TRUE if the function succeeds, or FALSE otherwise. To get extended error information, call GetLastError. If the function finds no matching files, GetLastError returns ERROR_NO_MORE_FILES.

Remarks

This function returns the number of bytes of data that are available to be read immediately by a subsequent call to InternetReadFile. If there is currently no data available and the end of the file has not been reached, the request waits until data becomes available. The amount of data remaining will not be recalculated until all available data indicated by the call to InternetQueryDataAvailable is read.

For HINTERNET handles created by HttpOpenRequest and sent by HttpSendRequestEx, a call to HttpEndRequest must be made on the handle before InternetQueryDataAvailable can be used.

Function Information

Windows NT Use version 4.0. Implemented only as an ANSI function.
Windows Use Windows 95 and later. Implemented only as an ANSI function.
Header Wininet.h
Import library Wininet.lib
Minimum availability Internet Explorer 3.0

Windows CE

Windows CE Use version 2.12 and later
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.