Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
62656c57
Commit
62656c57
authored
Oct 07, 2010
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 07, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Store response data in a stream.
parent
392d74a6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
18 deletions
+49
-18
httprequest.c
dlls/msxml3/httprequest.c
+49
-18
No files found.
dlls/msxml3/httprequest.c
View file @
62656c57
...
...
@@ -2,7 +2,7 @@
* IXMLHTTPRequest implementation
*
* Copyright 2008 Alistair Leslie-Hughes
* Copyright 2010 Nikolay Sivov for Code
w
eavers
* Copyright 2010 Nikolay Sivov for Code
W
eavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -18,7 +18,9 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define COBJMACROS
#define NONAMELESSUNION
#include "config.h"
...
...
@@ -84,6 +86,19 @@ static inline httprequest *impl_from_IXMLHTTPRequest( IXMLHTTPRequest *iface )
return
(
httprequest
*
)((
char
*
)
iface
-
FIELD_OFFSET
(
httprequest
,
lpVtbl
));
}
static
void
httprequest_setreadystate
(
httprequest
*
This
,
READYSTATE
state
)
{
This
->
state
=
state
;
if
(
This
->
sink
)
{
DISPPARAMS
params
;
memset
(
&
params
,
0
,
sizeof
(
params
));
IDispatch_Invoke
(
This
->
sink
,
0
,
&
IID_NULL
,
LOCALE_SYSTEM_DEFAULT
,
DISPATCH_METHOD
,
&
params
,
0
,
0
,
0
);
}
}
struct
BindStatusCallback
{
const
IBindStatusCallbackVtbl
*
lpBindStatusCallbackVtbl
;
...
...
@@ -92,6 +107,9 @@ struct BindStatusCallback
IBinding
*
binding
;
httprequest
*
request
;
/* response data */
IStream
*
stream
;
};
static
inline
BindStatusCallback
*
impl_from_IBindStatusCallback
(
IBindStatusCallback
*
iface
)
...
...
@@ -171,6 +189,7 @@ static ULONG WINAPI BindStatusCallback_Release(IBindStatusCallback *iface)
if
(
!
ref
)
{
if
(
This
->
binding
)
IBinding_Release
(
This
->
binding
);
if
(
This
->
stream
)
IStream_Release
(
This
->
stream
);
heap_free
(
This
);
}
...
...
@@ -189,7 +208,9 @@ static HRESULT WINAPI BindStatusCallback_OnStartBinding(IBindStatusCallback *ifa
This
->
binding
=
pbind
;
IBinding_AddRef
(
pbind
);
return
S_OK
;
httprequest_setreadystate
(
This
->
request
,
READYSTATE_LOADED
);
return
CreateStreamOnHGlobal
(
NULL
,
TRUE
,
&
This
->
stream
);
}
static
HRESULT
WINAPI
BindStatusCallback_GetPriority
(
IBindStatusCallback
*
iface
,
LONG
*
pPriority
)
...
...
@@ -228,6 +249,15 @@ static HRESULT WINAPI BindStatusCallback_OnStopBinding(IBindStatusCallback *ifac
TRACE
(
"(%p)->(0x%08x %s)
\n
"
,
This
,
hr
,
debugstr_w
(
error
));
if
(
This
->
binding
)
{
IBinding_Release
(
This
->
binding
);
This
->
binding
=
NULL
;
}
if
(
hr
==
S_OK
)
httprequest_setreadystate
(
This
->
request
,
READYSTATE_COMPLETE
);
return
S_OK
;
}
...
...
@@ -253,13 +283,26 @@ static HRESULT WINAPI BindStatusCallback_GetBindInfo(IBindStatusCallback *iface,
}
static
HRESULT
WINAPI
BindStatusCallback_OnDataAvailable
(
IBindStatusCallback
*
iface
,
DWORD
grfBSCF
,
DWORD
dwSize
,
FORMATETC
*
pformatetc
,
STGMEDIUM
*
p
stgmed
)
DWORD
flags
,
DWORD
size
,
FORMATETC
*
format
,
STGMEDIUM
*
stgmed
)
{
BindStatusCallback
*
This
=
impl_from_IBindStatusCallback
(
iface
);
DWORD
read
,
written
;
BYTE
buf
[
4096
];
HRESULT
hr
;
FIXME
(
"(%p)->(%08x %d %p %p): stub
\n
"
,
This
,
grfBSCF
,
dwSize
,
pformatetc
,
p
stgmed
);
TRACE
(
"(%p)->(%08x %d %p %p)
\n
"
,
This
,
flags
,
size
,
format
,
stgmed
);
return
E_NOTIMPL
;
do
{
hr
=
IStream_Read
(
stgmed
->
u
.
pstm
,
buf
,
sizeof
(
buf
),
&
read
);
if
(
hr
!=
S_OK
)
break
;
hr
=
IStream_Write
(
This
->
stream
,
buf
,
read
,
&
written
);
}
while
((
hr
==
S_OK
)
&&
written
!=
0
&&
read
!=
0
);
httprequest_setreadystate
(
This
->
request
,
READYSTATE_INTERACTIVE
);
return
S_OK
;
}
static
HRESULT
WINAPI
BindStatusCallback_OnObjectAvailable
(
IBindStatusCallback
*
iface
,
...
...
@@ -388,6 +431,7 @@ static HRESULT BindStatusCallback_create(httprequest* This, BindStatusCallback *
bsc
->
ref
=
1
;
bsc
->
request
=
This
;
bsc
->
binding
=
NULL
;
bsc
->
stream
=
NULL
;
hr
=
RegisterBindStatusCallback
(
pbc
,
(
IBindStatusCallback
*
)
bsc
,
NULL
,
0
);
if
(
hr
==
S_OK
)
...
...
@@ -416,19 +460,6 @@ static HRESULT BindStatusCallback_create(httprequest* This, BindStatusCallback *
return
hr
;
}
static
void
httprequest_setreadystate
(
httprequest
*
This
,
READYSTATE
state
)
{
This
->
state
=
state
;
if
(
This
->
sink
)
{
DISPPARAMS
params
;
memset
(
&
params
,
0
,
sizeof
(
params
));
IDispatch_Invoke
(
This
->
sink
,
0
,
&
IID_NULL
,
LOCALE_SYSTEM_DEFAULT
,
DISPATCH_METHOD
,
&
params
,
0
,
0
,
0
);
}
}
static
HRESULT
WINAPI
httprequest_QueryInterface
(
IXMLHTTPRequest
*
iface
,
REFIID
riid
,
void
**
ppvObject
)
{
httprequest
*
This
=
impl_from_IXMLHTTPRequest
(
iface
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment