Export (0) Print
Expand All

IInternetSecurityManager::SetZoneMapping method

Maps a pattern into the specified zone.

Syntax


HRESULT SetZoneMapping(
  [in]  DWORD dwZone,
  [in]  LPCWSTR lpszPattern,
  [in]  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.

Return codeDescription
S_OK

Success.

E_ACCESSDENIED

Attempted to enter a non-SSL site into a zone that requires server verification.

E_FAIL

The 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 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.

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows 2000 Server

DLL

Urlmon.dll

See also

IInternetSecurityManager

 

 

Show:
© 2014 Microsoft