Module: wine Branch: refs/heads/master Commit: 9def0ca2a6cddf9b3dfd5ccc4422b41a3fead949 URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=9def0ca2a6cddf9b3dfd5ccc...
Author: Jacek Caban jacek@codeweavers.com Date: Thu Aug 3 22:00:30 2006 +0200
mshtml: Fix handling offset in BSCallback.
---
dlls/mshtml/mshtml_private.h | 1 + dlls/mshtml/navigate.c | 26 ++++++++++++++------------ 2 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index e93658a..79ac281 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -160,6 +160,7 @@ struct BSCallback { LPWSTR headers; HGLOBAL post_data; ULONG post_data_len; + ULONG readed;
nsChannel *nschannel; nsIStreamListener *nslistener; diff --git a/dlls/mshtml/navigate.c b/dlls/mshtml/navigate.c index ecd8333..2b0b194 100644 --- a/dlls/mshtml/navigate.c +++ b/dlls/mshtml/navigate.c @@ -365,19 +365,20 @@ static HRESULT WINAPI BindStatusCallback
do { hres = IStream_Read(pstgmed->u.pstm, This->nsstream->buf, sizeof(This->nsstream->buf), - &This->nsstream->buf_size); - if(This->nsstream->buf_size) { - nsres = nsIStreamListener_OnDataAvailable(This->nslistener, - (nsIRequest*)NSCHANNEL(This->nschannel), This->nscontext, - NSINSTREAM(This->nsstream), 0 /* FIXME */, dwSize); - if(NS_FAILED(nsres)) - FIXME("OnDataAvailable failed: %08lx\n", nsres); - - if(This->nsstream->buf_size) - FIXME("buffer is not empty!\n"); - }else { + &This->nsstream->buf_size); + if(!This->nsstream->buf_size) break; - } + + nsres = nsIStreamListener_OnDataAvailable(This->nslistener, + (nsIRequest*)NSCHANNEL(This->nschannel), This->nscontext, + NSINSTREAM(This->nsstream), This->readed, This->nsstream->buf_size); + if(NS_FAILED(nsres)) + FIXME("OnDataAvailable failed: %08lx\n", nsres); + + if(This->nsstream->buf_size) + FIXME("buffer is not empty!\n"); + + This->readed += This->nsstream->buf_size; }while(hres == S_OK); }
@@ -575,6 +576,7 @@ BSCallback *create_bscallback(HTMLDocume ret->post_data = NULL; ret->headers = NULL; ret->post_data_len = 0; + ret->readed = 0; ret->nschannel = NULL; ret->nslistener = NULL; ret->nscontext = NULL;