CHttpClient::GetDefaultZoneId Method  
 
BOOL GetDefaultZoneId(
  LPDWORD lpdwZoneId  
);

The GetDefaultZoneId method returns the default security zone for downloaded files.

Parameters

lpdwZoneId
A pointer to an unsigned integer which is updated with the default zone ID for the client session. It may be one of the following values:
Value Description
SECURITY_ZONE_NONE The file does not have a zone identifier associated with it.
SECURITY_ZONE_LOCAL The file is considered to be part of the local computer zone.
SECURITY_ZONE_INTRANET The file originates from the local intranet zone, such as an internal corporate network.
SECURITY_ZONE_TRUSTED The file originates from a site in the Trusted Sites zone.
SECURITY_ZONE_INTERNET The file was downloaded from the Internet and is treated with caution by Windows.
SECURITY_ZONE_RESTRICTED The file originates from a site in the Restricted Sites zone, which is used for untrusted content.

Return Value

If the method succeeds, the return value is non-zero and lpdwZoneId will be updated with the default zone identifier. If no default zone has been explicitly set, the function will still return success and lpdwZoneId will be set to SECURITY_ZONE_NONE. If the method fails, it returns zero. To get extended error information, call the GetLastError method.

Remarks

The GetDefaultZoneId method returns the zone identifier which was previously set using the SetDefaultZoneId method. If no default zone has been specified for the client session, the default behavior is to not set a security zone for the file. This maintains backwards compatibility with previous versions of the library which would not create the security zone metadata for local files.

This method is typically used to confirm the currently configured zone before downloading a file, or to verify whether the default behavior has been overridden. The default zone ID is specific to the client session and does not affect other sessions or system-wide settings.

To get the security zone identifier for a local file, use the GetFileZoneInfo method. To change or remove the security zone information for a file, use the SetFileZoneInfo method.

For more detailed information about the zone identifiers, refer to the SetDefaultZoneId method.

Requirements

Minimum Desktop Platform: Windows 7 Service Pack 1
Minimum Server Platform: Windows Server 2008 R2 Service Pack 1
Header File: cstools12.h
Import Library: cshtpv12.lib

See Also