WsPullBytes function
Sets up a callback to be invoked to obtain the bytes to be written within an element. In some encodings this can be more efficient by eliminating a copy of the data.
Syntax
HRESULT WINAPI WsPullBytes(
_In_ WS_XML_WRITER* writer,
_In_ WS_PULL_BYTES_CALLBACK callback,
_In_opt_ void* callbackState,
_In_opt_ WS_ERROR* error
);
Parameters
- writer [in]
-
The writer to which the bytes will be written.
- callback [in]
-
The callback to invoke when its time to write the binary data.
- callbackState [in, optional]
-
User-defined state to be passed to the callback.
- error [in, optional]
-
Specifies where additional error information should be stored if the function fails.
Return value
This function can return one of these values.
| Return code | Description |
|---|---|
|
One or more arguments are invalid. |
|
The operation is not allowed due to the current state of the object. |
|
A quota was exceeded. |
Remarks
WsWriteBytes and WsPushBytes require the buffer of data to be provided to the writer. In some usage patterns, this may require an extra copy of the data. For those scenarios, WsPullBytes offers a way to request the writer to provide the buffer that must be filled with data.
If the encoding cannot take advantage of this behavior, then WsPullBytes will invoke the callback immediately and operate as if WsWriteBytes was called on the resulting data.
Requirements
|
Minimum supported client | Windows 7 [desktop apps | Windows Store apps] |
|---|---|
|
Minimum supported server | Windows Server 2008 R2 [desktop apps | Windows Store apps] |
|
Header |
|
|
Library |
|
|
DLL |
|