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
a18d3fae
Commit
a18d3fae
authored
Sep 30, 2005
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 30, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added GetZoneActionPolicy implementation.
parent
6613580e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
110 additions
and
8 deletions
+110
-8
sec_mgr.c
dlls/urlmon/sec_mgr.c
+74
-8
misc.c
dlls/urlmon/tests/misc.c
+36
-0
No files found.
dlls/urlmon/sec_mgr.c
View file @
a18d3fae
...
...
@@ -420,6 +420,46 @@ typedef struct {
LONG
ref
;
}
ZoneMgrImpl
;
static
HRESULT
open_zone_key
(
DWORD
zone
,
HKEY
*
hkey
,
URLZONEREG
zone_reg
)
{
static
const
WCHAR
wszZonesKey
[]
=
{
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'M'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'\\'
,
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
't'
,
'V'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
'\\'
,
'I'
,
'n'
,
't'
,
'e'
,
'r'
,
'n'
,
'e'
,
't'
,
' '
,
'S'
,
'e'
,
't'
,
't'
,
'i'
,
'n'
,
'g'
,
's'
,
'\\'
,
'Z'
,
'o'
,
'n'
,
'e'
,
's'
,
'\\'
,
0
};
static
const
WCHAR
wszFormat
[]
=
{
'%'
,
's'
,
'%'
,
'l'
,
'd'
,
0
};
WCHAR
key_name
[
sizeof
(
wszZonesKey
)
/
sizeof
(
WCHAR
)
+
8
];
HKEY
parent_key
;
DWORD
res
;
switch
(
zone_reg
)
{
case
URLZONEREG_DEFAULT
:
/* FIXME: TEST */
case
URLZONEREG_HKCU
:
parent_key
=
HKEY_CURRENT_USER
;
break
;
case
URLZONEREG_HKLM
:
parent_key
=
HKEY_LOCAL_MACHINE
;
break
;
default:
WARN
(
"Unknown URLZONEREG: %d
\n
"
,
zone_reg
);
return
E_FAIL
;
};
wsprintfW
(
key_name
,
wszFormat
,
wszZonesKey
,
zone
);
res
=
RegOpenKeyW
(
parent_key
,
key_name
,
hkey
);
if
(
res
!=
ERROR_SUCCESS
)
{
WARN
(
"RegOpenKey failed
\n
"
);
return
E_INVALIDARG
;
}
return
S_OK
;
}
/********************************************************************
* IInternetZoneManager_QueryInterface
*/
...
...
@@ -531,15 +571,41 @@ static HRESULT WINAPI ZoneMgrImpl_SetZoneCustomPolicy(IInternetZoneManager* ifac
* IInternetZoneManager_GetZoneActionPolicy
*/
static
HRESULT
WINAPI
ZoneMgrImpl_GetZoneActionPolicy
(
IInternetZoneManager
*
iface
,
DWORD
dwZone
,
DWORD
dwAction
,
BYTE
*
pPolicy
,
DWORD
cbPolicy
,
URLZONEREG
urlZoneReg
)
DWORD
dwZone
,
DWORD
dwAction
,
BYTE
*
pPolicy
,
DWORD
cbPolicy
,
URLZONEREG
urlZoneReg
)
{
FIXME
(
"(%p)->(%08lx %08lx %p %08lx %08x) stub
\n
"
,
iface
,
dwZone
,
dwAction
,
pPolicy
,
cbPolicy
,
urlZoneReg
);
return
E_NOTIMPL
;
WCHAR
action
[
16
];
HKEY
hkey
;
LONG
res
;
DWORD
size
=
cbPolicy
;
HRESULT
hres
;
static
const
WCHAR
wszFormat
[]
=
{
'%'
,
'l'
,
'X'
,
0
};
TRACE
(
"(%p)->(%ld %08lx %p %ld %d)
\n
"
,
iface
,
dwZone
,
dwAction
,
pPolicy
,
cbPolicy
,
urlZoneReg
);
if
(
!
pPolicy
)
return
E_INVALIDARG
;
hres
=
open_zone_key
(
dwZone
,
&
hkey
,
urlZoneReg
);
if
(
FAILED
(
hres
))
return
hres
;
wsprintfW
(
action
,
wszFormat
,
dwAction
);
res
=
RegQueryValueExW
(
hkey
,
action
,
NULL
,
NULL
,
pPolicy
,
&
size
);
if
(
res
==
ERROR_MORE_DATA
)
{
hres
=
E_INVALIDARG
;
}
else
if
(
res
==
ERROR_FILE_NOT_FOUND
)
{
hres
=
E_FAIL
;
}
else
if
(
res
!=
ERROR_SUCCESS
)
{
ERR
(
"RegQueryValue failed: %ld
\n
"
,
res
);
hres
=
E_UNEXPECTED
;
}
RegCloseKey
(
hkey
);
return
hres
;
}
/********************************************************************
...
...
dlls/urlmon/tests/misc.c
View file @
a18d3fae
...
...
@@ -451,6 +451,41 @@ static void test_SecurityManager(void)
IInternetSecurityManager_Release
(
secmgr
);
}
static
void
test_ZoneManager
(
void
)
{
IInternetZoneManager
*
zonemgr
=
NULL
;
BYTE
buf
[
32
];
HRESULT
hres
;
hres
=
CoInternetCreateZoneManager
(
NULL
,
&
zonemgr
,
0
);
ok
(
hres
==
S_OK
,
"CoInternetCreateZoneManager failed: %08lx
\n
"
,
hres
);
if
(
FAILED
(
hres
))
return
;
hres
=
IInternetZoneManager_GetZoneActionPolicy
(
zonemgr
,
3
,
0x1a10
,
buf
,
sizeof
(
DWORD
),
URLZONEREG_DEFAULT
);
ok
(
hres
==
S_OK
,
"GetZoneActionPolicy failed: %08lx
\n
"
,
hres
);
ok
(
*
(
DWORD
*
)
buf
==
1
,
"policy=%ld, expected 1
\n
"
,
*
(
DWORD
*
)
buf
);
hres
=
IInternetZoneManager_GetZoneActionPolicy
(
zonemgr
,
3
,
0x1a10
,
NULL
,
sizeof
(
DWORD
),
URLZONEREG_DEFAULT
);
ok
(
hres
==
E_INVALIDARG
,
"GetZoneActionPolicy failed: %08lx, expected E_INVALIDARG
\n
"
,
hres
);
hres
=
IInternetZoneManager_GetZoneActionPolicy
(
zonemgr
,
3
,
0x1a10
,
buf
,
2
,
URLZONEREG_DEFAULT
);
ok
(
hres
==
E_INVALIDARG
,
"GetZoneActionPolicy failed: %08lx, expected E_INVALIDARG
\n
"
,
hres
);
hres
=
IInternetZoneManager_GetZoneActionPolicy
(
zonemgr
,
3
,
0x1fff
,
buf
,
sizeof
(
DWORD
),
URLZONEREG_DEFAULT
);
ok
(
hres
==
E_FAIL
,
"GetZoneActionPolicy failed: %08lx, expected E_FAIL
\n
"
,
hres
);
hres
=
IInternetZoneManager_GetZoneActionPolicy
(
zonemgr
,
13
,
0x1a10
,
buf
,
sizeof
(
DWORD
),
URLZONEREG_DEFAULT
);
ok
(
hres
==
E_INVALIDARG
,
"GetZoneActionPolicy failed: %08lx, expected E_INVALIDARG
\n
"
,
hres
);
IInternetZoneManager_Release
(
zonemgr
);
}
START_TEST
(
misc
)
{
test_CreateFormatEnum
();
...
...
@@ -458,4 +493,5 @@ START_TEST(misc)
test_CoInternetParseUrl
();
test_FindMimeFromData
();
test_SecurityManager
();
test_ZoneManager
();
}
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