The HttpReadFragmentFromCache function retrieves a response fragment having a specified name from the HTTP Server API cache.
HTTPAPI_LINKAGE ULONG HttpReadFragmentFromCache( IN HANDLE RequestQueueHandle, IN PCWSTR UrlPrefix, IN PHTTP_BYTE_RANGE ByteRange, PVOID Buffer, IN ULONG BufferLength, PULONG BytesRead, IN LPOVERLAPPED Overlapped );
Handle to the request queue with which the specified response fragment is associated. A request queue is created and its handle returned by a call to the HttpCreateRequestQueue function.
Windows Server 2003 with SP1 and Windows XP with SP2: The handle to the request queue is created by the HttpCreateHttpHandle function.
Optional pointer to an HTTP_BYTE_RANGE structure that indicates a starting offset in the specified fragment and byte-count to be returned. NULL if not used, in which case the entire fragment is returned.
Pointer to a buffer into which the function copies the requested fragment.
Size, in bytes, of the pBuffer buffer.
Optional pointer to a variable that receives the number of bytes to be written into the output buffer. If BufferLength is less than this number, the call fails with a return of ERROR_INSUFFICIENT_BUFFER, and the value pointed to by pBytesRead can be used to determine the minimum length of buffer required for the call to succeed.
When making an asynchronous call using pOverlapped, set pBytesRead to NULL. Otherwise, when pOverlapped is set to NULL, pBytesRead must contain a valid memory address, and not be set to NULL.
For asynchronous calls, set pOverlapped to point to an OVERLAPPED structure, or for synchronous calls, set it to NULL.
A synchronous call blocks until the cache operation is complete, whereas an asynchronous call immediately returns ERROR_IO_PENDING and the calling application then uses GetOverlappedResult or I/O completion ports to determine when the operation is completed. For more information about using OVERLAPPED structures for synchronization, see Synchronization and Overlapped Input and Output.
If the function succeeds, the return value is NO_ERROR.
If the function is used asynchronously, a return value of ERROR_IO_PENDING indicates that the cache request is queued and completes later through normal overlapped I/O completion mechanisms.
If the function fails, the return value is one of the following error codes.
||One or more of the supplied parameters is in an unusable form.|
||The buffer pointed to by pBuffer is too small to receive all the requested data; the size of buffer required is pointed to by pBytesRead unless it was NULL or the call was asynchronous. In the case of an asynchronous call, the value pointed to by the lpNumberOfBytesTransferred parameter of the GetOverLappedResult function is set to the buffer size required.|
||A system error code defined in WinError.h.|
|Minimum supported client||Windows Vista, Windows XP with SP2 [desktop apps only]|
|Minimum supported server||Windows Server 2003 [desktop apps only]|