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
3a736c66
Commit
3a736c66
authored
Mar 14, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 14, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Added more policy tests.
parent
15feb50d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
1 deletion
+77
-1
misc.c
dlls/urlmon/tests/misc.c
+77
-1
No files found.
dlls/urlmon/tests/misc.c
View file @
3a736c66
...
...
@@ -744,7 +744,7 @@ static void test_SecurityManager(void)
int
i
;
IInternetSecurityManager
*
secmgr
=
NULL
;
BYTE
buf
[
512
];
DWORD
zone
,
size
;
DWORD
zone
,
size
,
policy
;
HRESULT
hres
;
hres
=
CoInternetCreateSecurityManager
(
NULL
,
&
secmgr
,
0
);
...
...
@@ -798,9 +798,84 @@ static void test_SecurityManager(void)
ok
(
hres
==
E_INVALIDARG
,
"GetSecurityId failed: %08x, expected E_INVALIDARG
\n
"
,
hres
);
hres
=
IInternetSecurityManager_ProcessUrlAction
(
secmgr
,
NULL
,
URLACTION_SCRIPT_RUN
,
(
BYTE
*
)
&
policy
,
sizeof
(
WCHAR
),
NULL
,
0
,
0
,
0
);
ok
(
hres
==
E_INVALIDARG
,
"ProcessUrlAction failed: %08x, expected E_INVALIDARG
\n
"
,
hres
);
IInternetSecurityManager_Release
(
secmgr
);
}
static
void
test_url_action
(
IInternetSecurityManager
*
secmgr
,
IInternetZoneManager
*
zonemgr
,
DWORD
action
)
{
DWORD
res
,
size
,
policy
,
reg_policy
;
char
buf
[
10
];
HKEY
hkey
;
HRESULT
hres
;
res
=
RegOpenKeyA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Microsoft
\\
Windows
\\
CurrentVersion
\\
Internet Settings
\\
Zones
\\
3"
,
&
hkey
);
if
(
res
!=
ERROR_SUCCESS
)
{
ok
(
0
,
"Could not open zone key
\n
"
);
return
;
}
wsprintf
(
buf
,
"%X"
,
action
);
size
=
sizeof
(
DWORD
);
res
=
RegQueryValueExA
(
hkey
,
buf
,
NULL
,
NULL
,
(
BYTE
*
)
&
reg_policy
,
&
size
);
RegCloseKey
(
hkey
);
if
(
res
!=
ERROR_SUCCESS
||
size
!=
sizeof
(
DWORD
))
{
policy
=
0xdeadbeef
;
hres
=
IInternetSecurityManager_ProcessUrlAction
(
secmgr
,
url9
,
action
,
(
BYTE
*
)
&
policy
,
sizeof
(
WCHAR
),
NULL
,
0
,
0
,
0
);
ok
(
hres
==
E_FAIL
,
"ProcessUrlAction(%x) failed: %08x, expected E_FAIL
\n
"
,
action
,
hres
);
ok
(
policy
==
0xdeadbeef
,
"(%x) policy=%x
\n
"
,
action
,
policy
);
policy
=
0xdeadbeef
;
hres
=
IInternetZoneManager_GetZoneActionPolicy
(
zonemgr
,
3
,
action
,
(
BYTE
*
)
&
policy
,
sizeof
(
DWORD
),
URLZONEREG_DEFAULT
);
ok
(
hres
==
E_FAIL
,
"GetZoneActionPolicy failed: %08x, expected E_FAIL
\n
"
,
hres
);
ok
(
policy
==
0xdeadbeef
,
"(%x) policy=%x
\n
"
,
action
,
policy
);
return
;
}
policy
=
0xdeadbeef
;
hres
=
IInternetZoneManager_GetZoneActionPolicy
(
zonemgr
,
3
,
action
,
(
BYTE
*
)
&
policy
,
sizeof
(
DWORD
),
URLZONEREG_DEFAULT
);
ok
(
hres
==
S_OK
,
"GetZoneActionPolicy failed: %08x
\n
"
,
hres
);
ok
(
policy
==
reg_policy
,
"(%x) policy=%x, expected %x
\n
"
,
action
,
policy
,
reg_policy
);
if
(
policy
!=
URLPOLICY_QUERY
)
{
policy
=
0xdeadbeef
;
hres
=
IInternetSecurityManager_ProcessUrlAction
(
secmgr
,
url9
,
action
,
(
BYTE
*
)
&
policy
,
sizeof
(
WCHAR
),
NULL
,
0
,
0
,
0
);
if
(
reg_policy
==
URLPOLICY_DISALLOW
)
ok
(
hres
==
S_FALSE
,
"ProcessUrlAction(%x) failed: %08x, expected S_FALSE
\n
"
,
action
,
hres
);
else
ok
(
hres
==
S_OK
,
"ProcessUrlAction(%x) failed: %08x
\n
"
,
action
,
hres
);
ok
(
policy
==
0xdeadbeef
,
"(%x) policy=%x
\n
"
,
action
,
policy
);
}
}
static
void
test_polices
(
void
)
{
IInternetZoneManager
*
zonemgr
=
NULL
;
IInternetSecurityManager
*
secmgr
=
NULL
;
HRESULT
hres
;
hres
=
CoInternetCreateSecurityManager
(
NULL
,
&
secmgr
,
0
);
ok
(
hres
==
S_OK
,
"CoInternetCreateSecurityManager failed: %08x
\n
"
,
hres
);
hres
=
CoInternetCreateZoneManager
(
NULL
,
&
zonemgr
,
0
);
ok
(
hres
==
S_OK
,
"CoInternetCreateZoneManager failed: %08x
\n
"
,
hres
);
test_url_action
(
secmgr
,
zonemgr
,
URLACTION_SCRIPT_RUN
);
test_url_action
(
secmgr
,
zonemgr
,
URLACTION_ACTIVEX_OVERRIDE_OBJECT_SAFETY
);
test_url_action
(
secmgr
,
zonemgr
,
URLACTION_CHANNEL_SOFTDIST_PERMISSIONS
);
test_url_action
(
secmgr
,
zonemgr
,
0xdeadbeef
);
IInternetSecurityManager_Release
(
secmgr
);
IInternetZoneManager_Release
(
zonemgr
);
}
static
void
test_ZoneManager
(
void
)
{
IInternetZoneManager
*
zonemgr
=
NULL
;
...
...
@@ -1392,6 +1467,7 @@ START_TEST(misc)
test_CoInternetQueryInfo
();
test_FindMimeFromData
();
test_SecurityManager
();
test_polices
();
test_ZoneManager
();
test_NameSpace
();
test_MimeFilter
();
...
...
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