Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
Security Zones
Reference
Interfaces
 SetZoneMapping Method

  Switch on low bandwidth view
IInternetSecurityManager::SetZoneMapping Method

Maps a pattern into the specified zone.

Syntax

HRESULT SetZoneMapping(      
    DWORD dwZone,     LPCWSTR lpszPattern,     DWORD dwFlags );

Parameters

dwZone
[in] An unsigned long integer value that specifies the zone index. Can be one of the following values.
URLZONE_LOCAL_MACHINE
Pattern is mapped into the local machine zone.
URLZONE_INTRANET
Pattern is mapped into the intranet zone.
URLZONE_TRUSTED
Pattern is mapped into the trusted zone.
URLZONE_INTERNET
Pattern is mapped into the Internet zone.
URLZONE_UNTRUSTED
Pattern is mapped into the untrusted zone.
URLZONE_USER_MIN...URLZONE_USER_MAX
Pattern is mapped into a user defined zone.
lpszPattern
[in] 

A string value that contains the URL pattern with a limited number of wildcards.

The following table displays valid and invalid pattern values.

Example PatternValidity
*://*.example.comValid
http://*.contoso.co.ukValid
*://server.contoso.comValid
ftp://192.168.0.0/Valid
https://example/Valid
file:\example\shareValid
*://172.16-31.0.0.*Valid
http://*.server.example.comInvalid
ftp://*Invalid
dwFlags
[in] An unsigned long integer value that indicates whether the mappings should be added or deleted. This can be one of the SZM_FLAGS values.

Return Value

Returns one of the following values.

S_OKSuccess.
E_ACCESSDENIEDAttempted to enter a non-SSL site into a zone that requires server verification.
E_FAILThe mapping already exists.

Remarks

The method can also return the HRESULT derived from the Microsoft Win32 error code ERROR_FILE_EXISTS, which indicates that the URL already exists in another zone.

In Microsoft Windows Server 2003 and later, dwZone can specify a bitwise OR between one of the given values and URLZONE_ESC_FLAG to indicate that the pattern is mapped into an enhanced security configuration zone.

In Windows Server 2003 and later, applications that map domains to user-defined security zones in the range URLZONE_USER_MIN to URLZONE_USER_MAX might not function properly under the enhanced security configuration.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker