Nikolay Sivov nsivov@codeweavers.com wrote:
static int XMLCALL domdoc_stream_save_closecallback(void *ctx) {
- ULONG written;
- HRESULT hr;
- hr = IStream_Write((IStream*)ctx, "\0", 1, &written);
- if (hr != S_OK)
- {
WARN("stream write error: 0x%08x\n", hr);
hr = -1;
- }
- IStream_Release((IStream*)ctx);
- return 0;
- return hr;
}
This will need a test on its own, if it really does that.
It appears that Windows started to do that since Windows 8. What kind of test would you like to see?
The one that shows additional single 0 byte, regardless of document encoding. Or initial stream memory block contents.
Callback should return 0 or -1, as documented.
Yes, and the logic in domdoc_stream_save_closecallback() follows that.
Ok, it's confusing. It's more readable to do SUCCEEDED(hr) ? 0 : -1, or similar.
I decided to fix the tests without patching ::save() to avoid not related changes preventing reviewing further patches. Thanks for the help.