FtpGetDefaultZoneId Function  
 
BOOL WINAPI FtpGetDefaultZoneId(
  HCLIENT hClient,  
  LPDWORD lpdwZoneId  
);

The FtpGetDefaultZoneId function returns the default security zone for downloaded files.

Parameters

hClient
Handle to the client session.
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 function 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 the variable lpdwZoneId points to will be set to SECURITY_ZONE_NONE. If the function fails, it returns zero. To get extended error information, call FtpGetLastError.

Remarks

The FtpGetDefaultZoneId function returns the zone identifier which was previously set using the FtpSetDefaultZoneId function. 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 function 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 FtpGetFileZoneInfo function. To change or remove the security zone information for a file, use the FtpSetFileZoneInfo function.

For more detailed information about the zone identifiers, refer to the FtpSetDefaultZoneId function.

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: csftpv12.lib

See Also