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_PTR dwContext );
Parameters
- hFile [in]
-
Handle returned by the InternetOpenUrl, FtpOpenFile, GopherOpenFile, or HttpOpenRequest function.
- lpdwNumberOfBytesAvailable [out]
-
Pointer to a variable that receives the number of available bytes. May be NULL.
- dwFlags [in]
-
This parameter is reserved and must be 0.
- dwContext [in]
-
This parameter is reserved and must be 0.
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.
Like all other aspects of the WinINet API, this function cannot be safely called from within DllMain or the constructors and destructors of global objects.
Requirements
|
Minimum supported client |
Windows 2000 Professional [desktop apps only] |
|---|---|
|
Minimum supported server |
Windows 2000 Server [desktop apps only] |
|
Header |
|
|
Library |
|
|
DLL |
|
See also