Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Ferrillo
wine
Commits
1ae51aa7
Commit
1ae51aa7
authored
14 years ago
by
Michael Stefaniuc
Committed by
Alexandre Julliard
14 years ago
Browse files
Options
Downloads
Patches
Plain Diff
mshtml: COM cleanup for the nsIInputStream iface.
parent
1d7e5007
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/mshtml/navigate.c
+20
-21
20 additions, 21 deletions
dlls/mshtml/navigate.c
with
20 additions
and
21 deletions
dlls/mshtml/navigate.c
+
20
−
21
View file @
1ae51aa7
...
...
@@ -45,7 +45,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
#define UTF16_STR "utf-16"
typedef
struct
{
const
nsIInputStream
Vtbl
*
lp
InputStream
Vtbl
;
nsIInputStream
nsI
InputStream
_iface
;
LONG
ref
;
...
...
@@ -53,8 +53,6 @@ typedef struct {
DWORD
buf_size
;
}
nsProtocolStream
;
#define NSINSTREAM(x) ((nsIInputStream*) &(x)->lpInputStreamVtbl)
typedef
struct
{
void
(
*
destroy
)(
BSCallback
*
);
HRESULT
(
*
init_bindinfo
)(
BSCallback
*
);
...
...
@@ -91,25 +89,28 @@ struct BSCallback {
struct
list
entry
;
};
#define NSINSTREAM_THIS(iface) DEFINE_THIS(nsProtocolStream, InputStream, iface)
static
inline
nsProtocolStream
*
impl_from_nsIInputStream
(
nsIInputStream
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
nsProtocolStream
,
nsIInputStream_iface
);
}
static
nsresult
NSAPI
nsInputStream_QueryInterface
(
nsIInputStream
*
iface
,
nsIIDRef
riid
,
void
**
result
)
{
nsProtocolStream
*
This
=
NSINSTREAM_THIS
(
iface
);
nsProtocolStream
*
This
=
impl_from_nsIInputStream
(
iface
);
*
result
=
NULL
;
if
(
IsEqualGUID
(
&
IID_nsISupports
,
riid
))
{
TRACE
(
"(%p)->(IID_nsISupports %p)
\n
"
,
This
,
result
);
*
result
=
NSINSTREAM
(
This
)
;
*
result
=
&
This
->
nsIInputStream_iface
;
}
else
if
(
IsEqualGUID
(
&
IID_nsIInputStream
,
riid
))
{
TRACE
(
"(%p)->(IID_nsIInputStream %p)
\n
"
,
This
,
result
);
*
result
=
NSINSTREAM
(
This
)
;
*
result
=
&
This
->
nsIInputStream_iface
;
}
if
(
*
result
)
{
nsIInputStream_AddRef
(
NSINSTREAM
(
This
)
);
nsIInputStream_AddRef
(
&
This
->
nsIInputStream_iface
);
return
NS_OK
;
}
...
...
@@ -119,7 +120,7 @@ static nsresult NSAPI nsInputStream_QueryInterface(nsIInputStream *iface, nsIIDR
static
nsrefcnt
NSAPI
nsInputStream_AddRef
(
nsIInputStream
*
iface
)
{
nsProtocolStream
*
This
=
NSINSTREAM_THIS
(
iface
);
nsProtocolStream
*
This
=
impl_from_nsIInputStream
(
iface
);
LONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref=%d
\n
"
,
This
,
ref
);
...
...
@@ -130,7 +131,7 @@ static nsrefcnt NSAPI nsInputStream_AddRef(nsIInputStream *iface)
static
nsrefcnt
NSAPI
nsInputStream_Release
(
nsIInputStream
*
iface
)
{
nsProtocolStream
*
This
=
NSINSTREAM_THIS
(
iface
);
nsProtocolStream
*
This
=
impl_from_nsIInputStream
(
iface
);
LONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref=%d
\n
"
,
This
,
ref
);
...
...
@@ -143,14 +144,14 @@ static nsrefcnt NSAPI nsInputStream_Release(nsIInputStream *iface)
static
nsresult
NSAPI
nsInputStream_Close
(
nsIInputStream
*
iface
)
{
nsProtocolStream
*
This
=
NSINSTREAM_THIS
(
iface
);
nsProtocolStream
*
This
=
impl_from_nsIInputStream
(
iface
);
FIXME
(
"(%p)
\n
"
,
This
);
return
NS_ERROR_NOT_IMPLEMENTED
;
}
static
nsresult
NSAPI
nsInputStream_Available
(
nsIInputStream
*
iface
,
PRUint32
*
_retval
)
{
nsProtocolStream
*
This
=
NSINSTREAM_THIS
(
iface
);
nsProtocolStream
*
This
=
impl_from_nsIInputStream
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
_retval
);
return
NS_ERROR_NOT_IMPLEMENTED
;
}
...
...
@@ -158,7 +159,7 @@ static nsresult NSAPI nsInputStream_Available(nsIInputStream *iface, PRUint32 *_
static
nsresult
NSAPI
nsInputStream_Read
(
nsIInputStream
*
iface
,
char
*
aBuf
,
PRUint32
aCount
,
PRUint32
*
_retval
)
{
nsProtocolStream
*
This
=
NSINSTREAM_THIS
(
iface
);
nsProtocolStream
*
This
=
impl_from_nsIInputStream
(
iface
);
DWORD
read
=
aCount
;
TRACE
(
"(%p)->(%p %d %p)
\n
"
,
This
,
aBuf
,
aCount
,
_retval
);
...
...
@@ -181,7 +182,7 @@ static nsresult NSAPI nsInputStream_ReadSegments(nsIInputStream *iface,
nsresult
(
WINAPI
*
aWriter
)(
nsIInputStream
*
,
void
*
,
const
char
*
,
PRUint32
,
PRUint32
,
PRUint32
*
),
void
*
aClousure
,
PRUint32
aCount
,
PRUint32
*
_retval
)
{
nsProtocolStream
*
This
=
NSINSTREAM_THIS
(
iface
);
nsProtocolStream
*
This
=
impl_from_nsIInputStream
(
iface
);
PRUint32
written
=
0
;
nsresult
nsres
;
...
...
@@ -193,7 +194,7 @@ static nsresult NSAPI nsInputStream_ReadSegments(nsIInputStream *iface,
if
(
aCount
>
This
->
buf_size
)
aCount
=
This
->
buf_size
;
nsres
=
aWriter
(
NSINSTREAM
(
This
)
,
aClousure
,
This
->
buf
,
0
,
aCount
,
&
written
);
nsres
=
aWriter
(
&
This
->
nsIInputStream_iface
,
aClousure
,
This
->
buf
,
0
,
aCount
,
&
written
);
if
(
NS_FAILED
(
nsres
))
TRACE
(
"aWritter failed: %08x
\n
"
,
nsres
);
else
if
(
written
!=
This
->
buf_size
)
...
...
@@ -207,13 +208,11 @@ static nsresult NSAPI nsInputStream_ReadSegments(nsIInputStream *iface,
static
nsresult
NSAPI
nsInputStream_IsNonBlocking
(
nsIInputStream
*
iface
,
PRBool
*
_retval
)
{
nsProtocolStream
*
This
=
NSINSTREAM_THIS
(
iface
);
nsProtocolStream
*
This
=
impl_from_nsIInputStream
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
_retval
);
return
NS_ERROR_NOT_IMPLEMENTED
;
}
#undef NSINSTREAM_THIS
static
const
nsIInputStreamVtbl
nsInputStreamVtbl
=
{
nsInputStream_QueryInterface
,
nsInputStream_AddRef
,
...
...
@@ -229,7 +228,7 @@ static nsProtocolStream *create_nsprotocol_stream(void)
{
nsProtocolStream
*
ret
=
heap_alloc
(
sizeof
(
nsProtocolStream
));
ret
->
lp
InputStreamVtbl
=
&
nsInputStreamVtbl
;
ret
->
nsI
InputStream
_iface
.
lp
Vtbl
=
&
nsInputStreamVtbl
;
ret
->
ref
=
1
;
ret
->
buf_size
=
0
;
...
...
@@ -1016,7 +1015,7 @@ static HRESULT read_stream_data(nsChannelBSC *This, IStream *stream)
nsres
=
nsIStreamListener_OnDataAvailable
(
This
->
nslistener
,
(
nsIRequest
*
)
&
This
->
nschannel
->
nsIHttpChannel_iface
,
This
->
nscontext
,
NSINSTREAM
(
This
->
nsstream
)
,
This
->
bsc
.
readed
-
This
->
nsstream
->
buf_size
,
&
This
->
nsstream
->
nsIInputStream_iface
,
This
->
bsc
.
readed
-
This
->
nsstream
->
buf_size
,
This
->
nsstream
->
buf_size
);
if
(
NS_FAILED
(
nsres
))
ERR
(
"OnDataAvailable failed: %08x
\n
"
,
nsres
);
...
...
@@ -1043,7 +1042,7 @@ static void nsChannelBSC_destroy(BSCallback *bsc)
if
(
This
->
nscontext
)
nsISupports_Release
(
This
->
nscontext
);
if
(
This
->
nsstream
)
nsIInputStream_Release
(
NSINSTREAM
(
This
->
nsstream
)
);
nsIInputStream_Release
(
&
This
->
nsstream
->
nsIInputStream_iface
);
heap_free
(
This
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment