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
b679a690
Commit
b679a690
authored
Feb 19, 2010
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 19, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Accept IObjectSafety for query from IXMLDOMDocument, fix its implementation.
parent
1ff99231
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
7 deletions
+76
-7
domdoc.c
dlls/msxml3/domdoc.c
+7
-7
domdoc.c
dlls/msxml3/tests/domdoc.c
+69
-0
No files found.
dlls/msxml3/domdoc.c
View file @
b679a690
...
...
@@ -471,6 +471,10 @@ static HRESULT WINAPI domdoc_QueryInterface( IXMLDOMDocument2 *iface, REFIID rii
{
*
ppvObject
=
&
(
This
->
lpvtblIObjectWithSite
);
}
else
if
(
IsEqualGUID
(
&
IID_IObjectSafety
,
riid
))
{
*
ppvObject
=
&
(
This
->
lpvtblIObjectSafety
);
}
else
if
(
IsEqualGUID
(
riid
,
&
IID_ISupportErrorInfo
))
{
*
ppvObject
=
&
This
->
lpvtblISupportErrorInfo
;
...
...
@@ -2210,7 +2214,7 @@ static ULONG WINAPI xmldoc_Safety_Release(IObjectSafety *iface)
return
IXMLDocument_Release
((
IXMLDocument
*
)
This
);
}
#define S
UPPORTED_OPTIONS (INTERFACESAFE_FOR_UNTRUSTED_CALLER|INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_SECURITY_MANAGER
)
#define S
AFETY_SUPPORTED_OPTIONS (INTERFACESAFE_FOR_UNTRUSTED_CALLER|INTERFACESAFE_FOR_UNTRUSTED_DATA
)
static
HRESULT
WINAPI
xmldoc_Safety_GetInterfaceSafetyOptions
(
IObjectSafety
*
iface
,
REFIID
riid
,
DWORD
*
pdwSupportedOptions
,
DWORD
*
pdwEnabledOptions
)
...
...
@@ -2222,7 +2226,7 @@ static HRESULT WINAPI xmldoc_Safety_GetInterfaceSafetyOptions(IObjectSafety *ifa
if
(
!
pdwSupportedOptions
||
!
pdwEnabledOptions
)
return
E_POINTER
;
*
pdwSupportedOptions
=
SUPPORTED_OPTIONS
;
*
pdwSupportedOptions
=
S
AFETY_S
UPPORTED_OPTIONS
;
*
pdwEnabledOptions
=
This
->
safeopt
;
return
S_OK
;
...
...
@@ -2232,13 +2236,9 @@ static HRESULT WINAPI xmldoc_Safety_SetInterfaceSafetyOptions(IObjectSafety *ifa
DWORD
dwOptionSetMask
,
DWORD
dwEnabledOptions
)
{
domdoc
*
This
=
impl_from_IObjectSafety
(
iface
);
TRACE
(
"(%p)->(%s %x %x)
\n
"
,
This
,
debugstr_guid
(
riid
),
dwOptionSetMask
,
dwEnabledOptions
);
if
(
dwOptionSetMask
&
~
SUPPORTED_OPTIONS
)
return
E_FAIL
;
This
->
safeopt
=
dwEnabledOptions
&
dwEnabledOptions
;
This
->
safeopt
=
dwEnabledOptions
&
dwOptionSetMask
&
SAFETY_SUPPORTED_OPTIONS
;
return
S_OK
;
}
...
...
dlls/msxml3/tests/domdoc.c
View file @
b679a690
...
...
@@ -24,6 +24,7 @@
#include "windows.h"
#include "ole2.h"
#include "objsafe.h"
#include "xmldom.h"
#include "msxml2.h"
#include "msxml2did.h"
...
...
@@ -33,6 +34,10 @@
#include "wine/test.h"
#include "initguid.h"
DEFINE_GUID
(
IID_IObjectSafety
,
0xcb5bdc81
,
0x93c1
,
0x11cf
,
0x8f
,
0x20
,
0x00
,
0x80
,
0x5f
,
0x2c
,
0xd0
,
0x64
);
static
const
WCHAR
szEmpty
[]
=
{
0
};
static
const
WCHAR
szIncomplete
[]
=
{
'<'
,
'?'
,
'x'
,
'm'
,
'l'
,
' '
,
...
...
@@ -5284,6 +5289,69 @@ static void test_put_nodeValue(void)
IXMLDOMDocument_Release
(
doc
);
}
static
void
test_document_IObjectSafety
(
void
)
{
IXMLDOMDocument
*
doc
;
IObjectSafety
*
safety
;
DWORD
enabled
=
0
,
supported
=
0
;
HRESULT
hr
;
hr
=
CoCreateInstance
(
&
CLSID_DOMDocument
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IXMLDOMDocument
,
(
LPVOID
*
)
&
doc
);
if
(
hr
!=
S_OK
)
return
;
hr
=
IXMLDOMDocument_QueryInterface
(
doc
,
&
IID_IObjectSafety
,
(
void
**
)
&
safety
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
/* get */
hr
=
IObjectSafety_GetInterfaceSafetyOptions
(
safety
,
NULL
,
NULL
,
&
enabled
);
ok
(
hr
==
E_POINTER
,
"ret %08x
\n
"
,
hr
);
hr
=
IObjectSafety_GetInterfaceSafetyOptions
(
safety
,
NULL
,
&
supported
,
NULL
);
ok
(
hr
==
E_POINTER
,
"ret %08x
\n
"
,
hr
);
hr
=
IObjectSafety_GetInterfaceSafetyOptions
(
safety
,
NULL
,
&
supported
,
&
enabled
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
ok
(
supported
==
(
INTERFACESAFE_FOR_UNTRUSTED_CALLER
|
INTERFACESAFE_FOR_UNTRUSTED_DATA
),
"Expected (INTERFACESAFE_FOR_UNTRUSTED_CALLER | INTERFACESAFE_FOR_UNTRUSTED_DATA),"
"got %08x
\n
"
,
supported
);
ok
(
enabled
==
0
,
"Expected 0, got %08x
\n
"
,
enabled
);
/* set */
hr
=
IObjectSafety_SetInterfaceSafetyOptions
(
safety
,
NULL
,
INTERFACESAFE_FOR_UNTRUSTED_CALLER
,
INTERFACESAFE_FOR_UNTRUSTED_CALLER
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
hr
=
IObjectSafety_GetInterfaceSafetyOptions
(
safety
,
NULL
,
&
supported
,
&
enabled
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
ok
(
enabled
==
INTERFACESAFE_FOR_UNTRUSTED_CALLER
,
"Expected INTERFACESAFE_FOR_UNTRUSTED_CALLER, got %08x
\n
"
,
enabled
);
/* set unsupported */
hr
=
IObjectSafety_SetInterfaceSafetyOptions
(
safety
,
NULL
,
INTERFACE_USES_SECURITY_MANAGER
|
INTERFACESAFE_FOR_UNTRUSTED_CALLER
,
INTERFACE_USES_SECURITY_MANAGER
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
hr
=
IObjectSafety_GetInterfaceSafetyOptions
(
safety
,
NULL
,
&
supported
,
&
enabled
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
ok
(
enabled
==
0
,
"Expected 0, got %08x
\n
"
,
enabled
);
hr
=
IObjectSafety_SetInterfaceSafetyOptions
(
safety
,
NULL
,
INTERFACESAFE_FOR_UNTRUSTED_CALLER
,
INTERFACESAFE_FOR_UNTRUSTED_CALLER
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
hr
=
IObjectSafety_SetInterfaceSafetyOptions
(
safety
,
NULL
,
INTERFACESAFE_FOR_UNTRUSTED_DATA
,
INTERFACESAFE_FOR_UNTRUSTED_DATA
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
hr
=
IObjectSafety_GetInterfaceSafetyOptions
(
safety
,
NULL
,
&
supported
,
&
enabled
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
ok
(
enabled
==
INTERFACESAFE_FOR_UNTRUSTED_DATA
,
"Expected INTERFACESAFE_FOR_UNTRUSTED_DATA, got %08x
\n
"
,
enabled
);
IObjectSafety_Release
(
safety
);
IXMLDOMDocument_Release
(
doc
);
}
START_TEST
(
domdoc
)
{
HRESULT
r
;
...
...
@@ -5315,6 +5383,7 @@ START_TEST(domdoc)
test_NodeTypeValue
();
test_TransformWithLoadingLocalFile
();
test_put_nodeValue
();
test_document_IObjectSafety
();
CoUninitialize
();
}
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