Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
0036b8bf
Commit
0036b8bf
authored
Jun 09, 2015
by
Zhenbo Li
Committed by
Alexandre Julliard
Jun 10, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Implement IHTMLXMLHttpRequestFactory as a stub.
parent
ba2274c8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
256 additions
and
3 deletions
+256
-3
Makefile.in
dlls/mshtml/Makefile.in
+2
-1
htmlwindow.c
dlls/mshtml/htmlwindow.c
+21
-2
mshtml_private.h
dlls/mshtml/mshtml_private.h
+10
-0
dom.c
dlls/mshtml/tests/dom.c
+57
-0
xmlhttprequest.c
dlls/mshtml/xmlhttprequest.c
+166
-0
No files found.
dlls/mshtml/Makefile.in
View file @
0036b8bf
...
...
@@ -73,7 +73,8 @@ C_SRCS = \
service.c
\
task.c
\
txtrange.c
\
view.c
view.c
\
xmlhttprequest.c
RC_SRCS
=
mshtml.rc
...
...
dlls/mshtml/htmlwindow.c
View file @
0036b8bf
...
...
@@ -256,6 +256,10 @@ static void release_inner_window(HTMLInnerWindow *This)
IHTMLOptionElementFactory_Release
(
&
This
->
option_factory
->
IHTMLOptionElementFactory_iface
);
}
if
(
This
->
xml_factory
)
{
IHTMLXMLHttpRequestFactory_Release
(
&
This
->
xml_factory
->
IHTMLXMLHttpRequestFactory_iface
);
}
if
(
This
->
screen
)
IHTMLScreen_Release
(
This
->
screen
);
...
...
@@ -1965,8 +1969,23 @@ static HRESULT WINAPI HTMLWindow5_put_XMLHttpRequest(IHTMLWindow5 *iface, VARIAN
static
HRESULT
WINAPI
HTMLWindow5_get_XMLHttpRequest
(
IHTMLWindow5
*
iface
,
VARIANT
*
p
)
{
HTMLWindow
*
This
=
impl_from_IHTMLWindow5
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
p
);
return
E_NOTIMPL
;
HTMLInnerWindow
*
window
=
This
->
inner_window
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
if
(
!
window
->
xml_factory
)
{
HRESULT
hres
;
hres
=
HTMLXMLHttpRequestFactory_Create
(
window
,
&
window
->
xml_factory
);
if
(
FAILED
(
hres
))
return
hres
;
}
V_VT
(
p
)
=
VT_DISPATCH
;
V_DISPATCH
(
p
)
=
(
IDispatch
*
)
&
window
->
xml_factory
->
IHTMLXMLHttpRequestFactory_iface
;
IDispatch_AddRef
(
V_DISPATCH
(
p
));
return
S_OK
;
}
static
const
IHTMLWindow5Vtbl
HTMLWindow5Vtbl
=
{
...
...
dlls/mshtml/mshtml_private.h
View file @
0036b8bf
...
...
@@ -204,6 +204,7 @@ typedef struct event_target_t event_target_t;
XIID(IHTMLWindow4) \
XIID(IHTMLWindow5) \
XIID(IHTMLWindow6) \
XIID(IHTMLXMLHttpRequestFactory) \
XIID(IOmHistory) \
XIID(IOmNavigator)
...
...
@@ -351,6 +352,13 @@ typedef struct {
HTMLInnerWindow
*
window
;
}
HTMLImageElementFactory
;
typedef
struct
{
DispatchEx
dispex
;
IHTMLXMLHttpRequestFactory
IHTMLXMLHttpRequestFactory_iface
;
LONG
ref
;
}
HTMLXMLHttpRequestFactory
;
struct
HTMLLocation
{
DispatchEx
dispex
;
IHTMLLocation
IHTMLLocation_iface
;
...
...
@@ -437,6 +445,7 @@ struct HTMLInnerWindow {
HTMLImageElementFactory
*
image_factory
;
HTMLOptionElementFactory
*
option_factory
;
HTMLXMLHttpRequestFactory
*
xml_factory
;
IHTMLScreen
*
screen
;
OmHistory
*
history
;
IHTMLStorage
*
session_storage
;
...
...
@@ -775,6 +784,7 @@ HTMLOuterWindow *nswindow_to_window(const nsIDOMWindow*) DECLSPEC_HIDDEN;
void
get_top_window
(
HTMLOuterWindow
*
,
HTMLOuterWindow
**
)
DECLSPEC_HIDDEN
;
HRESULT
HTMLOptionElementFactory_Create
(
HTMLInnerWindow
*
,
HTMLOptionElementFactory
**
)
DECLSPEC_HIDDEN
;
HRESULT
HTMLImageElementFactory_Create
(
HTMLInnerWindow
*
,
HTMLImageElementFactory
**
)
DECLSPEC_HIDDEN
;
HRESULT
HTMLXMLHttpRequestFactory_Create
(
HTMLInnerWindow
*
,
HTMLXMLHttpRequestFactory
**
)
DECLSPEC_HIDDEN
;
HRESULT
HTMLLocation_Create
(
HTMLInnerWindow
*
,
HTMLLocation
**
)
DECLSPEC_HIDDEN
;
IOmNavigator
*
OmNavigator_Create
(
void
)
DECLSPEC_HIDDEN
;
HRESULT
HTMLScreen_Create
(
IHTMLScreen
**
)
DECLSPEC_HIDDEN
;
...
...
dlls/mshtml/tests/dom.c
View file @
0036b8bf
...
...
@@ -518,6 +518,34 @@ static BSTR a2bstr(const char *str)
return
ret
;
}
static
const
char
*
debugstr_variant
(
const
VARIANT
*
var
)
{
static
char
buf
[
400
];
if
(
!
var
)
return
"(null)"
;
switch
(
V_VT
(
var
))
{
case
VT_EMPTY
:
return
"{VT_EMPTY}"
;
case
VT_BSTR
:
sprintf
(
buf
,
"{VT_BSTR: %s}"
,
wine_dbgstr_w
(
V_BSTR
(
var
)));
break
;
case
VT_BOOL
:
sprintf
(
buf
,
"{VT_BOOL: %x}"
,
V_BOOL
(
var
));
break
;
case
VT_UI4
:
sprintf
(
buf
,
"{VT_UI4: %u}"
,
V_UI4
(
var
));
break
;
default:
sprintf
(
buf
,
"{vt %d}"
,
V_VT
(
var
));
break
;
}
return
buf
;
}
static
BOOL
iface_cmp
(
IUnknown
*
iface1
,
IUnknown
*
iface2
)
{
IUnknown
*
unk1
,
*
unk2
;
...
...
@@ -6059,9 +6087,29 @@ static void test_history(IHTMLWindow2 *window)
IOmHistory_Release
(
history
);
}
static
void
test_xmlhttprequest
(
IHTMLWindow5
*
window
)
{
HRESULT
hres
;
VARIANT
var
;
IHTMLXMLHttpRequestFactory
*
factory
;
hres
=
IHTMLWindow5_get_XMLHttpRequest
(
window
,
&
var
);
ok
(
hres
==
S_OK
,
"get_XMLHttpRequest failed: %08x
\n
"
,
hres
);
ok
(
V_VT
(
&
var
)
==
VT_DISPATCH
,
"expect VT_DISPATCH, got %s
\n
"
,
debugstr_variant
(
&
var
));
factory
=
NULL
;
hres
=
IDispatch_QueryInterface
(
V_DISPATCH
(
&
var
),
&
IID_IHTMLXMLHttpRequestFactory
,
(
void
**
)
&
factory
);
ok
(
hres
==
S_OK
,
"QueryInterface(&IID_IHTMLXMLHttpRequestFactory) failed: %08x
\n
"
,
hres
);
ok
(
factory
!=
NULL
,
"factory == NULL
\n
"
);
IHTMLXMLHttpRequestFactory_Release
(
factory
);
VariantClear
(
&
var
);
}
static
void
test_window
(
IHTMLDocument2
*
doc
)
{
IHTMLWindow2
*
window
,
*
window2
,
*
self
,
*
parent
;
IHTMLWindow5
*
window5
;
IHTMLDocument2
*
doc2
=
NULL
;
IDispatch
*
disp
;
IUnknown
*
unk
;
...
...
@@ -6148,6 +6196,15 @@ static void test_window(IHTMLDocument2 *doc)
set_window_status
(
window
,
"Test!"
);
test_history
(
window
);
hres
=
IHTMLWindow2_QueryInterface
(
window
,
&
IID_IHTMLWindow5
,
(
void
**
)
&
window5
);
if
(
SUCCEEDED
(
hres
))
{
ok
(
window5
!=
NULL
,
"window5 == NULL
\n
"
);
test_xmlhttprequest
(
window5
);
IHTMLWindow5_Release
(
window5
);
}
else
{
win_skip
(
"IHTMLWindow5 not supported!
\n
"
);
}
IHTMLWindow2_Release
(
window
);
}
...
...
dlls/mshtml/xmlhttprequest.c
0 → 100644
View file @
0036b8bf
/*
* Copyright 2015 Zhenbo Li
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#define COBJMACROS
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "ole2.h"
#include "wine/debug.h"
#include "mshtml_private.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
mshtml
);
/* IHTMLXMLHttpRequestFactory */
static
inline
HTMLXMLHttpRequestFactory
*
impl_from_IHTMLXMLHttpRequestFactory
(
IHTMLXMLHttpRequestFactory
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
HTMLXMLHttpRequestFactory
,
IHTMLXMLHttpRequestFactory_iface
);
}
static
HRESULT
WINAPI
HTMLXMLHttpRequestFactory_QueryInterface
(
IHTMLXMLHttpRequestFactory
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
HTMLXMLHttpRequestFactory
*
This
=
impl_from_IHTMLXMLHttpRequestFactory
(
iface
);
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_mshtml_guid
(
riid
),
ppv
);
if
(
IsEqualGUID
(
&
IID_IUnknown
,
riid
))
{
*
ppv
=
&
This
->
IHTMLXMLHttpRequestFactory_iface
;
}
else
if
(
IsEqualGUID
(
&
IID_IDispatch
,
riid
))
{
*
ppv
=
&
This
->
IHTMLXMLHttpRequestFactory_iface
;
}
else
if
(
IsEqualGUID
(
&
IID_IHTMLXMLHttpRequestFactory
,
riid
))
{
*
ppv
=
&
This
->
IHTMLXMLHttpRequestFactory_iface
;
}
else
if
(
dispex_query_interface
(
&
This
->
dispex
,
riid
,
ppv
))
{
return
*
ppv
?
S_OK
:
E_NOINTERFACE
;
}
else
{
*
ppv
=
NULL
;
WARN
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_mshtml_guid
(
riid
),
ppv
);
return
E_NOINTERFACE
;
}
IUnknown_AddRef
((
IUnknown
*
)
*
ppv
);
return
S_OK
;
}
static
ULONG
WINAPI
HTMLXMLHttpRequestFactory_AddRef
(
IHTMLXMLHttpRequestFactory
*
iface
)
{
HTMLXMLHttpRequestFactory
*
This
=
impl_from_IHTMLXMLHttpRequestFactory
(
iface
);
LONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref=%d
\n
"
,
This
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
HTMLXMLHttpRequestFactory_Release
(
IHTMLXMLHttpRequestFactory
*
iface
)
{
HTMLXMLHttpRequestFactory
*
This
=
impl_from_IHTMLXMLHttpRequestFactory
(
iface
);
LONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref=%d
\n
"
,
This
,
ref
);
if
(
!
ref
)
{
release_dispex
(
&
This
->
dispex
);
heap_free
(
This
);
}
return
ref
;
}
static
HRESULT
WINAPI
HTMLXMLHttpRequestFactory_GetTypeInfoCount
(
IHTMLXMLHttpRequestFactory
*
iface
,
UINT
*
pctinfo
)
{
HTMLXMLHttpRequestFactory
*
This
=
impl_from_IHTMLXMLHttpRequestFactory
(
iface
);
return
IDispatchEx_GetTypeInfoCount
(
&
This
->
dispex
.
IDispatchEx_iface
,
pctinfo
);
}
static
HRESULT
WINAPI
HTMLXMLHttpRequestFactory_GetTypeInfo
(
IHTMLXMLHttpRequestFactory
*
iface
,
UINT
iTInfo
,
LCID
lcid
,
ITypeInfo
**
ppTInfo
)
{
HTMLXMLHttpRequestFactory
*
This
=
impl_from_IHTMLXMLHttpRequestFactory
(
iface
);
return
IDispatchEx_GetTypeInfo
(
&
This
->
dispex
.
IDispatchEx_iface
,
iTInfo
,
lcid
,
ppTInfo
);
}
static
HRESULT
WINAPI
HTMLXMLHttpRequestFactory_GetIDsOfNames
(
IHTMLXMLHttpRequestFactory
*
iface
,
REFIID
riid
,
LPOLESTR
*
rgszNames
,
UINT
cNames
,
LCID
lcid
,
DISPID
*
rgDispId
)
{
HTMLXMLHttpRequestFactory
*
This
=
impl_from_IHTMLXMLHttpRequestFactory
(
iface
);
return
IDispatchEx_GetIDsOfNames
(
&
This
->
dispex
.
IDispatchEx_iface
,
riid
,
rgszNames
,
cNames
,
lcid
,
rgDispId
);
}
static
HRESULT
WINAPI
HTMLXMLHttpRequestFactory_Invoke
(
IHTMLXMLHttpRequestFactory
*
iface
,
DISPID
dispIdMember
,
REFIID
riid
,
LCID
lcid
,
WORD
wFlags
,
DISPPARAMS
*
pDispParams
,
VARIANT
*
pVarResult
,
EXCEPINFO
*
pExcepInfo
,
UINT
*
puArgErr
)
{
HTMLXMLHttpRequestFactory
*
This
=
impl_from_IHTMLXMLHttpRequestFactory
(
iface
);
return
IDispatchEx_Invoke
(
&
This
->
dispex
.
IDispatchEx_iface
,
dispIdMember
,
riid
,
lcid
,
wFlags
,
pDispParams
,
pVarResult
,
pExcepInfo
,
puArgErr
);
}
static
HRESULT
WINAPI
HTMLXMLHttpRequestFactory_create
(
IHTMLXMLHttpRequestFactory
*
iface
,
IHTMLXMLHttpRequest
**
p
)
{
HTMLXMLHttpRequestFactory
*
This
=
impl_from_IHTMLXMLHttpRequestFactory
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
p
);
return
E_NOTIMPL
;
}
static
const
IHTMLXMLHttpRequestFactoryVtbl
HTMLXMLHttpRequestFactoryVtbl
=
{
HTMLXMLHttpRequestFactory_QueryInterface
,
HTMLXMLHttpRequestFactory_AddRef
,
HTMLXMLHttpRequestFactory_Release
,
HTMLXMLHttpRequestFactory_GetTypeInfoCount
,
HTMLXMLHttpRequestFactory_GetTypeInfo
,
HTMLXMLHttpRequestFactory_GetIDsOfNames
,
HTMLXMLHttpRequestFactory_Invoke
,
HTMLXMLHttpRequestFactory_create
};
static
const
tid_t
HTMLXMLHttpRequestFactory_iface_tids
[]
=
{
IHTMLXMLHttpRequestFactory_tid
,
0
};
static
dispex_static_data_t
HTMLXMLHttpRequestFactory_dispex
=
{
NULL
,
IHTMLXMLHttpRequestFactory_tid
,
NULL
,
HTMLXMLHttpRequestFactory_iface_tids
};
HRESULT
HTMLXMLHttpRequestFactory_Create
(
HTMLInnerWindow
*
window
,
HTMLXMLHttpRequestFactory
**
ret_ptr
)
{
HTMLXMLHttpRequestFactory
*
ret
;
ret
=
heap_alloc
(
sizeof
(
*
ret
));
if
(
!
ret
)
return
E_OUTOFMEMORY
;
ret
->
IHTMLXMLHttpRequestFactory_iface
.
lpVtbl
=
&
HTMLXMLHttpRequestFactoryVtbl
;
ret
->
ref
=
1
;
init_dispex
(
&
ret
->
dispex
,
(
IUnknown
*
)
&
ret
->
IHTMLXMLHttpRequestFactory_iface
,
&
HTMLXMLHttpRequestFactory_dispex
);
*
ret_ptr
=
ret
;
return
S_OK
;
}
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