WsFillReader function

Ensures that the reader has buffered the minimum byte count of XML data for use by subsequent reader functions. It will invoke the callback specified by WS_XML_READER_STREAM_INPUT
as many times as necessary to obtain the number of bytes specified by the value of the minSize parameter. On completion the buffered data is available to other reader functions. If a subsequent reader function requires more data than what has been obtained the function
will return a WS_E_QUOTA_EXCEEDED exception.
(See Windows Web Services Return Values.)

Parameters

Specifies the minimum number of bytes that the reader should have obtained. If the current byte count buffered is equal to or greater than the value of minSize the function will do nothing and will return immediately.

asyncContext [in, optional]

A pointer to a WS_ASYNC_CONTEXT data structure with information about invoking the function asynchronously. A NULL
value indicates a request for synchronous operation.

error [in, optional]

A pointer to a WS_ERROR object where additional information about the error should be stored if the function fails.

Return value

This function can return one of these values.

Return code

Description

WS_S_ASYNC

The asynchronous operation is still pending.

Security

When using WS_XML_READER_STREAM_INPUT the user of the reader is faced with a potentially unbounded input source,
from a data source with unknown characteristics. Many of the reader properties will
continue to help guard against malicious or malformed documents, but there are additional threats that they cannot mitigate.
Users should exercise additional care when consuming untrusted data from an unknown provider, and consider the following
potential situations.

The document contains arbitrarily large textual content.

The document contains arbitrarily long whitespace.

The provider of the data does not fail but does not produce data either.

The provider of the data does so, but slowly.
Mitigations to this situations include:

When calling WsReadChars or other incremental read functions, ensure there are limits on how much will be read.

When reading elements in a loop, ensure there are limits on how many will be read.