[PATCH 1/3] urlmon: Added user marshaling implementation for OnDataAvailable.
Alexandre Julliard
julliard at winehq.org
Mon Nov 13 15:57:07 CST 2017
Jacek Caban <jacek at codeweavers.com> writes:
> +static HRESULT marshal_stgmed(STGMEDIUM *stgmed, RemSTGMEDIUM **ret)
> +{
> + RemSTGMEDIUM *rem_stgmed;
> + IStream *stream = NULL;
> + ULONG size = 0;
> + HRESULT hres;
> +
> + if((stgmed->tymed == TYMED_ISTREAM && stgmed->u.pstm) || stgmed->pUnkForRelease) {
> + hres = CreateStreamOnHGlobal(NULL, TRUE, &stream);
> + if(FAILED(hres))
> + return hres;
> + }
> +
> + switch(stgmed->tymed) {
> + case TYMED_NULL:
> + break;
> + case TYMED_ISTREAM:
> + if(stgmed->u.pstm)
> + hres = CoMarshalInterface(stream, &IID_IStream, (IUnknown*)stgmed->u.pstm,
> + MSHCTX_LOCAL, NULL, MSHLFLAGS_NORMAL);
> + break;
> + default:
> + FIXME("unsupported tymed %u\n", stgmed->tymed);
> + break;
> + }
> +
> + if(SUCCEEDED(hres) && stgmed->pUnkForRelease)
> + hres = CoMarshalInterface(stream, &IID_IUnknown, stgmed->pUnkForRelease,
> + MSHCTX_LOCAL, NULL, MSHLFLAGS_NORMAL);
This is causing a warning, and it's not clear to me what would be the
correct default value for hres.
gcc -m32 -c -o usrmarshal.o usrmarshal.c -I. -I../../include -D__WINESRC__ -D_URLMON_ -D_REENTRANT -fPIC -Wall \
-pipe -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body -Wignored-qualifiers \
-Wno-packed-not-aligned -Wshift-overflow=2 -Wstrict-prototypes -Wtype-limits \
-Wunused-but-set-parameter -Wvla -Wwrite-strings -Wpointer-arith -Wlogical-op -gdwarf-2 \
-gstrict-dwarf -fno-omit-frame-pointer -Werror -g -O2 -fno-diagnostics-show-caret
usrmarshal.c: In function ‘IBindStatusCallback_OnDataAvailable_Proxy’:
usrmarshal.c:115:7: error: ‘hres’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
usrmarshal.c:94:13: note: ‘hres’ was declared here
usrmarshal.c: At top level:
cc1: all warnings being treated as errors
Makefile:726: recipe for target 'usrmarshal.o' failed
--
Alexandre Julliard
julliard at winehq.org
More information about the wine-devel
mailing list